[FFmpeg-devel] [PATCH v6] lavf: palettized QuickTime video in Matroska

Mats Peterson matsp888 at yahoo.com
Wed Dec 23 15:37:18 CET 2015

I mistakenly used 'extradata' rather than 'st->codec->extradata', 
naturally leading to a segfault. Here's an updated patch.

An explanation of the patch follows:

Palettized QuickTime video in Matroska has hitherto not been recognized 
whatsoever, and the "palette" used has been completely random.

The patch for matroskadec.c fixes this issue by adding a palette side 
data packet in matroska_deliver_packet(), much in the same way as it's 
done in mov.c.

The change to mov.c consists mainly of moving the palette handling from 
the mov_parse_stsd_video() function to a new ff_get_qtpalette() function 
in the new file qtpalette.c, which is shared by both matroskadec.c and 

In matroskadec.c, I'm also putting the palette in 'extradata', like it's 
done for V_MS/VFW/FOURCC; this is a requirement in order for MPlayer to 
recognize the palette. And why is this, you may wonder. Well, it's 
because for some mysterious reason, MPlayer adds ANOTHER palette side 
data packet after the one added in matroskadec.c. It uses whatever is in 
extradata as the palette when adding this packet.


Mats Peterson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavf-palettized-QuickTime-video-in-Matroska.patch
Type: text/x-patch
Size: 14139 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151223/30ac5f8b/attachment.bin>

More information about the ffmpeg-devel mailing list