Today i wasted my time a little and tried to capture an image from an avi or mpeg or wmv or flv …
And i managed to do it properly.
Here’s the code for taking a screenshot / capturing a frame from any of the above movie types.
/usr/bin/ffmpeg -itsoffset -4 -i /home/videos/".$video_name.$extension." -vframes 1 -an -f mjpeg -s 122x92 /home/videos/".$video_name.".jpegwhere /home/videos/ is the path to your video file, $video_name is your video name, $extension is it’s extension and 122x92 is the resolution in which you want the capture to be saved (you can always choose 640x480 or any value you need).
Use it with PHP exec() function.
Hope it’s of use to you too …
I made it work with png too …
–The Pirahna (aka Piry)






