Kodi Community Forum

Full Version: HOW-TO create video-preview thumbnails on a PC for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This is a way of getting a thumbnail for videos that show a screenshot from the vid. I find it useful for folders of TV shows, where I forget which ep I'm up to if I just leave it as the name foo-s01-e01.avi Smile

You need ffmpeg on your PC, preferably in your path - put the exe in windows\system32 or add its location to your path.

Then open a command prompt, go to the folder containing your vids and do

Code:
for %i in (*.avi) do ffmpeg -i %i -f mjpeg -t 0.001 -ss 5 -y %~ni.tbn

That goes through all the avi files in the folder and creates a jpeg (actually with a .tbn extension for XBMC) of the frame 5 seconds in, with the same name as the avi. Then set that folder in XBMC to show in thumbs view and you're away!. Alter the number after '-ss' to change how far in you want the grab taken. Change *.avi to be whatever the extension of your vids is.

Not rocket science, but I found it useful and thought I'd share.
Thanks, so simple, so cool.
Nice idea. Here are my embellishments.

You need quotes to deal with filenames with spaces:
Code:
for %i in (*.avi) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 5 -y "%~ni.tbn"

And here is one for recursively doing directories:
Code:
for /r %i in (*.avi) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 5 -y "%~di%~pi%~ni.tbn"
Has anyone or does anyone know how to do this in linux?
"unable to find a suitable output format for 'videoname.tbn'"

i keep getting this error

any ideas?
Kugai - good stuff, I was just looking around for how to do spaces :-)

gzusrawx - Not off the top of my head. Some kind of find -exec with a bit of awk goodness to do the filename would be my guess.

Bazzio - are you using a current version of ffmpeg? Try changing '.tbn' for 'jpg' or try -singlejpeg instead of -mjpeg
Just wanted to say thanks to you guys for sharing your ideas and tricks. Wink
I just created a page in the online-manual for creating the preview-thumbnails.
http://www.xboxmediacenter.com/wiki/inde...thumbnails

Please have a look at that page and tell me if i have included any mistakes/typos.. Big Grin
no i dont think i do have the latest.
is is mplayer i need?
I cant seem to find just ffmpeg to put in windows/system32

if you could give me some links or explain this that would be great!
Thanks
ok i got the latest version sorted, but now i have a new error

"swScaler: 0x0 ( is not supported as output format
Cannot get resampling context"
sCAPe - I'm honoured :-) Looks good to me.

Bazzio - I don't know what that error is. Maybe your version is too recent (http://lists.mplayerhq.hu/pipermail/ffmp...13856.html) - what damn fool told you to use the latest version? ;-) The one I'm using is SVN-r5570, you can try mine if you like (http://homepages.nildram.co.uk/~pravda/foo/ffmpeg.exe).
Have you tried it with a few different types of file?
what verison do you have?
aparently pthreadGC2.dll is missing, so i cant use your version
grrrr
ok
finally got it working

Rather than 5 seconds, i wanted to do it with about a min in. Sometimes expecially on movies there is only an intro around 5 secs, so it doesnt make a very good thumbnail.

however this takes a lot more time to process.

Is there a way you can tell it to ignore the file if a tbn is present, this way updates will be a lot quicker
If there is interest I can probably throw together a perl script or something like that to make this a little easier. I'll try to get something up in the next few days.
that would be awesome
Pages: 1 2