I have to get the thumbnail image of video i am using the ffmpeg. On my server i run the ffmpeg command from ssh then it is working but from the php exec function it is not working it gives the error /usr/bin/ffmpeg : no such file or dirctory but the ffmpeg is installed on this location usr/bin/ffmpeg. my source code is:
$ffmpeg = '/usr/bin/ffmpeg';
$videoname = 'myvideo.mp4';
$video = $_SERVER['DOCUMENT_ROOT'].'/uploads/videos/'.$videoname;
$image = $_SERVER['DOCUMENT_ROOT'].'/uploads/thumbs/thumb.jpg';
$second = 1;
$cmd = "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2>&1";
exec($cmd);
Please provide any solution.
exec()
and assuming that you've not made a mistake, why not print the command that's being run and verify that it's correct? – Sammitch