So, I am creating a program that converts .flv files to other formats. For this, I use ffmpeg, which does its job fine by executing it through the command line. For instance:
ffmpeg -i C:\test.flv -acodec libmp3lame -y C:\test.mp3
This example works like a charm - there is no problem running the command.
BUT, when I try to execute the same command from a Java class, a problem occurs. I do this in a try-catch block:
System.out.println("Start");
Process p = Runtime.getRuntime().exec("cmd /c ffmpeg -i C:\test.flv -acodec libmp3lame -y C:\test.mp3");
System.out.println("End");
The console prints "Start." It starts to convert, and it does not end.
Can someone help me?
source
share