Need thumbnails for MPG files? (1 Viewer)

Bleazle

Portal Pro
July 14, 2007
1,122
257
Pukekohe
Home Country
New Zealand New Zealand
Hi All

If you've got any "home videos" recorded in MPG format from your average digital camera you're probably wishing you could have a thumbnail preview in MediaPortal - well now you can :) I've been looking for a way to do this for ages and I finally came across the answer last night :) :) Note: I have only tested this on my XP MCE HTPC.

1. You need to have FFmpeg installed in order to create the thumbnails. The easiest thing to do is to unzip and paste the attached ffmpeg.exe into your \windows\system32 directory

2. Open a command-prompt window & navigate to the folder where your videos are located. If you don't know how to do this (I didn't!) this guide will tell you what to do: Beginners Guides: WindowsXP Command Prompt - PCSTATS.com

3. Then type the following (everything in blue) Make sure you get it right!:
for %i in (*.mpg) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 3 -y "%~ni.tbn"

4. Click "enter".

That's it. This will go through all of the mpg files in the folder and create a jpeg-file (with a .tbn extension) of the frame 3 seconds in, with the same name as the mpg file. Because the files are created by FFmpeg you get a pretty decent quality thumb (well it's as good as your original clip was anyway).

If you want to create preview-thumbnails of the current folder and all of its subfolders, use the following command:
for /r %i in (*.mpg) do ffmpeg -i "%i" -f mjpeg -t 0.001 -ss 3 -y "%~di%~pi%~ni.tbn"
(NOTE: I haven't tried the method listed in #3 - this is the method I used, even when I was testing/creating thumbs for a directory that didn't have any subfolders.)

You can change the number after -ss from 3 to whatever you want to change how far (in seconds) from the beginning you want the preview-screenshot to be taken.

Obviously this could be improved upon by someone that knows about this sort of stuff. If nothing else it would be handy to have a batch file which could be run whenever new files are added files to the "Videos" folder to create thumbs for the new clip(s). I had a go at doing that but I don't know what I'm doing ( :oops: ). Also it would be good if say the first image could be copied and renamed "folder.jpg". I'm sure if I spent a bit of time trying to work out how to do this I'd get it done but I'm also sure that there's someone out there that already knows how to do this stuff - if that's you don't forget to share it with the rest of us!!...

Hopefully this helps someone else out.

Bleazle

PS. I didn't work out how to do this - I came across it after doing a lot of searching online so don't ask me any technical questions because I won't know the answers!!!! :D

EDIT: I forgot to say that this should work for any file type supported by FFmpeg. So if you want to use it for AVI files for example simply replace mpg with avi. You would be better off using the thumbnailer plugin created by Mophat though: https://forum.team-mediaportal.com/plugins-47/thumbnailer-creates-automaticly-thumbnails-videos-tv-recordings-41250/
 

Attachments

  • ffmpeg.zip
    30.6 KB

Users who are viewing this thread

Top Bottom