Welcome to Monopedilos
Saturday, May 18 2013 @ 10:47 AM CDT
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.