[FFmpeg-devel] [PATCH 3/4] avformat/movenc: force colr atom for uncompressed yuv in mov

Dave Rice dave at dericed.com
Mon Nov 20 16:50:19 EET 2017


> On Nov 20, 2017, at 9:01 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 
> 2017-11-20 2:24 GMT+01:00 James Almer <jamrial at gmail.com <mailto:jamrial at gmail.com>>:
>> On 11/18/2017 11:19 PM, Dave Rice wrote:
>>> From 41da5e48f8788b85dd7a382030bb2866c506cc03 Mon Sep 17 00:00:00 2001
>>> From: Dave Rice <dave at dericed.com>
>>> Date: Sat, 18 Nov 2017 20:31:27 -0500
>>> Subject: [PATCH 3/4] avformat/movenc: force colr atom for uncompressed yuv in
>>> mov
>>> MIME-Version: 1.0
>>> Content-Type: text/plain; charset=UTF-8
>>> Content-Transfer-Encoding: 8bit
>>> 
>>> As required by Appleā€™s TN2162.
>>> ---
>>> libavformat/movenc.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>>> index aaa1dedfd7..86960b19c1 100644
>>> --- a/libavformat/movenc.c
>>> +++ b/libavformat/movenc.c
>>> @@ -1978,7 +1978,7 @@ static int mov_write_video_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tr
>>>         else
>>>             av_log(mov->fc, AV_LOG_WARNING, "Not writing 'gama' atom. Format is not MOV.\n");
>>>     }
>>> -    if (mov->flags & FF_MOV_FLAG_WRITE_COLR) {
>>> +    if (mov->flags & FF_MOV_FLAG_WRITE_COLR || uncompressed_ycbcr) {
>>>         if (track->mode == MODE_MOV || track->mode == MODE_MP4)
>>>             mov_write_colr_tag(pb, track);
>>>         else
>>> 
>> 
>> The write_colr option says "Write colr atom (Experimental, may be
>> renamed or changed, do not use from scripts)". Does that still apply? Is
>> the feature/spec still experimental?
>> 
>> If not, then the option and flag could be removed as well as part of
>> this patch.
> 
> I believe it should be removed in a follow-up patch.

I am hesitant to see write_colr option removed since the guesswork used here https://github.com/FFmpeg/FFmpeg/blob/8f4702a93f87f9f76563e80f1ae2141a40029d9d/libavformat/movenc.c#L1747-L1775 would then be applied to all movs of standard HD and SD size and cause many ffmpeg outputs to appear differently after the change.

Could the guesswork here be removed? Or could write_colr be enabled with the option removed while the guesswork itself has its own option?
Dave Rice


More information about the ffmpeg-devel mailing list