PHP FFmpeg conversion issues for mp4 files -


i want images out of mp4 file using ffmpeg-php.

i have

 $str_command= '/usr/bin/ffmpeg -i /test/ts.mp4 -r 1 -ss 00:00:10 -t 00:00:01 -s 300x300 -f image2 /test/images/';  shell_exec($str_command); 

however, got error message saying

 buffering several frames not supported. please consume available frames before adding new one. 

i have spent hours on web couldn't find answer this. can me this? much!

have checked out ffmpeg library php? i've worked before , abstracts away of complicated command line calls 1 you're trying run. can use $movie->getframe($n) frame object, , $frame->togdimage() output image.

for example,

$movie = new ffmpeg('/path/to/movie.mp4'); $frame10 = $movie->getframe(10); $image = $frame10->togdimage();  // display image header('content-type: image/jpeg'); imagejpeg($image);  // or save file $saved = imagejpeg($image, '/path/to/new/file.jpg'); 

check out documentation @ http://ffmpeg-php.sourceforge.net/doc/api/


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -