Generating Thumbnails from FLV using FFMPEG

Posted by JuanJose on Mar 15, 2009 in Business, Great Deals, PHP Programming, Programming, Web Hosting, Websites, laconica |

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

5 Comments

  • Pierre says:

    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!

  • JuanJose says:

    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.

  • Delaney says:

    Could you please explain how to call this file to create a thumbnail?

    Thank you

  • Randy says:

    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.

  • widi dwi says:

    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 ….

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2006-2010 Gimme Soda All rights reserved.
Desk Mess Mirrored v1.4.6 theme from BuyNowShop.com.