Log in

View Full Version : Add Colormeitry Flags to the Same File


jay123210599
20th May 2025, 01:04
I have a video that doesn't have colorimetry flags. How do I add them to the video without having to create a new file? I tried using this command but I got the following error:

mkvpropedit "C:\Users\User\Videos\video.mkv" --edit track:1 -s colour-primaries=1 -s colour-transfer-characteristics=1 -s colour-matrix-coefficients=1
The file is being analyzed.
Error: The name 'colour-primaries' is not a valid property name for the current edit specification in '--set colour-primaries=1'.

hello_hello
24th May 2025, 13:04
For mkvpropedit it's color, not colour.

mkvpropedit stores/changes that info at the container level but it doesn't modify the bitstream, so if the info already exists in the bitstream MediaInfo will display something like:

Color primaries : BT.601 PAL
colour_primaries_Original : BT.709

I usually extract the video stream to a raw format with ffmpeg while adding/changing the VUI info, then remux it with MKVToolNix. The info isn't saved to the container that way, but as long as it's written to the video stream I don't think it matters.

https://ffmpeg.org/ffmpeg-all.html#h264_005fmetadata
https://ffmpeg.org/ffmpeg-all.html#hevc_005fmetadata

For h265:
ffmpeg -i input.mkv -vcodec copy -an -sn -bsf:v hevc_metadata=colour_primaries=1:transfer_characteristics=1:matrix_coefficients=1 output.hevc