[FFmpeg-devel] [PATCH 1/2] lavf/riffenc: Improve spec compliance; Fix WMP playback of AVI with xxpc chunks

Mats Peterson matsp888 at yahoo.com
Sun Mar 13 06:23:05 CET 2016


On 03/13/2016 06:15 AM, Mats Peterson wrote:
> On 03/12/2016 07:12 AM, Mats Peterson wrote:
>> New patch set. Forget the old one.
>>
>>  From the Microsoft documentation for BITMAPINFOHEADER at
>> https://msdn.microsoft.com/en-us/library/windows/desktop/dd318229%28v=vs.85%29.aspx:
>>
>>
>>
>> "biSize: Specifies the number of bytes required by the structure. This
>> value does not include the size of the color table or the size of the
>> color masks, if they are appended to the end of structure."
>>
>> So, biSize is 40 for palettized video as well. And Windows Media Player
>> won't display any video when using Microsoft Video 1 in 8 bpp mode or
>> RLE4/RLE8 if this value is set to anything else than 40.
>>
>> For non-palette extra data in huffyuv, ffvhuff, asv1 and asv2, the extra
>> data will be included in biSize. There are possibly more codecs with
>> special global headers, but we can fix that as they are discovered.
>> Currently these are the only ones I know of.
>>
>
> As an alternative to using a list, and as a compromise from my side, is
> the snippet below good enough?
>
> avio_wl32(pb, 40 + (ignore_extradata || pix_fmt == AV_PIX_FMT_PAL8 ?
>                0 : extradata_size));
>


This one is better:

avio_wl32(pb, 40 + (ignore_extradata || pal_avi ? 0 : extradata_size);


Mats

-- 
Mats Peterson
http://matsp888.no-ip.org/~mats/


More information about the ffmpeg-devel mailing list