image full size
Note to users, mods and admins: this is from my own rip of my own purchased copy of Salaam Bombay! No copyright infringement here, only fair use.
These contact sheet style video thumbnails are easily done in Windows using Media Player Classic (typically) but free operating systems have never had a great tool to make this quick and easy. There are some nice things like ffmpegthumbnailer and imagemagick but it would be truly laborious to use those to make a single sheet of multiple images. I've been looking for quite a while for a reasonable way to accomplish this and I stumbled across it today:
dhyana
It's a perl script which uses mplayer, imagemagick, ffmpeg and various perl modules. Get the latest version from http://tobyinkster.co.uk/tag/dhyana/
Because it's a script it doesn't depend on any desktop environment, you can just as easily use it in Gnome, KDE, Xfce, Fluxbox etc or with no graphical environment at all (install mplayer-nogui instead of mplayer).
Download the latest version of the script from the author.
Adapting it for Debian
First make sure you have the main dependencies already installed, that is mplayer, Perl, ImageMagick and ffmpeg.
dhyana needs an mplayer script, midentify, which is not found in the Debian packages. So download the mplayer source from http://www.mplayerhq.hu. Unpack the source and midentify.sh is found in the directory mplayer-<version>/TOOLS/
It needs to be in /usr/bin/ to work (I tried it in /usr/local/bin/ and it failed) so copy it and make it executable:
Code: Select all
# cp mplayer-<version>/TOOLS/midentify.sh /usr/bin/midentify & chmod +x /usr/bin/midentify
Fonts: dhyana's author is not using Debian and the path to fonts described in his script are a little different from on a Debian system. Open dhyana.pl in a text editor and find the lines describing the font paths. In the current version that's lines 45 & 49. On each line change '/usr/share/fonts/TTF/' to '/usr/share/fonts/truetype/ttf-bitstream-vera/' (or choose another font if you prefer). Save the changes.
Now you need only put the script in your path and make it executable. My preference is to keep an original archived in ~/scripts/ and to move an edited version, as root, into /usr/local/bin/ and use chmod +x to make it executable.
You can now produce a thumbnail sheet as easily as
Code: Select all
$ dhyana.pl your_video_file
There are various options available, as described by the author:
For example to make the image above I usedUsage
dhyana.pl MovieFile.avi 8 4 ‘240×180+10+10’
The first parameter is required and is the file name for the movie file. dhyana.pl has been tested with videos in AVI, WMV and MPEG formats. MPEG videos come out looking like crap, but AVI and WMV look much better.
The second and third parameters are the numbers of rows and columns in the output file. These parameters are optional and default to 6 rows and 4 columns = 24 thumbnails.
The fourth parameter is a geometry setting to be passed to ImageMagick. This is also optional. It takes the form of WxH+L+T where:
* W is the thumbnail width
* H is the thumbnail height
* L is the left and right padding
* T is the top and bottom padding
Thumbnails will be resized keeping their aspect ratio, so images don’t look squished. Normally with ImageMagick you can precede the width with an exclamation mark to force the image to be resized to exactly the sepcified dimensions. I’ve not tried this with dhyana.pl, but it should work. The default geometry is ‘240×180+10+10’.
Code: Select all
$ dhyana.pl Video/Salaam_Bombay.mkv 10 4