views:

432

answers:

5

hi

i want to display thumbnails or preview panels for videos listed on my site, i want to fetch a single frame from a video (from a particular time i.e get a frame of exactly after 1 min) and display them as thumbnails as in youtube...

Any help?

+3  A: 

Take a look at the ffmpeg-php library. It's the only simple way to manipulate videos of different formats in PHP.

There's also a wrapper called PHP Video Toolkit, you can find it here: http://sourceforge.net/projects/phpvideotoolkit/

Napolux
Can i create thumbnails using ffmpeg-php? I was thinking that it can be used to convert videos to different formats... If it's possible , how can i do that? is there any predefined functions or methods available in ffmpeg?
kvijayhari
Dwwnload the package and take a look at example02.php: there's the $toolkit->extractFrames() call that does exactly what you need... ;)You can easily modify the source code to extract only one frame at a given time.
Napolux
Thanks Napolux. That helped me great. But would you mind explaining me , How can we improve the quality of the thumbnail picture?
kvijayhari
Any answers for my comment? still curious to know...
kvijayhari
A: 

Try following this tutorial on PHP and ffmpeg, http://www.alberton.info/video_preview_as_animated_gif_with_ffmpeg_and_spl.html

kb
A: 

Apple QuickTime has the functionality to do this if you upgrade to the Pro version.

http://www.apple.com/quicktime/pro/

I don't think he's searching for this kind of solution ;)
Napolux
A: 

Adding to how to use the ffmpeg answer, this is the parameters you're looking for:

ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
Cawas