1

I installed ffmpeg through brew in MAC OS and using its terminal the below command executes absolutely fine.

ffprobe -v quiet -print_format json -show_format -show_streams test.mp4

I have written the below code and it runs fine when running through "javac" and "java" command.

Code :

String[] strg = new String[]{"~/bin/bash","-c","ffprobe -v quiet -print_format json -show_format -show_streams /Users/qa/Desktop/666_Day01_Hr002.MP4"};
        Process p = Runtime.getRuntime().exec(strg);

But when I am trying with JAR self executable, getting the below error. IOException Cannot run program "ffmpeg":error=2, No such file or directory

Somebody asked the same question, bit it did not help me in any way.

Please help me.

Community
  • 1
  • 1
  • I created a .java file in MAC machine and compiled it and run it using JAVAC & JAVA command from terminal and it run with correct output. The code is: `String[] cmd = new String[]{"/bin/bash","-c","ffprobe -v quiet -print_format json -show_format -show_streams /Users/qa/Desktop/666_Day01_Hr002.MP4"}; Process p = Runtime.getRuntime().exec(cmd);` The same code from a self executable JAR is not running in MAC machine and giving the below error. /bin/bash ffprobe Not a proper command. – S Anil Kumar Dora Oct 05 '16 at 13:42

0 Answers0