• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7
Thumbnail Overlay Generator - makeshift HD video flagging script
#1
Image

Image

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
Reply
#2
Thanks. BUT thumbnails ftw!
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
what skin is that? - never mind I found it!

And will it work on APTV or Windows?
Reply
#4
Well the thumbnails will work on any platform XBMC works on. The script to generate the thumbnails was made for linux and may or may not work on other platforms. To try, install Python, ffmpeg, and ImageMagick on your platform of choice and then try editing the variables at the top of tog.py to reflect the locations of ffmpeg/ImageMagick. Then run as indicated.
Reply
#5
Hi midgetspy.

Is it possible to scan and create thumbnails for smb sources? Im using hardy and get this error when trying to scan

Quote:stevie@stevie-linux:~/Desktop/tog$ python tog.py -convert smb://tower/videos/HI-DEF/*.mkv
Doing overlays for smb://tower/videos/HI-DEF/*.mkv
ERROR: unable to scan smb://tower/videos/HI-DEF/*.mkv with ffmpeg
Successfully created overlays on 0 thumbnails (1 failures)

Any ideas?

cheers.
HTPC 1 : Acer revo R3700 ion2 HTPC 2 :Apple TV2 HTPC 3 : Apple TV2 HTPC4 Acer revo R3700 ion2 Remote : x2 Riimote2
SERVER : 10TB Ubuntu Server 10.04, dual wintv nova hd s2 cards, tvheadend, Newcs, Omnikey reader, White *Sky uk* Card, Mysql Db, Sabnzbdplus, SickBeard, Couchpotato, FlexRaid. :cool:
--------------------------------------------
Image
Reply
#6
harryzimm Wrote:Hi midgetspy.

Is it possible to scan and create thumbnails for smb sources? Im using hardy and get this error when trying to scan



Any ideas?

cheers.

You'll have to mount the share first. Try this:

sudo mkdir /mnt/smbshare
sudo mount -t smbfs //tower/videos/ /mnt/smbshare

If that doesn't work just google how to mount a samba share on your distribution of linux, and once it's mounted run it on the mounted directory.

EDIT: I posted a new version with some minor changes. I'd neglected to bother since I didn't think anybody was using it ;-P
Reply
#7
Thanks.

I mounted the smb share but i get this error now instead.

Quote:stevie@stevie-linux:~/Desktop/tog$ python tog.py -convert /mnt/smbshare/HI-DEF/2.Fast.2.Furious.2003.1080p/*.mkv
Doing overlays for /mnt/smbshare/HI-DEF/2.Fast.2.Furious.2003.1080p/2.Fast.2.Furious.2003.mkv
Traceback (most recent call last):
File "tog.py", line 247, in <module>
scanAllFiles(sys.argv[2:])
File "tog.py", line 226, in scanAllFiles
if doFile(file) == SUCCESS:
File "tog.py", line 78, in doFile
identifyProc = subprocess.Popen(identifyProcCmd, stdout=subprocess.PIPE)
File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
errread, errwrite)
File "/usr/lib/python2.5/subprocess.py", line 1147, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
stevie@stevie-linux:~/Desktop/tog$

Im not sure if i have the dependencies installed correctly.It creates a new tbn file and renames the old one but the new tbn is the same as the old one. Any help would be appreciated.

cheers
HTPC 1 : Acer revo R3700 ion2 HTPC 2 :Apple TV2 HTPC 3 : Apple TV2 HTPC4 Acer revo R3700 ion2 Remote : x2 Riimote2
SERVER : 10TB Ubuntu Server 10.04, dual wintv nova hd s2 cards, tvheadend, Newcs, Omnikey reader, White *Sky uk* Card, Mysql Db, Sabnzbdplus, SickBeard, Couchpotato, FlexRaid. :cool:
--------------------------------------------
Image
Reply
#8
Looks like your ImageMagick isn't installed correctly (or you don't have the paths right). I will add a check for ffmpeg and ImageMagick for the next version so it will tell you if you're missing it rather than dieing a horrible death, hehe.

To check for ImageMagick, try typing "whereis identify" (no quotes) in your console. If that isn't found, ImageMagick isn't installed in your path. If it is, make sure you set IMAGEMAGICK_PATH to be whatever whereis told you.
Reply
#9
Thanks.

Nice one midgetspy, that solved it. Just directed IMAGEMAGICK_PATH to /usr/bin and all is good.Big Grin

Thanks for sharing mate, this is really an excellent solution for video flagging.

cheers.
HTPC 1 : Acer revo R3700 ion2 HTPC 2 :Apple TV2 HTPC 3 : Apple TV2 HTPC4 Acer revo R3700 ion2 Remote : x2 Riimote2
SERVER : 10TB Ubuntu Server 10.04, dual wintv nova hd s2 cards, tvheadend, Newcs, Omnikey reader, White *Sky uk* Card, Mysql Db, Sabnzbdplus, SickBeard, Couchpotato, FlexRaid. :cool:
--------------------------------------------
Image
Reply
#10
Glad you got it working. BTW I noticed it looks like you have your movies each in a separate folder... since the script won't recursively scan your directory (and I have no plans to make it do such) you can try this to save you having to manually do every movie:

Code:
python tog.py -convert `find /mnt/smbshare/HI-DEF -name *.mkv -printf %p\ `

(note that there is a space after %p\)
Reply
#11
midgetspy Wrote:Glad you got it working. BTW I noticed it looks like you have your movies each in a separate folder... since the script won't recursively scan your directory (and I have no plans to make it do such) you can try this to save you having to manually do every movie:

Code:
python tog.py -convert `find /mnt/smbshare/HI-DEF -name *.mkv -printf %p\ `

(note that there is a space after %p\)

Excellent as that was going to be my next questionBig Grin. Thanks again.
HTPC 1 : Acer revo R3700 ion2 HTPC 2 :Apple TV2 HTPC 3 : Apple TV2 HTPC4 Acer revo R3700 ion2 Remote : x2 Riimote2
SERVER : 10TB Ubuntu Server 10.04, dual wintv nova hd s2 cards, tvheadend, Newcs, Omnikey reader, White *Sky uk* Card, Mysql Db, Sabnzbdplus, SickBeard, Couchpotato, FlexRaid. :cool:
--------------------------------------------
Image
Reply
#12
what skin IS that? looks great....hopefully someone will be able to get this working on windows.
Reply
#13
Evanrich Wrote:what skin IS that? looks great....hopefully someone will be able to get this working on windows.

It's Horizonz.

And why don't you be the one to try it on Windows? :0)
Reply
#14
Ill try it when I get home tonight Smile
Reply
#15
cant seem to get it to run...I've installed everything, but when i run the command line, i get "cannot find ffmpeg."

I've set my directories as "d:\ffmpg", "d:/ffmpg" and even tried copying the files into the tog directory...no luck. I've declared the path to ffmpg in my environmental variables as well, still no luck...keeps saying it can't find it.
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 7

Logout Mark Read Team Forum Stats Members Help
Thumbnail Overlay Generator - makeshift HD video flagging script0