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
ProcessBuilderto make things easier. But why not use jffmpeg instead? I am guessing it has better ways to interface with the API than invoking a newProcess.