[FFmpeg-devel] [PATCH] avcodec/dpxenc: support colour metadata in DPX encoder, fixes ticket #6023

Vittorio Giovara vittorio.giovara at gmail.com
Fri Feb 3 14:57:31 EET 2017


On Wed, Feb 1, 2017 at 1:42 PM, Kieran O Leary <kieran.o.leary at gmail.com> wrote:
> Hello,
>
> I'm cc'ing Vittorio as I don't think that he's subscribed to the list but
> he's contributed to dpxenc.c and recent colorspace filters. The same with
> Kate Murray from the Library of Congress who knows a lot more about DPX than
> me. Apologies if this is inappropriate.
>
> I mostly based this patch on other ffmpeg encoders, such as pncenc.c. I'm
> not really a C coder, I'm a moving image archivist who needs to be able to
> specify colour metadata in DPX for various workflows. Please excuse my
> ignorance/mistakes.
>
> This patch adds documentation and two command line options for the DPX
> encoder:
> -trc (Transfer Characteristics) and -clr (Colorimetric Specification), which
> set colour metadata values in a DPX file. Currently these are hardcoded to
> always be 2, aka Linear. Ticket #6023 is related to this, but there have
> also been many mailing list posts about this issue:
> https://ffmpeg.org/pipermail/ffmpeg-user/2015-March/025630.html
> https://ffmpeg.org/pipermail/ffmpeg-user/2015-December/029456.html
>
> I've kept the default values as 2 (Linear) as this is what was originally in
> dpxenc, but I'm not sure of the value of this really. I think that there's
> more value in a default of 0 (User-defined) which would just leave the
> values unspecified. Or perhaps no value at all! The initial default of 2 for
> colorimetric was potentially useless as 2 is listed as 'Not applicable' for
> colorimetric specification in SMPTE 268M-2003.
>
> The values for each of these options are the integers listed in the SMPTE
> standards doc:
> https://web.archive.org/web/20050706060025/http://www.smpte.org/smpte_store/standards/pdf/s268m.pdf
>
> Initially I just had one argument that set the Transfer Characteristic and
> Colorimetric Specification to the same value, but perhaps some use cases
> could require that these values  be different? I'm not sure if they ever
> would. I have never seen real world files that suggest this but I can edit
> this if it seems weird.
>
> Some of the values from 0-12 are listed as 'Not applicable' for the
> colorimetric specification, but I didn't know how to specify just those
> numbers (0-1, 4-10) in the patch. Perhaps it's OK to leave it as is,
> otherwise hopefully someone can point me to similar code that I can learn
> from. Again, apologies for my ignorance.
>

Hey Kieran,
I think the code looks fine. I am just wondering if we should also
offer the possibility to set these flags from the standard context
options (-color_trc and others). I'm aware that not all values match
or are valid but maybe a small conversion table or extending the main
table could be a viable approach. Similarly this could be done for the
decoder so that color properties are not lost during a dpx->dpx
conversion maybe.
-- 
Vittorio


More information about the ffmpeg-devel mailing list