HOW-TO create video preview thumbnails automatically

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Hammi Offline
Senior Member
Posts: 164
Joined: Dec 2009
Reputation: 0
Post: #46
Ok - another revision of the script, setting the time when the tbns are created to 2 mins into the movie, and checking if the tbn already exists, so that only new tbns are created.

Code:
#!/bin/bash
ls *.wmv *.avi *.mkv *.ogm *.mpg | while read file; do
if [ ! -f  "${file:0:${#file}-3}tbn" ]; then
   ffmpeg -itsoffset -120 -i "$file" -vcodec mjpeg -vframes 1 -an -f rawvideo "${file:0:${#file}-3}tbn" </dev/null
fi
chmod og+w *
done

If the movie has been stored in XBMC before, the new tbns are only used by XBMC, if the information for all episodes is updated in XBMC.
find quote
sourbob Offline
Member
Posts: 69
Joined: Jun 2011
Reputation: 0
Post: #47
joebrady Wrote:Yea, that's on my agenda for tonight. Too bad tvdb doesn't have a section for "Chilly Willy" cartoons tho....

It does now. Added it myself. Now if we can get someone to make some banners...
find quote
feerlessleadr Offline
Fan
Posts: 329
Joined: Oct 2007
Reputation: 1
Post: #48
Hate resurrecting an old thread, but I am trying to use the following batch file to create my thumbnails on my windows system, and I am getting empty tbn images with mkv files and tbn images that are hundreds of mb with avi files:

Code:
setlocal
set FFMPEG=C:\Users\Kevin\Stuff\ffmpeg\ffmpeg.exe
set THUMB="%%~di%%~pi%%~ni.tbn"
set MAKETHUMB=%FFMPEG% -i "%%i" -f mjpeg -t 0.001 -ss 10 -y %THUMB%

set FILES="*.mkv" "*.avi"

for /r %1 %%i in ( %FILES% ) do if not exist %THUMB% %MAKETHUMB%
endlocal

I am passing "F:\Test" as the %1 parameter in the above file

I have even tried just using the following and I am still get empty tbn files for mkv an huge tbn files for avi:

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

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

Any ideas?

::EDIT:: Well I just upgraded to the latest static build of ffmpeg for windows and my avi problem is fixed, but the mkv tbn is still coming up as zero.
(This post was last modified: 2011-07-28 22:21 by feerlessleadr.)
find quote
Manta99 Offline
Junior Member
Posts: 8
Joined: Jun 2009
Reputation: 0
Post: #49
Code:
set MAKETHUMB=%FFMPEG% -i "%%i" -f mjpeg -vframes 1 -ss 10 -y %THUMB%

I think this will work. Thanks for the windows port btw! I'm running the script every time my HTPC wakes op from sleep to fill in missing thumbnails.
find quote
krasymir Offline
Junior Member
Posts: 1
Joined: Apr 2012
Reputation: 0
Post: #50
Nod
(2007-11-15 07:40)Calmiche Wrote:  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.
<? php
exec ('for / r C :/ xampp / htdocs / public / uploads /% i in (*. flv, *. avi, *. mp4) do ffmpeg-i "% i"-f mjpeg-t 0.050-ss 20 -y "% ~ di% ~ pi% ~ ni.jpg" ')
?>
This record Thumbnail in C :/ xampp / htdocs / public / uploads /
Thumbnail How to write in C :/ xampp / htdocs / public / uploads / thumb /
sorry for bad English.
find quote
Post Reply