Create Video thumbnail in slim

2019-03-06 17:47发布

问题:

I am creating api's using slim framework.My problem is that i am trying to upload video to localserver but the thumbnails of video are not generating. I have tried ffmpeg but it is not working:

Here is my code:

exec('ffmpeg -itsoffset -4 -i C:\xampp\htdocs\givemethatpic\shared_17008.mp4  -vcodec mjpeg -vframes 1 -an -f rawvideo -ss 620x440  C:\xampp\htdocs\givemethatpic\tdrrsss.jpg');

I used ffmpeg-win32 setup and it installed the ffmpeg to C:\Program Files (x86). I do not know where i am wrong.Please tell why thumbnail is not generating??

回答1:

I changed the command like this exec('ffmpeg -y -i '.$file_path.' -vcodec mjpeg -ss 00:00:01 -vframes 1 -an -s 620x440 -f rawvideo '.$image.'',$thumb_stdout, $retval); and everthing is working fine



标签: video ffmpeg