Opened 5 years ago

Last modified 2 years ago

#8074 open defect

movflags write_colr not working for ProRes encoded mov files

Reported by: en5ca Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Movflags write_colr not working for Prores encoded mov files. Works with h264 encoding. Output shows the color metadata to be written, but it's not readable with ffprobe or ffmpeg, or any other software. Doesn't seem to work in 4.1, 4.2 or git-master, but works in 4.0.
How to reproduce:

ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=24000/1001 -pix_fmt yuv422p10le -colorspace bt709 -color_primaries bt709 -color_trc bt709 -movflags write_colr -c:v prores_ks -profile:v hq testsrc.mov

ffprobe -i testsrc.mov -show_streams

ffmpeg version 4.1.4

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (4)

ffmpeg.log (12.8 KB ) - added by en5ca 5 years ago.
ffmpeg log
ffprobe.log (39.9 KB ) - added by en5ca 5 years ago.
ffprobe log
ffmpeg-git-master.log (11.5 KB ) - added by en5ca 5 years ago.
fffmpeg git master log
ffprobe-git-master.log (37.2 KB ) - added by en5ca 5 years ago.
ffprobe git master log

Download all attachments as: .zip

Change History (14)

by en5ca, 5 years ago

Attachment: ffmpeg.log added

ffmpeg log

by en5ca, 5 years ago

Attachment: ffprobe.log added

ffprobe log

comment:1 by en5ca, 5 years ago

Component: ffmpegavformat

comment:2 by Carl Eugen Hoyos, 5 years ago

Keywords: mov regression added
Version: 4.1.4unspecified

Please test current FFmpeg git head, the only version supported on this bug tracker.

in reply to:  2 comment:3 by en5ca, 5 years ago

Replying to cehoyos:

Please test current FFmpeg git head, the only version supported on this bug tracker.

Tested. Not working. Noticed that instead of writing any colorspace metadata, it always writes limited color range tag. I will add more recent log files.

by en5ca, 5 years ago

Attachment: ffmpeg-git-master.log added

fffmpeg git master log

by en5ca, 5 years ago

Attachment: ffprobe-git-master.log added

ffprobe git master log

comment:4 by Gyan, 5 years ago

Quicktime (MOV) files don't store colour range. See http://ffmpeg.org/pipermail/ffmpeg-user/2018-November/042154.html

in reply to:  4 ; comment:5 by en5ca, 5 years ago

Replying to Gyan:

Quicktime (MOV) files don't store colour range. See http://ffmpeg.org/pipermail/ffmpeg-user/2018-November/042154.html

That makes it stranger. But indeed, trying to add 709 colorspace metadata results in a file, which shows up as unknown colorspace and limited/tv color data levels, at least when examined with ffprobe. A certain 3rd party software interpret the file as 601 colorspace, which leads to noticeable color shift.

comment:6 by en5ca, 5 years ago

Version: unspecifiedgit-master

in reply to:  5 comment:7 by en5ca, 5 years ago

Replying to en5ca:

Replying to Gyan:

Quicktime (MOV) files don't store colour range. See http://ffmpeg.org/pipermail/ffmpeg-user/2018-November/042154.html

That [...]

read through. if i understood correctly that was about adding color range metadata to prores encoded video in mov container, which apparently isnt supported. im trying to add color space/primaries/transfer characteristics, but instead ffmpeg adds tv/mpeg/limited color range and progressive field order metadata tags, and none of the intended color tags. pointing out this problem occurs only with git master/later versions of ffmpeg. and affects at least prores, dnxhd/dnxhr and uncompressed (v210) yuv422 encoding/muxing to mov/quicktime. ffmpeg seems to leave out the color space/trc/prim data, and arbitrarily adds either field order progressive or color range tv, or both, metadata tags. compared with davinci resolve produced files, and it seems to correctly add the space/trc/prim metadatas to mov, and ffprobe also reads them correctly, so the problem probably lies somewhere in muxing the mov with ffmpeg.

comment:8 by Balling, 2 years ago

Status: newopen

Quicktime (MOV) files don't store colour range

They can store it in Rnge box. https://stackoverflow.com/questions/54405405/how-to-force-full-range-flag-on-export

Now that we fixed some files like (in ffplay too, see e645a1ddb90a863e129108aad9aa7e2d417f3615) ​https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket524/AVCI50.mov that is full range...

Do we have Rnge box samples with ProRes?

But you are wrong that movflags write_colr writes nothing (and it is default now if you specify all 3 things, matrix, trc and primaries): use exiftool

Color Representation : nclc 1 1 1

Color Representation : nclc 1 16 1

for PQ also works (just change to -color_trc smpte2084)

Last edited 2 years ago by Balling (previous) (diff)

comment:9 by Balling, 2 years ago

I will also point out two points here: first of all the command above does not write bt709 type of YCbCr, it just tags the output to decode like that. You need to specify -vf scale=out_color_matrix=bt709 for that.

Also this thing appears to be working (matrix bt.709 is indeed correctly decoding stuff).

ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=24000/1001 -vf scale=out_color_matrix=bt709 -pix_fmt yuv422p10le -colorspace bt709 -color_primaries bt709 -color_trc bt709 -movflags write_colr -c:v prores_ks -profile:v hq testsrc.mov

but this does not ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=24000/1001 -vf scale=out_color_matrix=bt2020 -pix_fmt yuv422p10le -colorspace bt2020nc -color_primaries bt709 -color_trc bt709 -movflags write_colr -c:v prores_ks -profile:v hq testsrcprores3.mov

Last edited 2 years ago by Balling (previous) (diff)

comment:10 by Balling, 2 years ago

In some way it is also a duplicate of #8862, since behaviour changes with workaround there.

Note: See TracTickets for help on using tickets.