I use FFmpeg in my local xamp and it works fine. But on my server (FFmpeg installed) exec
does not work and FFmpeg does not create output file.
This is my code:
<?php
extension_loaded('ffmpeg') or die('Error in loading ffmpeg');
$vid = realpath('test.mp4');
$ffmpegInstance = new ffmpeg_movie($vid);
echo "getDuration: " . $ffmpegInstance->getDuration() . "<br />".
"getFrameCount: " . $ffmpegInstance->getFrameCount() . "<br />".
$cmd = "ffmpeg -i $vid -s 640x360 -vcodec libx264 -preset medium -crf 23 -acodec libmp3lame -ar 44100 -q:a 5 out.flv 1> block.txt 2>&1";
//$cmd = "ffmpeg -i $vid -vcodec libvpx -cpu-used -5 -deadline realtime out.mp4 1> block.txt 2>&1";
exec($cmd);
?>