[FFmpeg-devel] [PATCH v7] lavf: palettized QuickTime video in Matroska
matsp888 at yahoo.com
Sun Dec 27 07:20:28 CET 2015
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
Since the ff_get_qtpalette() function has to parse the video sample
description in two different ways, i.e. 1) by using the in-memory
private data when called from matroskadec.c, and 2) by reading from the
file when called from mov.c, it has to use a separate variable for each
of these sources. It may seem slightly redundant, but it is
unfortunately necessary. I would prefer that nobody touches what I've
been doing, since it's working fine right now, and it's very easy to
break things if you try to "improve it". Believe me, I've been there.
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
use the correct palette. And why is that, 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.
Video samples for testing are available at
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 15244 bytes
Desc: not available
More information about the ffmpeg-devel