HOW-TO create video-preview thumbnails on a PC for XBMC

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
hoki_goujons Offline
Junior Member
Posts: 15
Joined: Aug 2006
Reputation: 0
Post: #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.
find quote
jgawera Offline
Senior Member
Posts: 221
Joined: Oct 2004
Reputation: 0
Location: UK
Post: #2
Thanks, so simple, so cool.
find quote
kugai Offline
Junior Member
Posts: 7
Joined: Sep 2006
Reputation: 0
Post: #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"
find quote
gzusrawx Offline
Fan
Posts: 383
Joined: Aug 2006
Reputation: 0
Location: Massachusetts
Post: #4
Has anyone or does anyone know how to do this in linux?
find quote
Bazzio Offline
Junior Member
Posts: 29
Joined: Jan 2006
Reputation: 0
Post: #5
"unable to find a suitable output format for 'videoname.tbn'"

i keep getting this error

any ideas?
find quote
hoki_goujons Offline
Junior Member
Posts: 15
Joined: Aug 2006
Reputation: 0
Post: #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
find quote
sCAPe Offline
Fan
Posts: 441
Joined: Mar 2005
Reputation: 0
Location: Germany
Post: #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: badge.gif]
find quote
Bazzio Offline
Junior Member
Posts: 29
Joined: Jan 2006
Reputation: 0
Post: #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
find quote
Bazzio Offline
Junior Member
Posts: 29
Joined: Jan 2006
Reputation: 0
Post: #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"
(This post was last modified: 2006-09-30 16:44 by Bazzio.)
find quote
hoki_goujons Offline
Junior Member
Posts: 15
Joined: Aug 2006
Reputation: 0
Post: #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?
find quote
Post Reply