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:
[Attachment 86942 - Click to enlarge]
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.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
+ Reply to Thread
Results 1 to 11 of 11
-
Last edited by Boxcart; 11th May 2025 at 19:48.
-
-
Sure, here is a link to a sample: https://drive.google.com/file/d/12MysaNUUe-JoncC29wgWS658nfy9PI6O/view?usp=drive_link
-
-
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"
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-beLast edited by ProWo; 12th May 2025 at 09:11.
-
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
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
----------
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" } } }
-
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
Similar Threads
-
HDR experience - Win7 + HDR map + HDMI 1.3 vs. Win10/11 + HDR + HDMI 2.0
By bloodhand in forum Software PlayingReplies: 4Last Post: 17th May 2023, 17:13 -
Degrain HDR - TemporalDegrain2 not working?
By Cuissedemouche in forum Video ConversionReplies: 8Last Post: 10th Dec 2021, 11:43 -
KMPlayer 64X with MadVR - HDR only working when interface is visible
By VHuser9779 in forum Software PlayingReplies: 0Last Post: 21st Jan 2021, 04:53 -
DVD only working in certain players
By chardles101 in forum Software PlayingReplies: 5Last Post: 28th Oct 2020, 14:58 -
DVD only working in certain players
By chardles101 in forum DVD & Blu-ray PlayersReplies: 1Last Post: 3rd Sep 2020, 22:58