Reputation: 532
I'm trying to convert various video files from .mpeg to .ogg theora videos. This command works fine when I test it in its own program, but fails to run properly inside the program it was intended for. I don't understand what's breaking here. Adding a -vcodec
flag causes other errors.
Here is the function I am using to run ffmpeg
:
* This method converts a file to Ogg Theora video using ffmpeg.
*
* @param f
* The file to encode. (Assumes that the file has a .mpeg
* extension. If the file doesn't have this, the method will
* fail.)
* @param nice The niceness of the created ffmpeg
* priority.
* @return converter The process that represents ffmpeg working on the file.
*/
private Process encodeFileAsTheora(File f, int nice) {
Process converter = null;
try {
String targetFileName = f.getAbsolutePath()
.replace(".mpeg", ".ogg");
// mLogger.log(Level.INFO,
// "Now attempting to convert " + f.getAbsolutePath());
String[] ffmpegCommand = { "nice", "-n", Integer.toString(nice),
"ffmpeg", "-i", f.getAbsolutePath(), targetFileName };
converter = Runtime.getRuntime().exec(ffmpegCommand);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return converter;
}
And here is its getErrorStream()
output to the logger:
NON RELEVANT CONTENT REMOVED
configuration: --extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/libvpx --extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/libvpx --enable-libvpx --enable-libx264 --enable-gpl --yasmexe=/home/user/trunk/cpp_src/ffmpeg-source/yasm/yasm
Upvotes: 0
Views: 321
Reputation: 11184
SEVERE: DDCS - configuration: --extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/libvpx --extra-ldflags=-L/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/x264 --extra-cflags=-I/home/user/trunk/cpp_src/ffmpeg-source/libvpx --enable-libvpx --enable-libx264 --enable-gpl --yasmexe=/home/user/trunk/cpp_src/ffmpeg-source/yasm/yasm
Your ffmpeg is not compiled with libtheora support, so you can't encode to ogg/theora.
Upvotes: 3