[FFmpeg-devel] [PATCH 2/3] lavf/avienc: Write palette after BITMAPINFOHEADER

Mats Peterson matsp888 at yahoo.com
Fri Feb 19 22:22:00 CET 2016


On 02/19/2016 10:11 PM, Mats Peterson wrote:
> On 02/19/2016 10:10 PM, Michael Niedermayer wrote:
>> On Fri, Feb 19, 2016 at 10:05:32PM +0100, Mats Peterson wrote:
>>> On 02/19/2016 10:00 PM, Michael Niedermayer wrote:
>>>>>>> -
>>>>>>>                   pc_tag = ff_start_tag(pb, tag);
>>>>>>>                   avio_w8(pb, 0);
>>>>
>>>>>>>                   avio_w8(pb, 0);
>>>>
>>>>>>>                   avio_wl16(pb, 0); // reserved
>>>>>>> -                for (i = 0; i<256; i++) {
>>>>>>> +                for (i = 0; i < pal_size; i++) {
>>>>>>
>>>>>> this mismatches the stored size above
>>>>>
>>>>> Mismatches what stored size?
>>>>
>>>> the "avio_w8(pb, 0);" above
>>>>
>>>
>>> Right. I'll just set that one to 1 << bits_per_coded_sample then.
>>> Funny that not even Media Player supports these palette change
>>> chunks, by the way.
>>
>> what does it do with files from other sources that contain such
>> chunks ?
>> maybe it supports them for only some vieo codecs but not rawvideo
>>
> I haven't the foggiest. Your assumption might be correct, though.
>
> Mats

By the way, you were right regarding the RGB order. It's only in the 
palette after the BITMAPINFOHEADER in the strf chunk that the palette is 
in BGR (little endian) order. Sorry. I'll restore that.

Mats



More information about the ffmpeg-devel mailing list