HOW-TO create video preview thumbnails automatically

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Calmiche Offline
Junior Member
Posts: 42
Joined: Jan 2007
Reputation: 0
Post: #1
Okay, I just found out about one of these and the other one I wrote. If you have seen them before, then don't complain. They are new to me.

---------------------------------------
Creating XBMC Thumbnails Automatically
---------------------------------------

I wanted to have thumbnails for all my television episodes. (All my episodes are on my windows PC, sheared over my network.) Instead of downloading each file individually, I found a tip on the XBMC wiki page.

http://www.xboxmediacenter.com/wiki/inde...thumbnails

1. Download this file:
http://ffdshow.faireal.net/mirror/ffmpeg...ev10908.7z

2. Extract that file (Including the DLL) into your \\Windows\System32 folder.

3. Open up a command prompt window in the root folder of your television shows and then type this command

for /r %i in (*.avi) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 5 -y "%~di%~pi%~ni.tbn"

You can replace the (*.avi) with different file formats, including mp4, divx, rmvb, ogm and rm.

This will open up your episodes, skip 5 seconds in, take a screen shot, rename it to *.tbn and then go to the next file. It will also do any sub folder.

---------------------------------------
Seeing *.tbn files in Windows Explorer
---------------------------------------

I bet that you know that you can go into a folder in Windows XP, switch to Thumbnail view, and be presented with an icon of the first screen from a movie. It works for images as well. Unfortunately, it doesn't work for *.tbn files. Until now, that is.

1. Create a new text document.

2. Paste the following block of text into it.

REGEDIT4

[HKEY_CLASSES_ROOT\.tbn\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{3F30C968-480A-4C6C-862D-EFC0897BB84B}"

3. Rename the file so that the extension is .reg (I named mine "tbn thumbnails.reg")

4. Double-click the file and you are all set. Windows XP will now see TBN thumbnails as images and create a windows thumbnail for them. You can see them in your folders on your computer.
find quote
jaredharley Offline
Senior Member
Posts: 230
Joined: Jan 2007
Reputation: 0
Post: #2
Well done! I'm going to have to try this out, it looks awesome!

Also, thanks for the .tbn preview in Windows.
find quote
jaredharley Offline
Senior Member
Posts: 230
Joined: Jan 2007
Reputation: 0
Post: #3
jaredharley Wrote:Well done! I'm going to have to try this out, it looks awesome!

Also, thanks for the .tbn preview in Windows.

Both are awesome! Thanks!
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #4
Remember to share your thumbnails with others by uploading them to http://www.thetvdb.com

TheTVDB is the database and scraper that XBMC uses and it is wiki based.

By the users, for the users Wink

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.
find quote
sickboy719 Offline
Senior Member
Posts: 113
Joined: May 2007
Reputation: 0
Post: #5
Very nice, thank you.
I've been using Frameshots to make my thumbs, I'll give yours a go and see how it works.
find quote
HarshReality Offline
Posting Freak
Posts: 1,544
Joined: Jan 2005
Reputation: 0
Post: #6
Wasnt this in the wiki? Well I know I saw it but I guess its been removed.

[Image: x3.jpg]
find quote
jaredharley Offline
Senior Member
Posts: 230
Joined: Jan 2007
Reputation: 0
Post: #7
Quote:Wasnt this in the wiki? Well I know I saw it but I guess its been removed.

No, it's still there, Calmiche linked to it in his post. I've been all over the wiki and had never come across this tip.

Calmiche Wrote:Instead of downloading each file individually, I found a tip on the XBMC wiki page.

http://www.xboxmediacenter.com/wiki/inde...thumbnails
find quote
HarshReality Offline
Posting Freak
Posts: 1,544
Joined: Jan 2005
Reputation: 0
Post: #8
I tried it for a time and worked great... 6 seasons of smallville etc. but after a time just got to be bothersom.

[Image: x3.jpg]
find quote
jaredharley Offline
Senior Member
Posts: 230
Joined: Jan 2007
Reputation: 0
Post: #9
HarshReality Wrote:I tried it for a time and worked great... 6 seasons of smallville etc. but after a time just got to be bothersom.

The command Calmiche uses
Code:
for /r %i in (*.avi) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 5 -y "%~di%~pi%~ni.tbn"
does a recursive scan on folders. If you've got a directory called "TV Shows", you could simply navigate to that folder in a cmd window, and then run the command. It will look in all folders and sub-folders for video files matching the parameters (in this case, .avi files).

I can see how it would get irritating to do this with each new episode you download (or create, however you get them). Now that I've done the initial work, I plan on only doing it when a season is complete.
find quote
cayotic Offline
Member
Posts: 93
Joined: May 2004
Reputation: 0
Location: WA
Post: #10
I saw the first tutorial before but I couldn't exicute it for whatever reason so I went with frameshots. I'll try it again, as far as the tbn viewer is concerned, I don't think it works in vista, can someone else confirm. I'll try it on my main XP server where I'm sure it will work...

Thanks,

"Sometimes, the best example is a bad example."
find quote
jaredharley Offline
Senior Member
Posts: 230
Joined: Jan 2007
Reputation: 0
Post: #11
cayotic Wrote:I saw the first tutorial before but I couldn't exicute it for whatever reason so I went with frameshots. I'll try it again, as far as the tbn viewer is concerned, I don't think it works in vista, can someone else confirm. I'll try it on my main XP server where I'm sure it will work...

Thanks,

Vista's registry is just a little bit different. Place the below code into a normal text file, and save as a .reg file (should have the little blue cube of blocks icon).
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.tbn\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}]
@="{3F30C968-480A-4C6C-862D-EFC0897BB84B}"
This does work on Vista.

