Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have some intranet training videos made over the years in a bunch of formats (AVI, WMV, MOV, RealPlayer) and would like to provide something like a preview function - maybe a thumbnail animated GIF with a few representative screens, or maybe a thumbnail sheet I can show the user with an image every few seconds of video. Is there an easy image tool I can use that can create such things?

Platform agnostic would be great, but it's a one off (for now, haha), so Windows, Mac, or Linux would be fine. Thanks.

share|improve this question
add comment

4 Answers 4

up vote 3 down vote accepted

I just thought that this should be easily done in python and a Google search for "python video thumbnail" results in this site:

http://notbrainsurgery.livejournal.com/29773.html

You might try the sourcode provided there...

share|improve this answer
    
+2 if I could. That not only works, but its easy to extract a single frame, then another one with 5 - 6 frames, so that previews animate only over mouseover. What a useful link :) –  Tim Post Jul 29 '10 at 11:29
add comment

Can't miss the holy grail of video systems, FFMPEG. It does just about everything you might need to in online video--take in multiple formats and convert to another, thumbnail, etc. A heavily modified industrial variation of FFMPEG is what allows YouTube to work the way it does.

Here's a quick command line tut for thumbnailing: http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/

There's many other tuts out there for all its other features.

share|improve this answer
add comment

I have already answered how to do this on Stack Overflow here using ffmpeg and PHP.

Sorry about the code-centric answer but doing this in a batch process is most easily done by writing some actual code.

/**
* ExtractThumb, extracts a thumbnail from a video
*
* This function loads a video and extracts an image from a frame 4 
* seconds into the clip
* @param $in string the input path to the video being processed
* @param $out string the path where the output image is saved
*/
function ExtractThumb($in, $out)
{
    $thumb_stdout;
    $errors;
    $retval = 0;

    // Delete the file if it already exists
    if (file_exists($out)) { unlink($out); }

    // Use ffmpeg to generate a thumbnail from the movie
    $cmd = "ffmpeg -itsoffset -4 -i $in -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 $out 2>&1";
    exec($cmd, $thumb_stdout, $retval);

    // Queue up the error for processing
    if ($retval != 0) { $errors[] = "FFMPEG thumbnail generation failed"; }

    if (!empty($thumb_stdout))
    {
        foreach ($thumb_stdout as $line)
        {
            echo $line . "\n";
        }
    }

    if (!empty($errors))
    {
        foreach ($errors as $error)
        {
            echo $error . "\n";
        }
    }
}

Doesn't get much more cross-platform than that.

Here's a breakdown of the flags:

  • -itsoffset flag is the time in the video that the snapshot is taken
  • -vcodec is the output type (change to png for png, etc...)
  • -vframes is set to one because you're extracting only one frame (IE an image)
  • you may also need to add -deinterlace

That's about it. Doesn't get much easier than that. If you're doing multiple screenshots for a movie just change the -itsoffset flag. Other than that, it's a complete package unless you chose to add better error information or suppress outputs.

share|improve this answer
add comment

I think Flowplayer (It's very good documented and with many examples) or something similar is a better solution as a snippet which you maybe have to edit or maintain.

Once FlowPlayer is configured right, it can serve thumbs without loading the full video. It's a little bit tricky to configure this, but once it's work you have solid, multiplattform solution. (And with a click on the thumb the video plays ;-))

If you choose flowplayer, you should also take a look at video4all (uses html5 with flowplayer as fallback) and the flowplayer-plugins.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.