Opened 6 weeks ago

Last modified 36 hours ago

#11238 new defect

-color_trc and -color_primaries flags don't work

Reported by: owztue Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: color_primaries regression
Cc: MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

How to reproduce:
Any video input would do i think (at least h264 in mp4 with yuv420p), but you can also test it with one of ffmpeg's test source:

% ffmpeg -f lavfi -i smptebars -c:v rawvideo -pix_fmt uyvy422 -t 3 rawvid.avi

And then reencode the result to h264:

% ffmpeg -i rawvid.avi -c:v libx264 -pix_fmt yuv420p -color_range "tv" -colorspace "bt709" -color_trc "bt709" -color_primaries "bt709" vid-reenc.mp4

and now output of ffprobe -show_streams vid-reenc.mp4 has

yuv420p(tv, bt709/unknown/unknown, progressive),
color_range=tv
color_space=bt709
color_transfer=unknown
color_primaries=unknown

I don't know when this problem emerged, but version built on 03/May/2024 doesn't have this problem and all the flags are set correctly with the same commands above. I'm on 09/Oct/2024 master-latest build now.

Change History (5)

comment:1 by owztue, 6 weeks ago

Priority: normalimportant

comment:2 by Balling, 6 weeks ago

Okay, yes, I can reproduce this

Last edited 6 weeks ago by Balling (previous) (diff)

comment:3 by Balling, 6 weeks ago

-color_trc bt709 -color_primaries bt709 now has to be put before the -i assuming the input has no those options set, avi file does not

comment:4 by Aras Pranckevicius, 9 days ago

This change (regression?) probably breaks many expectations and scripts/pipelines that people might have.

E.g. ffmpeg's own wiki says "On ffmpeg command-line this is what options such as colorspace and color_trc do; you can also put them on the output side to modify what space the output is in" (https://trac.ffmpeg.org/wiki/colorspace), but apparently now on the "output side" they do nothing at all.

Likewise, Academy Sofware Foundation "encoding guidelines" page (https://academysoftwarefoundation.github.io/EncodingGuidelines/Quickstart.html) in all the ffmpeg command line examples puts color_trc and color_primaries on the output side. I've spent quite some hours yesterday puzzled why examples there do not work properly, before thinking of "let's try ffmpeg 6.0 instead of 7.1"

comment:5 by MasterQuestionable, 36 hours ago

Cc: MasterQuestionable added
Keywords: color_primaries regression added
Note: See TracTickets for help on using tickets.