convert flv to mp3 with Java
Posted
by
krial
on Stack Overflow
See other posts from Stack Overflow
or by krial
Published on 2010-10-25T15:02:55Z
Indexed on
2011/01/13
13:53 UTC
Read the original article
Hit count: 165
Hi, I'm pretty new in developing programs in Java. I'm currently writing a program that converts a flv video into mp3. I have already written such a program in Visual Studio.net C#, but the Problem is, that it isn't cross platform compatible... I used the ffmpeg binary to convert the video into mp3, but I can't find ffmpeg binaries for Mac and Linux. (if so, I could start the specific binaries from java, depending on the OS) So I tried to convert the video with Xuggle, but the final mp3 has 0 bytes. My current code is the following:
IMediaReader reader = ToolFactory.makeReader("video.flv");
reader.addListener(ToolFactory.makeWriter("music.mp3", reader));
while (reader.readPacket() == null)
do {} while(false);
Thanks in advance.
p.s sorry for my bad english
© Stack Overflow or respective owner