Patrioticcow
Patrioticcow

Reputation: 27038

how to know when conversion is done when using ffmpeg php?

i am converting some videos using this syntax. e

exec("ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv", $out);

verything works ok, just that i don't know when the files are ready.

print_r($out) doesn't seem to return anything

any ideas?

Thanks

Upvotes: 1

Views: 1582

Answers (1)

Sina Karimi
Sina Karimi

Reputation: 368

You can capture the output that ffmpeg produces into a separate text file. This text file is produced once ffmpeg finishes it's conversion. You can use the following command:-

ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv 2> path/to/log.txt

Then in PHP you can just run a check to see if that log file exists yet or not, if it does then it's finished converting :)

Upvotes: 2

Related Questions