0

I installed ffmpeg on mac through brew install. When i run ffmpeg command from terminal, it is running fine. But when i create a program in java and execute command like

Runtime.getRuntime().exec("ffmpeg");

It is throwing IOException Cannot run program "ffmpeg":error=2, No such file or directory. Any idea how to resolve it?

sunder
  • 968
  • 2
  • 11
  • 31

1 Answers1

0

Try using the below code

String[] command = new String[]{"/bin/bash","-c","ffmpeg -version"};            
        Process p = Runtime.getRuntime().exec(command);