[FFmpeg-devel] [PATCH 3/4] avformat/movenc: force colr atom for uncompressed yuv in mov
Derek Buitenhuis
derek.buitenhuis at gmail.com
Mon Nov 20 18:22:44 EET 2017
On 11/20/2017 3:19 PM, Dave Rice wrote:
> TN2162 requires a colr atom for uncompressed yuv (including v210, v308, v408, etc) in mov, so I'd prefer to write it in this case. Note that the colr atom provides an option for unspecified for each of the color values, so there's a method to write a colr atom which basically says ¯\_(ツ)_/¯.
[...]
> I disagree. I'd prefer to follow the specification and write a colr atom (in the case of uncompressed yuv in mov) that say the colr is unspecified rather than to write no colr atom at all and create an invalid file. See https://developer.apple.com/library/content/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9.
>
> I do agree that guesswork should be avoided or provided under an option that users could opt into. I suppose my preference order from support to oppose for writing uncompressed yuv in mov would be:
>
> 1: write a colr atom in all cases (if unknown, use unspecified values in colr atom)
> 2: write a colr atom if color data the known (no colr atom if unknown)
> 3: write a colr atom in all cases (if unknown, just make stuff up, #yolo)
My opinion falls somewhere in between, to something like this (in pseudo-code):
if (colors_known) {
write_colr(vals);
} else if (uncompressed_yuv) {
if (guesswork_user_option) {
write_colr(guessed_hacky_crap);
} else {
write_colr(unspecified);
}
} else if (guesswork_user_option) {
write_colr(guessed_hacky_crap);
} else {
// Don't write a colr atom because it adds no value, to write unspecified in it
// and no spec requires it for compressed streams.
}
Does this make sense?
- Derek
More information about the ffmpeg-devel
mailing list