I am running ffmpeg.exe through a Java code to encode a video file. How will my program come to know when ffmpeg terminated (i.e. video file is encoded)?
Here is the code:
Runtime.getRuntime().exec("ffmpeg -ac 2 -i audio.wav -i video.flv -sameq out.flv");
You can use
waitFor()method ofjava.lang.Process:With this, the current thread waits until the
Process phas terminated.EDIT:
You can try to see the output from ffmpeg:
and