VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Hi all,
    I'm having an issue with a video file recorded in HDR that is not playing in HDR in all players, particularly Plex, which is where I primarily watch my media. It was recorded using FFmpeg and a Blackmagic capture card. I have been recording in HDR using the same FFmpeg command and the same hardware for years like this, with no issue until now, and I can't seem to figure out the problem with this particular video file.

    MediaInfo says the video is HDR, and it plays back correctly in HDR and looks good using MPC. But Plex does not identify it as HDR and as such the colors are flat and washed out. VLC also has the same issue where the colors are flat and washed out. However PowerDVD correctly plays the video in HDR.

    Here is the MediaInfo:

    Image
    [Attachment 86942 - Click to enlarge]


    Code:
    Video
    ID                                       : 1
    Format                                   : HEVC
    Format/Info                              : High Efficiency Video Coding
    Format profile                           : Main 10@L5.1@High
    HDR format                               : SMPTE ST 2086, HDR10 compatible
    Codec ID                                 : V_MPEGH/ISO/HEVC
    Duration                                 : 2 h 3 min
    Bit rate                                 : 67.3 Mb/s
    Width                                    : 3 840 pixels
    Height                                   : 2 160 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 10 bits
    Bits/(Pixel*Frame)                       : 0.338
    Stream size                              : 58.0 GiB (96%)
    Writing library                          : Lavc62.1.102 hevc_nvenc
    Language                                 : English
    Default                                  : No
    Forced                                   : No
    Color range                              : Limited
    Color primaries                          : BT.2020
    Transfer characteristics                 : PQ
    Matrix coefficients                      : BT.2020 constant
    matrix_coefficients_Original             : BT.2020 non-constant
    Mastering display color primaries        : R: x=0.680000 y=0.320000, G: x=0.270000 y=0.690000, B: x=0.150000 y=0.060000, White point: x=0.312700 y=0.329000
    Mastering display luminance              : min: 0.0001 cd/m2, max: 1000 cd/m2
    Maximum Content Light Level              : 1000
    Maximum Frame-Average Light Level        : 300
    I manually entered the HDR parameters into the header using MKVToolnix and verified they were correct. I've never had this issue before. Any help would be appreciated. Thanks.
    Last edited by Boxcart; 11th May 2025 at 19:48.
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Try re-encoding it to h264 for a minute to see if plex and vlc will play it in hdr10.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Originally Posted by Boxcart View Post
    MediaInfo says the video is HDR, and it plays back correctly in HDR and looks good using MPC. But Plex does not identify it as HDR and as such the colors are flat and washed out. VLC also has the same issue where the colors are flat and washed out. However PowerDVD correctly plays the video in HDR.
    Could you upload this video and post the link here, so we can take a look.
    Quote Quote  
  4. Originally Posted by ProWo View Post
    Originally Posted by Boxcart View Post
    MediaInfo says the video is HDR, and it plays back correctly in HDR and looks good using MPC. But Plex does not identify it as HDR and as such the colors are flat and washed out. VLC also has the same issue where the colors are flat and washed out. However PowerDVD correctly plays the video in HDR.
    Could you upload this video and post the link here, so we can take a look.
    Sure, here is a link to a sample: https://drive.google.com/file/d/12MysaNUUe-JoncC29wgWS658nfy9PI6O/view?usp=drive_link
    Quote Quote  
  5. Originally Posted by johns0 View Post
    Try re-encoding it to h264 for a minute to see if plex and vlc will play it in hdr10.
    Didn't work. I re-encoded a snippet using ffmpeg and now it's washed out in even MPC. I used this command:

    Code:
    FFMPEG -i "[input]" -c:v libx264 -an output264.mkv"
    Can h264 even support 10-bit color spaces/HDR?
    Quote Quote  
  6. Originally Posted by Boxcart View Post
    It ask for access data. Please use the free share mode.
    Quote Quote  
  7. Originally Posted by ProWo View Post
    Originally Posted by Boxcart View Post
    It ask for access data. Please use the free share mode.
    Sorry about that. It should work now.
    Quote Quote  
  8. Your sample has the necessary side data, with all the Mastering display metadata.

    But is missing
    "color_transfer": "smpte2084"
    "color_primaries": "bt2020"

    Your stream:
    "color_range": "tv"
    "color_space": "bt2020nc"

    A working HDR10 stream:
    "color_range": "tv"
    "color_space": "bt2020nc"
    "color_transfer": "smpte2084"
    "color_primaries": "bt2020"

    Test with:
    ffprobe -loglevel 0 -print_format json -show_format -show_streams "your_video_input"
    The simple header correction isn't enough.
    You could fix this with the ffmpeg bitstream filter.

    Read:
    https://superuser.com/questions/1742765/ffmpeg-x265-error-color-primaries-must-be-tran...istics-must-be
    Last edited by ProWo; 12th May 2025 at 09:11.
    Quote Quote  
  9. Originally Posted by ProWo View Post
    Your sample has the necessary side data, with all the Mastering display metadata.

    But is missing
    "color_transfer": "smpte2084"
    "color_primaries": "bt2020"

    Your stream:
    "color_range": "tv"
    "color_space": "bt2020nc"

    A working HDR10 stream:
    "color_range": "tv"
    "color_space": "bt2020nc"
    "color_transfer": "smpte2084"
    "color_primaries": "bt2020"

    Test with:
    ffprobe -loglevel 0 -print_format json -show_format -show_streams "your_video_input"
    The simple header correction isn't enough.
    You could fix this with the ffmpeg bitstream filter.

    Read:
    https://superuser.com/questions/1742765/ffmpeg-x265-error-color-primaries-must-be-tran...istics-must-be
    Thanks. The output of the ffprobe command you gave is below. I noticed with ffprobe yesterday it was showing "(bt2020nc/unknown/unknown)" and figured something was missing, because those other two are not shown as "unknown" in ffprobe for other recorded media I have where HDR works in all players. It's strange because I have had no issues using the same ffmpeg command and hardware for years to record live TV and movies for my HTPC since DVRs are going away. Moreover the LG TV I displayed the original source input on detected and enabled HDR and it appeared properly. Blackmagic's desktop software (I use that to check the dynamic range, resolution, and frame rate of the input to put into the ffmpeg command) also detected HDR.

    In any event, I tried using the bitstream filter command from the discussion you linked and could not get it to work. I'm not the best at building ffmpeg commands. I adapted and tried from the command in the post you linked the following:

    Code:
    ffmpeg -y -i "input.mkv" -map 0 -c copy -map_metadata 0 -bsf:v h264_metadata=colour_primaries=9:transfer_characteristics=16:matrix_coefficients=9 video2.mkv
    Which gave the error:

    Code:
    [h264_metadata @ 000001d84f9e5040] Codec 'hevc' (173) is not supported by the bitstream filter 'h264_metadata'. Supported codecs are: h264 (27)
    [vost#0:0/copy @ 000001d8500af4c0] Error initializing bitstream filter: h264_metadata
    Error opening output file video2.mkv.
    Error opening output files: Invalid argument
    Shouldn't it be hevc or h265 or hevc_nvenc instead of h264? This is an area I'm not too skilled at. What ffmpeg "bitstream filter" command should I try?

    ----------

    Output of the ffprobe command you gave me above returned this:

    Code:
    "streams": [
            {
                "index": 0,
                "codec_name": "hevc",
                "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
                "profile": "Main 10",
                "codec_type": "video",
                "codec_tag_string": "[0][0][0][0]",
                "codec_tag": "0x0000",
                "width": 3840,
                "height": 2160,
                "coded_width": 3840,
                "coded_height": 2176,
                "has_b_frames": 2,
                "sample_aspect_ratio": "1:1",
                "display_aspect_ratio": "16:9",
                "pix_fmt": "yuv420p10le",
                "level": 153,
                "color_range": "tv",
                "color_space": "bt2020nc",
                "chroma_location": "left",
                "refs": 1,
                "view_ids_available": "",
                "view_pos_available": "",
                "r_frame_rate": "27021/1127",
                "avg_frame_rate": "27021/1127",
                "time_base": "1/1000",
                "start_pts": 0,
                "start_time": "0.000000",
                "extradata_size": 135,
                "disposition": {
                    "default": 0,
                    "dub": 0,
                    "original": 0,
                    "comment": 0,
                    "lyrics": 0,
                    "karaoke": 0,
                    "forced": 0,
                    "hearing_impaired": 0,
                    "visual_impaired": 0,
                    "clean_effects": 0,
                    "attached_pic": 0,
                    "timed_thumbnails": 0,
                    "non_diegetic": 0,
                    "captions": 0,
                    "descriptions": 0,
                    "metadata": 0,
                    "dependent": 0,
                    "still_image": 0,
                    "multilayer": 0
                },
                "tags": {
                    "language": "eng",
                    "ENCODER": "Lavc62.1.102 hevc_nvenc",
                    "BPS": "67310268",
                    "DURATION": "02:03:26.727000000",
                    "NUMBER_OF_FRAMES": "177584",
                    "NUMBER_OF_BYTES": "62318597473",
                    "_STATISTICS_WRITING_APP": "mkvmerge v92.0 ('Everglow') 64-bit",
                    "_STATISTICS_WRITING_DATE_UTC": "2025-05-05 02:14:12",
                    "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
                },
                "side_data_list": [
                    {
                        "side_data_type": "Content light level metadata",
                        "max_content": 1000,
                        "max_average": 300
                    },
                    {
                        "side_data_type": "Mastering display metadata",
                        "red_x": "11408507/16777216",
                        "red_y": "5368709/16777216",
                        "green_x": "9059697/33554432",
                        "green_y": "11576279/16777216",
                        "blue_x": "5033165/33554432",
                        "blue_y": "16106127/268435456",
                        "white_point_x": "10492471/33554432",
                        "white_point_y": "689963/2097152",
                        "min_luminance": "209800/2098000053",
                        "max_luminance": "1000/1"
                    }
                ]
            },
            {
                "index": 1,
                "codec_name": "eac3",
                "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)",
                "codec_type": "audio",
                "codec_tag_string": "[0][0][0][0]",
                "codec_tag": "0x0000",
                "sample_fmt": "fltp",
                "sample_rate": "48000",
                "channels": 6,
                "channel_layout": "5.1(side)",
                "bits_per_sample": 0,
                "initial_padding": 256,
                "dmix_mode": "0",
                "ltrt_cmixlev": "0.000000",
                "ltrt_surmixlev": "0.000000",
                "loro_cmixlev": "0.000000",
                "loro_surmixlev": "0.000000",
                "r_frame_rate": "0/0",
                "avg_frame_rate": "0/0",
                "time_base": "1/1000",
                "start_pts": -3,
                "start_time": "-0.003000",
                "bit_rate": "3072000",
                "disposition": {
                    "default": 1,
                    "dub": 0,
                    "original": 0,
                    "comment": 0,
                    "lyrics": 0,
                    "karaoke": 0,
                    "forced": 0,
                    "hearing_impaired": 0,
                    "visual_impaired": 0,
                    "clean_effects": 0,
                    "attached_pic": 0,
                    "timed_thumbnails": 0,
                    "non_diegetic": 0,
                    "captions": 0,
                    "descriptions": 0,
                    "metadata": 0,
                    "dependent": 0,
                    "still_image": 0,
                    "multilayer": 0
                },
                "tags": {
                    "language": "eng",
                    "ENCODER": "Lavc62.1.102 eac3",
                    "BPS": "3072000",
                    "DURATION": "02:03:25.930000000",
                    "NUMBER_OF_FRAMES": "694306",
                    "NUMBER_OF_BYTES": "2843877376",
                    "_STATISTICS_WRITING_APP": "mkvmerge v92.0 ('Everglow') 64-bit",
                    "_STATISTICS_WRITING_DATE_UTC": "2025-05-05 02:14:12",
                    "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
                }
            },
            {
                "index": 2,
                "codec_name": "subrip",
                "codec_long_name": "SubRip subtitle",
                "codec_type": "subtitle",
                "codec_tag_string": "[0][0][0][0]",
                "codec_tag": "0x0000",
                "r_frame_rate": "0/0",
                "avg_frame_rate": "0/0",
                "time_base": "1/1000",
                "start_pts": -3,
                "start_time": "-0.003000",
                "duration_ts": 7406727,
                "duration": "7406.727000",
                "disposition": {
                    "default": 1,
                    "dub": 0,
                    "original": 0,
                    "comment": 0,
                    "lyrics": 0,
                    "karaoke": 0,
                    "forced": 0,
                    "hearing_impaired": 0,
                    "visual_impaired": 0,
                    "clean_effects": 0,
                    "attached_pic": 0,
                    "timed_thumbnails": 0,
                    "non_diegetic": 0,
                    "captions": 0,
                    "descriptions": 0,
                    "metadata": 0,
                    "dependent": 0,
                    "still_image": 0,
                    "multilayer": 0
                },
                "tags": {
                    "language": "eng",
                    "BPS": "65",
                    "DURATION": "01:58:24.973000000",
                    "NUMBER_OF_FRAMES": "1381",
                    "NUMBER_OF_BYTES": "58379",
                    "_STATISTICS_WRITING_APP": "mkvmerge v92.0 ('Everglow') 64-bit",
                    "_STATISTICS_WRITING_DATE_UTC": "2025-05-05 02:14:12",
                    "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
                }
            }
        ],
        "format": {
            "filename": "input.mkv",
            "nb_streams": 3,
            "nb_programs": 0,
            "nb_stream_groups": 0,
            "format_name": "matroska,webm",
            "format_long_name": "Matroska / WebM",
            "start_time": "-0.003000",
            "duration": "7406.727000",
            "size": "742348951",
            "bit_rate": "70386672",
            "probe_score": 100,
            "tags": {
                "creation_time": "2025-05-05T02:14:12.000000Z",
                "ENCODER": "Lavf62.0.102"
            }
        }
    }
    Quote Quote  
  10. Try
    Code:
    ffmpeg -y -i "input.mkv" -map 0 -c copy -bsf:v hevc_metadata=transfer_characteristics=16:colour_primaries=9:matrix_coefficients=9 video2.mkv
    Quote Quote  
  11. Originally Posted by ProWo View Post
    Try
    Code:
    ffmpeg -y -i "input.mkv" -map 0 -c copy -bsf:v hevc_metadata=transfer_characteristics=16:colour_primaries=9:matrix_coefficients=9 video2.mkv
    Thanks it looks like this solved the problem. VLC showed the HDR correctly and I threw the test sample into Plex and it also identified HDR. I'm going to process the full video now and will report back if there are any issues.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!