Feedback

type to search

Command line util to generate thumbnails/contact sheet from video?

Asked by , Edited by Fernando C. Estrada [ Admin ]

As the title says, does anyone know of anything than can generate a contact sheet (e.g. jpg etc) from a video? I’m mainly interested in starting from FLV files, but i guess the solution will probably work for other formats with appropriate codecs etc. So, for example, if i have a 30 minute video, every 2 minutes i’d like it to generate a thumbnail and then put 15 of these in a 5 x 3 grid in a single jpg. On Windows, “Media Player Classic Homecinema” will do this through its “Save Thumbnails” command.

Ideally i’d like to do this from the command line/script in a debian server environment, rather than a desktop GUI. It doesn’t have to be a single command, if a chain of steps could do it.

Thanks in advance.

NN comments
alan
-

Thanks for your answers guys. I’ve been directed to this solution: http://forums.debian.net/viewtopic.php?f=16&t=39342 which involves a perl script called dhyana which does exactly what I’m looking for. It uses mplayer, ffmpeg and imagemagick, but does all the hard work of putting the individual thumbnails together into a single jpeg too.

or Cancel

2 answers

1

hobart [ Editor ]

The package ‘ffmpegthumbnailer’ from the Debian package repositories should do what you need.

Example: (assuming RickRoll_D.flv and wanting to produce 11 thumbnails from 0% to 100%)

$ for ((i=0; i<=100; i+=10)); do ffmpegthumbnailer -i RickRoll-D.flv -o thumb${i}.jpg -t \${i}; done

The FFmpeg utility can generate thumbnails by itself as well – Prashanth Ellina’s blog entry gives examples.

or Cancel
1

tassbur

The best combination i guess you could have is:

  1. ffmpegthumbnailer (as hobart answered before)
  2. convert (or mogrify) from imagemagick to resize thumbnails to fit your needs
  3. montage from imagemagick to put it in a grid (in pdf for example) 
There are a lot of examples for convert in imagemagick’s site ( http://www.imagemagick.org/Usage/thumbnails/ )

Also There are a lot of examples for montage in imagemagick’s site ( http://www.imagemagick.org/Usage/montage/ )

I hope this will help you
or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.