2008-10-23, 08:41
Download: v0.4.1 http://nic.wolfeden.ca/tog/tog-0.4.1.zip
README 0.4.1
What is this script?
####################
I've long wanted a way to tell if my movies were HD/SD without playing them and checking the codec info (or on xbox, playing them and seeing if it choked or not). This script allows you to do that by placing an overlay on your thumbnails so you can tell the resolution (SD/720p/1080p) and audio quality (stereo/5.1/7.1) of your movies by just seeing it in the library.
Why'd you make it?
##################
Well I posted a feature request for this feature (http://forum.xbmc.org/showthread.php?tid=30419) but no developer seemed interested at the time, and currently there's a feature freeze so it might be a long time before somebody can implement it (if ever). I didn't feel up to the task of implementing it in XBMC so I made this simple script instead as a "for now" solution.
I made this script for my own use, though. The code is ugly and the script isn't very user friendly. I made this README file in an attempt to help others use the script if they want, but it was never intended to be a foolproof tool for all XBMC users to use. I'll answer questions on the XBMC forums but it's ultimately up to you to get this to work if you want to use it.
How do I use it?
################
You will need the following:
Python: http://www.python.org/
ffmpeg: http://tripp.arrozcru.org/ or compile from source
ImageMagick: http://www.imagemagick.org/script/index.php
This script was developed on Ubuntu linux. To run it on another linux distribution you might need to change the paths in tog/config.py. The script will work on Windows and OSX if you set the paths accordingly - check the forums for help.
Once you have the dependencies installed, start the script by python tog.py [options]. Options are described below:
Syntax: python tog.py <-scan|-revert> [file list]
python tog.py -force <1080p|720p|SD> <7.1|5.1|stereo|mono> <filename>
manual: Applies the specified video/audio images to the thumbnail of the specified movie. Doesn't scan the movie at all (can be used on .iso or other videos which can't be scanned with ffmpeg)
scan: Uses ffmpeg to scan the specified files and directories. If a filename is specified, the script will attempt to scan that filename with ffmpeg regardless of its extension.
If a directory is specified, the script will automatically scan all mkv and avi files in that directory. Files with extensions other than mkv and avi will not be scanned by simply scanning their directory, they must be specified by name.
revert: Replaces the thumb with the original thumb and deletes the backup to restore the old state. Behaves similarly to scan.
Examples:
python tog.py -scan /Movies/
python tog.py -force SD 5.1 /Movies/Moviename.iso
python tog.py -revert /Movies/*.avi
I use XBMC Media Companion to manage my library, get it at http://www.billyad2000.co.uk/. My tool assumes your library is set up the way XBMC Media Companion sets it up:
- you should have a .tbn file for every movie, stored in the same directory as the movie, named Moviename.tbn
- stacked files must have a .tbn for the first file in the stack (Moviename.cd1.tbn for example)
The script will back up your old thumbnail to Moviename.tbn-orig so you don't lose it. If you want to go back to your original thumbnail with no overlays use the -revert option.
Once you've converted all your thumbnails to the overlay version you'll need to delete your XBMC cache by deleting the UserData\Cache\Thumbnails\Video folder. When you restart XBMC and load your library it will re-generate all your thumbs (TV too) and use the overlay versions. Alternately if you only need to update a few thumbs you can just manually change the thumb from cached to local in the "Get Thumb" dialog.
Can I customize it?
###################
Without editing the Python code there's not much you can do. I made this for myself so it works how I wanted it to, I didn't make a bunch of options for it to do stuff I don't need. One thing you can change, though, is the images it uses for the overlays. They are:
images/
SD.png
720p.png
1080p.png
mono.png
stereo.png
5.1.png
7.1.png
All the images need to be the same size, and if you change their sizes from the default be sure to update the OVERLAY_HEIGHT and OVERLAY_WIDTH variables in tog/config.py. You can also change the size of the overlays by updating OVERLAY_HEIGHT.
Known limitations:
##################
- only files that can be opened by ffmpeg can be auto-scanned (iso/rar/etc must be forced)
- the script shows an error for every part of a stacked file except the first part (since there's no thumbnail for the other parts)
CHANGELOG for 0.4.1
#####################
0.4.1
##########################################
- fixed a bug where all movies would be labeled 5.1 regardless of the actual number of channels
0.4.0
##########################################
- changed the script to include a package named "tog". You can now update the script without overwriting your config (config should now be done in tog/config.py)
- made many updates to support different variations of the ffmpeg output
- renamed a bunch of config variables to be more clear
- included a copy of the GPL