Auto-generated thumbs are gray for MPEG2 files
#1
All of my recorded TV (from SageTV) is saved as MPEG2 .mpg files. They play back perfectly in XBMC.
XBMC, however is having trouble generating automatic thumbnails for the files. The thubmnails are just gray. See screenshot below.
Here is a short sample video that generated a gray thumb for me. I'm hoping that someone else can confirm/deny if XBMC will produce a valid thumb for them.
As far as I can tell, the video is not corrupt. Windows is able to generate a thumb in Windows Explorer.
I'm using XBMC 10.0 on Windows7.
Image
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#2
I've noticed a similar thing in 10.0 even on files that previously had a thumbnail.
Reply
#3
Is this a known problem? Is it being worked on?
The closest thing I could find in Trac is http://trac.xbmc.org/ticket/8889
That ticker looks similar, but the example image is not quite the same as mine are. It's grey with artifacts.


Anyway, just wondering if I should create a ticket or what...
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#4
you could allways create your own thumbs, i have just tried your sample file on
"video Thumbnails Maker by scorp" and they show as normal for me
XBMC Frodo 12 - Windows 7 - Asrock Ion 330HT - Aeon Nox
Reply
#5
paul Wrote:you could allways create your own thumbs, i have just tried your sample file on
"video Thumbnails Maker by scorp" and they show as normal for me
I guess I could create my own thumbs until this is resolved. It's just a pain, especially since XBMC has this functionality built in. It's just not working correctly for some reason...

Do you know of any free thumbnail generators that I can use from the command line?
I tried imagegrabber but it failed on my video http://www.videohelp.com/tools/ImageGrabber
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#6
Probably that frame is too close to the beginning (under 1 sec?) and/or the player doesn't know how to compensate & seek the next I-frame. If the 'extraction' falls on a P or B-frame, that can't be decoded without a reference frame and then garbage is displayed.
Reply
#7
Daydream Wrote:Probably that frame is too close to the beginning (under 1 sec?) and/or the player doesn't know how to compensate & seek the next I-frame. If the 'extraction' falls on a P or B-frame, that can't be decoded without a reference frame and then garbage is displayed.

This happens on about 90% of my recorded TV files, so it's not just a once in a while thing.
Is this something that XBMC will/should look to fix, or should i look into extracting the thumbs with a 3rd part application?
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#8
It depends what MPEG-2 files you have there (I'm not that familiar with Sage). If the recorded files are (actually) .ts files the problem may be exacerbated, since .ts files have a lot of broadcast garbage that may mess up demuxers/decoders. That is why I always transform my ts files into 'true' mpeg files (by remuxing, stripping crazy PIDs and whatnot). But, then again, this may not be your case, depending what Sage does for you.

Second thing is that, as far as I know (but I'm not an expert) the playback engine inside XBMC is based on ffmpeg (unless you're using a build based on DSPlayer, etc). The problem you see happens with a lot of implementation of ffmpeg, so I'd say it's a problem with ffmpeg. However problem is not the right word because ffmpeg does what you tell it to do. I don't know what further tweaks team XBMC might've done to it, if any, but the theory is that you tell ffmpeg "seek that many seconds inside the file and capture the frame". If that frame is good - good, if it's one that actually needs another frame in order to be decoded, than you have to have some code in place to deal with the exception, seek and jump to the next I-frame (which will affect accuracy if that is important), seek around an I- frame and return and decode the frame you wanted (I don't know if that is possible) and so on.

I could never find a tool that would capture frames the way I want it. So I asked a friend to make a GUI for ffmpeg so I could capture a series of frames (say, 10 frames from every file, at x hours/min/sec intervals). I deal with music clips so that's a lot of files and frames. I still get the occasional gray frames, but out of 10 frames per file there will be some good that I get to pick for each file.

If you think it might help you I can upload it in the tools section, but keep in mind it's designed for my specific needs.
Reply
#9
Daydream Wrote:If you think it might help you I can upload it in the tools section, but keep in mind it's designed for my specific needs.
I'd be interested in trying this tool out just to see what is going on. Please post if you still can.
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#10
I'm having a similar issue here: Some (not all!) of the auto-generated thumbs (for mpeg-ts) are grey. I would like to let XBMC rescan the thumbs for these files, but don't know how to do it.

The wiki says the thumbs are stored in the cache, apparently based on some CRC calc (not explained in more detail here).

I guess that I would have to delete the faulty thumbs - but I don't really know how to find the right files in the Thumbnails dir... Is there any way I could find this out? Or has XBMC some functionality automatically to rescan selected thumbs? I don't want to add tbn-files only because the first automatic scan produced some errors.

Thanks.
Reply
#11
Hammi Wrote:I guess that I would have to delete the faulty thumbs - but I don't really know how to find the right files in the

