Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
HOW-TO create video-preview thumbnails on a PC for XBMC
#1
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.
Reply
#2
Thanks, so simple, so cool.
Reply
#3
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"
Reply
#4
Has anyone or does anyone know how to do this in linux?
Reply
#5
"unable to find a suitable output format for 'videoname.tbn'"

i keep getting this error

any ideas?
Reply
#6
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
Reply
#7
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
My XBOX built into a Sony Hifi CD-Player Case
XBOX Hifi Media Center Picture Gallery

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
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
Reply
#9
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"
Reply
#10
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?
Reply
#11
what verison do you have?
Reply
#12
aparently pthreadGC2.dll is missing, so i cant use your version
grrrr
Reply
#13
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
Reply
#14
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.
Reply
#15
that would be awesome
Reply

Logout Mark Read Team Forum Stats Members Help
HOW-TO create video-preview thumbnails on a PC for XBMC0