I'm trying to convert an .mp4 to a .opus file using ffmpeg. I have a directory on my desktop called Indexing
which has a test file called 40.mp4
. I've tried using the command ffmpeg -i 40.mp4 -b:a 320k 40.opus
which always works from a terminal set in the Indexing directory, but trying the same thing using Java always fails:
NOTE: I'm running on Kubuntu 17.10
private static final Path INDEXING_PATH = Paths.get("/home/sarah/Desktop/Indexing");
Process proc = new ProcessBuilder("ffmpeg -i 40.mp4 -b:a 320k 40.opus") .directory(INDEXING_PATH.toFile()).inheritIO().start();
Yields:
Exception in thread "main" java.io.IOException: Cannot run program "ffmpeg -i 40.mp4 -b:a 320k 40.opus" (in directory "/home/sarah/Desktop/Indexing"): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)