Missing color metadata led to wrong colors when re-encoding

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
mambojambo
Posts: 6
Joined: Mon Jan 19, 2026 8:33 pm

Missing color metadata led to wrong colors when re-encoding

Post by mambojambo » Tue Mar 31, 2026 9:12 pm

Hey everyone, I am currently working on ripping my BD collection and encoding it to AV1 to save space. After quite some discs I noticed a color difference between source and encoded material and again after quite some testing I found that the issue was the 10-bit color conversion that is always recommended with AV1. Since ffmpeg doesn't know which color space the source is in, it assumed full range and falsely converted it.
So replacing `-pix_fmt yuv420p10le` in the command with `-vf "setparams=range=limited:colorspace=bt709:color_primaries=bt709:color_trc=bt709,format=yuv420p10le"` fixed it for me.

Can this fix maybe be applied to MakeMKV? My UHD discs are tagged correctly it seems, but for the normal BDs color metadata is missing completely:

Code: Select all

ffprobe Beauty\ and\ the\ Beast.mkv 2>&1 | grep "Stream #0:0" 
  Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn

ffprobe Treasure\ Planet.mkv 2>&1 | grep "Stream #0:0" 
  Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
This could potentially save some people a lot of headaches and time :)

Gnarlyteeth
Posts: 1
Joined: Wed Jul 29, 2026 2:36 am

Re: Missing color metadata led to wrong colors when re-encoding

Post by Gnarlyteeth » Sun Aug 02, 2026 11:42 pm

I recently ripped the 4k blu-ray disc "Blade Runner the Final Cut" and the necessary metadata for proper transcoding was available with the following ffprobe command:

Code: Select all

ffprobe -v quiet -print_format json -show_frames -select_streams v:0 -read_intervals "%+#1" "Blade Runner- The Final Cut_t00.mkv"
Be sure to select the correct stream and change the file name to your mkv file. The output looks like so:

Code: Select all

{
    "frames": [
        {
            "media_type": "video",
            "stream_index": 0,
            "key_frame": 1,
            "pts": 0,
            "pts_time": "0.000000",
            "best_effort_timestamp": 0,
            "best_effort_timestamp_time": "0.000000",
            "duration": 41,
            "duration_time": "0.041000",
            "pkt_pos": "7287",
            "pkt_size": "2428",
            "width": 3840,
            "height": 2160,
            "crop_top": 0,
            "crop_bottom": 0,
            "crop_left": 0,
            "crop_right": 0,
            "pix_fmt": "yuv420p10le",
            "sample_aspect_ratio": "1:1",
            "pict_type": "I",
            "interlaced_frame": 0,
            "top_field_first": 0,
            "repeat_pict": 0,
            "color_range": "tv",
            "color_space": "bt2020nc",
            "color_primaries": "bt2020",
            "color_transfer": "smpte2084",
            "chroma_location": "topleft",
            "side_data_list": [
                {
                    "side_data_type": "H.26[45] User Data Unregistered SEI message"
                },
                {
                    "side_data_type": "Mastering display metadata",
                    "red_x": "34000/50000",
                    "red_y": "16000/50000",
                    "green_x": "13250/50000",
                    "green_y": "34500/50000",
                    "blue_x": "7500/50000",
                    "blue_y": "3000/50000",
                    "white_point_x": "15635/50000",
                    "white_point_y": "16450/50000",
                    "min_luminance": "50/10000",
                    "max_luminance": "40000000/10000"
                },
                {
                    "side_data_type": "Content light level metadata",
                    "max_content": 1655,
                    "max_average": 117
                }
            ]
        }
    ]
}

Post Reply