In my experience, I am able to delete the gray thumbs by searching the thumbnail dir for .tbn's whose filesize is < 3 or 4KB. All the gray thumbs are very small sizes, so that works well to find them.

As far as generating good thumbs, I've set up an automated script that uses Thumber to generate thumbnails next to my video. Then XBMC will use those by default. The thumbnails generated by that script are always good.

Also, everything you'd ever need to know about the CRC hash is right here http://wiki.xbmc.org/?title=Thumbnails#Sample_Code
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#12
I used to have this problem with H264 files in a TS container recorded from the HDPVR. That got fixed, but I think the fix broke thumbnail generation in MPEG2 files, because now those ones are grey and the TS files work just fine.

ETA: in this thread davilla mentions that elupus changed the thumbnail code for Dharma Beta 2
Reply
#13
Thanks, I checked things at home.

It turns out that the grey thumbnails are 4070 Bytes in size. I can delete them, but they get recreated in grey again. So it looks as if this is really an issue with the video files. On the other hand, I only have mpeg 2 ts containers (recorded from DVB-S2 with mythtv) - for most thumbnail creation works well...

Debug log:

Code:
20:45:16 T:2742020976 M:1352220672   DEBUG: DoWork - trying to extract thumb from video file /srv/netstore/Video/Ben s02e17.mpg
20:45:16 T:2742020976 M:1352220672   DEBUG: Open - probing detected format [mpeg]
20:45:16 T:2742020976 M:1352220672   DEBUG: Open - av_find_stream_info starting
20:45:16 T:2742020976 M:1352220672   DEBUG: ffmpeg[A36FEB70]: [mpeg] Invalid timestamps stream=0, pts=59757000, dts=746151936, size=2015
20:45:16 T:2742020976 M:1352220672   DEBUG: ffmpeg[A36FEB70]: [mpeg] Invalid timestamps stream=0, pts=59767800, dts=747231232, size=2015
20:45:16 T:2742020976 M:1352220672   ERROR: ffmpeg[A36FEB70]: [mp2] Header missing
20:45:16 T:2742020976 M:1352220672   DEBUG: ffmpeg[A36FEB70]: [mpeg] Invalid timestamps stream=0, pts=59778600, dts=750469120, size=2015
20:45:16 T:2742020976 M:1352220672   DEBUG: ffmpeg[A36FEB70]: [mpeg] Invalid timestamps stream=0, pts=59789400, dts=753707008, size=2015
20:45:16 T:2742020976 M:1352220672   DEBUG: ffmpeg[A36FEB70]: [mpeg] Invalid timestamps stream=0, pts=59800200, dts=756944896, size=2015
20:45:16 T:2742020976 M:1352298496   DEBUG: ffmpeg[A36FEB70]: [mpeg] max_analyze_duration reached
20:45:16 T:2742020976 M:1352298496   DEBUG: Open - av_find_stream_info finished
20:45:16 T:2742020976 M:1352298496    INFO: ffmpeg[A36FEB70]: Input #0, mpeg, from '/srv/netstore/Video/Ben s02e17.mpg':
20:45:16 T:2742020976 M:1352298496    INFO: ffmpeg[A36FEB70]:   Duration: 00:25:07.83, start: 663.528000, bitrate: 3343 kb/s
20:45:16 T:2742020976 M:1352298496    INFO: ffmpeg[A36FEB70]:     Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 64:45 DAR 16:9], 15000 kb/s, 25 fps, 22500 tbr, 90k tbn, 50 tbc
20:45:16 T:2742020976 M:1352298496    INFO: ffmpeg[A36FEB70]:     Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s
20:45:16 T:2742020976 M:1352298496   DEBUG: FactoryCodec - Video:  - Opening
20:45:16 T:2742020976 M:1352298496  NOTICE: CDVDVideoCodecFFmpeg::Open() Using codec: MPEG-2 video
20:45:16 T:2742020976 M:1352298496   DEBUG: FactoryCodec - Video: ff-mpeg2video - Opened
20:45:16 T:2742020976 M:1352298496   DEBUG: ExtractThumb - seeking to pos 502612ms (total: 1507838ms) in /srv/netstore/Video/Ben s02e17.mpg
20:45:16 T:2742020976 M:1352298496   DEBUG: SeekTime - seek ended up on time 502598
20:45:16 T:2742020976 M:1352298496   ERROR: ffmpeg[A36FEB70]: [mpeg2video] warning: first frame is no keyframe
20:45:16 T:2742020976 M:1352298496   DEBUG: ExtractThumb - measured 162 ms to extract thumb from file </srv/netstore/Video/Ben s02e17.mpg>
Reply
#14
this issue still remains in Eden - all thumbnails for .mts files are gray boxes.

is this still a known issue? has there been any update?

thanks...

edit: moving 2nd question to new thread.
Reply

Logout Mark Read Team Forum Stats Members Help
Auto-generated thumbs are gray for MPEG2 files0