The Blog of a Programmer
Generating Thumbnails from FLV using FFMPEG
I had to make some modifications to a zenGallery system which was going to hold a lot of flash video files and I was too lazy to create a thumbnail for each image so for awhile it had the default thumbnail.
After a few, “what’s with the thumbnails?” I decided to write a script that executed ffmpeg to create a thumbnail for each video (from the frame 10 seconds into the video) and write out a jpg image.
The filename currently just replaces .flv with .jpg and my settings for the call are pretty generic. If anyone has questions about this feel free to ask.
Grab the .phps file from here: Generate Thumbnails from FLV files using FFMPEG
| This entry was posted by JuanJose on March 15, 2009 at 3:15 am, and is filed under PHP, Programming. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 1 year ago
Hi, This is exactly what I was trying to figure out!
I dumped a precompiled copy of ffmpeg on my server, chmod +x to make an executable, and I tested that is working.
However I have never come accross a phps file, and was wondering just what I do to execute the script?
Thanks!
about 1 year ago
Hi Pierre.
phps (PHP Source) is just a filename extension that was meant as a way to display the source code of php files. Some web servers are even setup to do code highlighting when using this extension.
So take the code and save it as php instead of phps and it should work.
Enjoy.
about 12 months ago
Could you please explain how to call this file to create a thumbnail?
Thank you
about 11 months ago
It appears that it parses through a directory and creates thumb nails for any images in that directory. It doesn’t appear to be the type of script you call in the middle of another but that you run after you upload new photos. You can, however, reverse engineer it to make your own script to use inline. Something like if file_exists($filename) then display image, else ffmpeg the flv named xx and generate the new image.
Yeah, that’s not really a clear explanation, but basically it wouldn’t take much effort to reverse engineer it and read some documentation to make your own
Nice script, btw.
about 8 months ago
just curious … i wonder how if i have file in my computer and i call ffmeg for make some thumbnail and store it in server ….
about 2 months ago
about 2 months ago
Just save the file as .php and modify it to your own needs. The .phps extension stands for php source and was (still is sometimes!) used when people wanted to share their PHP source code. Of course there are less confusing ways to share, but old habits die hard.