GNOME Bugzilla – Bug 132341
[avidemux] 'DIB ' => image upside-down
Last modified: 2005-01-29 15:47:18 UTC
The attached avi does not play with GStreamer (and not with Xine either, but mplayer plays it just fine)
Created attachment 23689 [details] Avi file that we fail to play
What codec does mplayer use? Fourcc is 'DIB ', which is unknown to me.
Here is the mplayer output, hope it tells you something :) Playing g10.avi. AVI file format detected. VIDEO: [] 120x120 8bpp 15.000 fps 1728.0 kbps (210.9 kbyte/s) ========================================================================== Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO: 22050 Hz, 1 ch, 16 bit (0x10), ratio: 44100->44100 (352.8 kbit) Selected audio codec: [pcm] afm:pcm (Uncompressed PCM) ========================================================================== vo: X11 running at 1024x768 with depth 24 and 32 bpp (":0.0" => local display) ========================================================================== Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 120 x 120 (preferred csp: BGR 8-bit) Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] Opening video filter: [palette] VDec: using BGR 8-bit as output csp (no 0) Opening video filter: [flip] Movie-Aspect is undefined - no prescaling applied. SwScaler: reducing / aligning filtersize 1 -> 4 SwScaler: reducing / aligning filtersize 1 -> 4 SwScaler: reducing / aligning filtersize 1 -> 1 SwScaler: reducing / aligning filtersize 9 -> 8 SwScaler: BICUBIC scaler, from BGR 32-bit to Planar YV12 using MMX2 VO: [xv] 120x120 => 120x120 Planar YV12 Selected video codec: [rawbgr8flip] vfm:raw (RAW BGR8) ========================================================================== Checking audio filter chain for 22050Hz/1ch/16bit -> 22050Hz/2ch/16bit... AF_pre: af format: 2 bps, 1 ch, 22050 hz, little endian signed int AF_pre: 22050Hz 1ch Signed 16-bit (Little-Endian) AO: [oss] 22050Hz 2ch Signed 16-bit (Little-Endian) (2 bps) Building audio filter chain for 22050Hz/1ch/16bit -> 22050Hz/2ch/16bit... Starting playback... A: 5.9 V: 5.9 A-V: 0.010 ct: 0.008 90/ 90 0% 3% 0.2% 0 0
8-bit BGR (LE RGB) apparently? I'll have a look, we don't handle this indeeed.
Ronald suggested getting this added to ffmpeg colorspace instead of us fixing it 'inhouse'
Well, the thing is that we need a way of converting from 8bpp RGB to whatever the display wants (either 16/24bpp RGB or some YUV format), so that's easiest to do by including it in the ffmpeg colorspace plugin. :). It still needs to be added to the avidemux fourcc list then, though, it's not in there either.
Interestingly, #138680 had palette handling as well, just like this file. I added a hack to ffmpegdec to convert to RGBA32 from those. I might want to add that hack over to ffmpegcolorspace and then this file would be supported as well.
Time to move the hack over and we can close this long standing playback bug Ronald :)
I know, I have a long list of failing media files and this is one of them. I can't do all at once...
Works with current CVS, but only with commandline and only if you use the video_00 template of avidemux only. Playbin still fails, I'm currently unsure why. The initial delay of the audio track might be too large. Once that's fixed, it should work.
gst-launch filesrc location=~/Media/clips/file.avi ! avidemux .video_00 ! { queue ! ffcolorspace ! ximagesink } avidemux0.audio_00 ! { queue ! audioconvert ! audioscale ! alsasink device=hw:0 } plays it fine now. Once I've backported ffcolorspace into ffmpegcolorspace (doing so now), playbin will play it. The image is completely screwed, however. Can you attach a screenshot of how it looks in mplayer?
Created attachment 33205 [details] Screenshot of video playing in mplayer
Created attachment 34455 [details] Screenshot showing video playing in Totem with color distortion
Just attached a screenshot of Totem playing this video. It does not scale correctly with ximagesink (as seen in shot) and colors are wrong and the image is upsidedown for some reason.
The colour distortion looks like a bad palette lookup to me. The upside-down bit, I'd be looking for stride information in the headers somewhere that we're ignoring - for upside-down video, I'd expect a negative stride.
Unlikely. Some FOURCCs are just defined with data going from bottom to top.
From my experience, if height > 0 for uncompressed RGB streams (FOURCC GST_RIFF_rgb, GST_RIFF_RGB and "DIB "), then the image is bottom up. A negative height means the image is top-down. See BITMAPINFOHEADER on MSDN for more information about that.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_1rw2.asp DIB is specifically bottom-up, unless the height is negative. It seems like we'll have to add some code for this in avidemux... Color distortion is fixed in CVS btw.
Invertion fixed too.