Reputation: 4506
I am trying to evoke FFMPEG directly in my Java code (running under the Playframework!). The final product will run on a Linux/Debian distro, but I first need to test on my Mac (I don't know if it works on Debian yet).
I try to execute the simple code:
Process pr = Runtime.getRuntime().exec(new String[]{"bash","-c", "ffmpeg"});
or simpler:
Process pr = Runtime.getRuntime().exec("ffmpeg")
or using ProcessBuilder:
Process pr = new ProcessBuilder("/opt/local/bin/ffmpeg").start();
What I get is an error code 133, but I cannot find what this means. In the terminal the command gives the normal output. I can also replace 'ffmpeg' with e.g. 'ls -la' and get the directory listing. But I don't know what the problem is that ffmpeg does not work.
Anybody any clues? Thanks!
UPDATE: I looked at the error stream. These are the errors I get. How is it that it works in the terminal, but not in using Java?
14:43:19,619 DEBUG ~ FFMPEG: dyld: Library not loaded: /opt/local/lib/libogg.0.dylib
14:43:19,619 DEBUG ~ FFMPEG: Referenced from: /opt/local/bin/ffmpeg
14:43:19,619 DEBUG ~ FFMPEG: Reason: Incompatible library version: ffmpeg requires version 9.0.0 or later, but libogg.0.dylib provides version 6.0.0
Upvotes: 2
Views: 1095
Reputation: 4506
I used Xuggle for my video encoding and it happened to include an older version and is in the class path. Even though the link shown is from the newer, it used the older.
Upvotes: 2