[MPlayer-dev-eng] [PATCH] biPlanes must always be 1 in avi files (bug #146)

Richard van der Hoff richardv at mxtelecom.com
Fri Dec 31 12:39:42 CET 2004


Arpi wrote:
> Hi,
> 
>>Hi,
>>this patch makes sure that biPlanes is always 1 when writing an AVI, as
>>according to Microsoft that's how it must be (see bugzilla for more
>>information).
>>I intend to apply soon.
> 
> i'm object it.
> first, check a bunch of wild files, they all have 0 there.
> the planes=1 is only true for the uncompressed rgb files.
> for yuv files and codecs it's 0.

To be honest, I don't see either 'there are broken files out in the 
wild' or 'virtualdub is broken' as valid arguments that MEncoder should 
also create broken files (where broken == "in violation of the M$ spec" 
- I accept other definitions of broken are possible).

> (m$ specs tell about rgb only, yuv formats were added later by non-m$
> ppl, and they define their own rules...

The very link I gave defining biPlanes to be 1 
(http://msdn.microsoft.com/archive/en-us/directx9_c/directx/htm/bitmapinfoheaderstructure.asp) 
defines width and height values specifically for YUV formats, so I don't 
think that's correct. And even if it were, why are we writing biPlanes = 
0 for RGB formats?

I'm inclined to agree that forcing the AVI muxer to write 1, even if 
that's incorrect, is wrong; however, Reimar has argued that the MOV 
demuxer is also the wrong place to fix this, so I'm not sure what else 
to do.

Being honest here, the only reason we noticed the problem was because 
we'd written an in-house AVI demuxer with reference to the above spec, 
which was giving warnings on files created by a MOV->AVI conversion with 
mencoder. So yes, our AVI demuxer has been changed to ignore the 
biPlanes field, and the issue is largely academic. Nevertheless, it's 
pretty clear to me that mencoder is currently writing files in violation 
of the AVI spec, which is why I opened the bug. The fact that most 
players will deal with the problem is mere good fortune.

Cheers

Richard

-- 
Richard van der Hoff <richardv at mxtelecom.com>
Systems Analyst
Tel: +44 (0) 845 666 7778
http://www.mxtelecom.com




More information about the MPlayer-dev-eng mailing list