As for the screenshot creator - you have to have all 3 of the linked files in the c:\windows\system32 folder. Then, in a cmd window, navigate to the folder with your tv shows (ie, type in: cd d:\tv shows) and then you can use the command he mentioned. If you copied it off of the post, you can right-click and choose "paste" to paste the text into the cmd window (you can't use ctrl+v).
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #12
Feel free to update the WIKI article if needed http://xboxmediacenter.com/wiki/index.ph...thumbnails Wink

Quote:All users who wish to continue providing a valid contribution to the XBox Media Center online manual, please contact one of the XBMC team members and ask for Ninja status on the wiki.
http://xboxmediacenter.com/wiki/index.ph...=Main_Page

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.
find quote
jaredharley Offline
Senior Member
Posts: 230
Joined: Jan 2007
Reputation: 0
Post: #13
Gamester17 Wrote:Feel free to update the WIKI article if needed http://xboxmediacenter.com/wiki/index.ph...thumbnails Wink

http://xboxmediacenter.com/wiki/index.ph...=Main_Page

I'd need ninja status for that.... pretty please?
find quote
DrDDT Offline
Senior Member
Posts: 186
Joined: Apr 2006
Reputation: 0
Post: #14
I added an 'if exist' to the batch file so it can run scheduled for automatic run every day.

Does anybody know how to nest the for loop so I can check several root folders in one line?

I now use:

Code:
@echo off

setlocal
set FFMPEG=f:\tools\ffmpeg\ffmpeg.exe
set THUMB="%%~di%%~pi%%~ni.tbn"
set MAKETHUMB=%FFMPEG% -i "%%i" -f mjpeg -t 0.001 -ss 5 -y %THUMB%

set FILES="*.avi"
set DIRS=m:\media\series i:\media\series

for /r  m:\media\series %%i in ( %FILES% ) do if not exist %THUMB% %MAKETHUMB%
for /r  i:\media\series %%i in ( %FILES% ) do if not exist %THUMB% %MAKETHUMB%
endlocal

I'd like to merge the two for loops and make use of the DIRS variable.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Post: #15
FYI; this was added to the Linux port branch of XBMC late yesterday:
Quote:extract frame from video files without thumb. experimental.
Let's hope this feature gets ported back to the Xbox trunk as well Wink

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.
find quote
Post Reply