Sign Up!
Login

Welcome to Monopedilos
Saturday, May 18 2013 @ 10:47 AM CDT

 

thumbnailer.sh

The following script will process all movie files (.wmv, .avi, .mkv, .ogm, .mpg) in the directory. It will create a jpeg still image at the 5-second mark and save it in the same directory as the movie with the same filename as the movie, except it will have a .tbn extension. This is the format used by XBMC to insert thumbnails in the video library.

#!/bin/bash          
ls *.wmv *.avi *.mkv *.ogm *.mpg | while read file; do
	ffmpeg -itsoffset -5 -i $file -vcodec mjpeg -vframes 1 -an -f rawvideo ${file:0:${#file}-3}tbn </dev/null
done

The script is pretty simple. You can add mime types to line 1 but it has to be one with a three-character extension for the script to work properly.

 
Logged in as: Guest (Guest)
thumbnailer.txt · Last modified: 2009/02/11 17:31 by theophile
 
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2