2011-02-27, 10:46
Ok - another revision of the script, setting the time when the tbns are created to 2 mins into the movie, and checking if the tbn already exists, so that only new tbns are created.
If the movie has been stored in XBMC before, the new tbns are only used by XBMC, if the information for all episodes is updated in XBMC.
Code:
#!/bin/bash
ls *.wmv *.avi *.mkv *.ogm *.mpg | while read file; do
if [ ! -f "${file:0:${#file}-3}tbn" ]; then
ffmpeg -itsoffset -120 -i "$file" -vcodec mjpeg -vframes 1 -an -f rawvideo "${file:0:${#file}-3}tbn" </dev/null
fi
chmod og+w *
done
If the movie has been stored in XBMC before, the new tbns are only used by XBMC, if the information for all episodes is updated in XBMC.