Wrong / reversed HDR metadata after conversion?

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Wrong / reversed HDR metadata after conversion?

Post by shad »

Description of problem or question:
I did my first conversion of a HDR video for a test and am confused about the result deisplayed by MediaInfo. I've compared the info of the source file with the resulting file. While there are several differences, many of them are probably correct due to conversion. However, there are some (that are related to HDR metadata, I think), that seem to be wrong. Here are some of them (first line is from source file, second from the resulting file):
chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2
chromaloc=0

master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,20)
master-display=G(34000,16000)B(13250,34500)R(7500,3000)WP(15635,16450)L(10000000,20)

max-cll=595,494
cll=595,494

max-luma=1023
max-luma=255

hdr / hdr-opt / no-dhdr10-opt
hdr10 / no-hdr10-opt / no-dhdr10-opt
Value for master-display seem to be mixed up / reversed: G in source = B in the result, B -> R, R -> G

Not sure about the other values, but considering the release info, that HDR metadata is supposed to be the same, there seem to be some issues.

First I used my own preset, then I used one of the default presets with the same result rearding these data.


HandBrake version (e.g., 1.0.0):
1.4.1



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 64bit



HandBrake Activity Log ***required*** (see How-to get an activity log)
None of these values appear in the log file, it seems, so they seem to be irrelevant here.
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Please post the activity log.
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Re: Wrong / reversed HDR metadata after conversion?

Post by shad »

Took a closer look at the log after my post and discovered these entries and was going to add the activity log already, sorry.

Here it is: https://pastebin.com/TXg8ZhRW
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Which version of mediainfo are you using to check those values? The order seems correct in the log, and I just tried to encode one file and saw no reorder.
Recent mediainfo versions print something like this:
Mastering display color primaries : R: x=0.680000 y=0.319960, G: x=0.264940 y=0.689960, B: x=0.150000 y=0.059980, White point: x=0.312700 y=0.312700

Totally unrelated to your issue, but to encode in HDR you have to disable the filters and select the 10bit version of x265.
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Re: Wrong / reversed HDR metadata after conversion?

Post by shad »

I'm using MediaInfo 21.03, which is the latest version according to their website.
In the section "Encoded_Library_Settings :" I see this:
[...]master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,20) / max-cll=595,494 / min-luma=0 / max-luma=1023 /[...]

Not sure where you see the data in the format you posted.

Also it's not about a reorder as such. Just that (13250,34500) for G in the source file are displayed as values vor B in the resulting file etc.

I've tried FastFlix tool from this guide https://codecalamity.com/encoding-uhd-4 ... th-ffmpeg/ and converted a few seconds of my video. The resulting video had the same data / values as the source file.
Totally unrelated to your issue, but to encode in HDR you have to disable the filters and select the 10bit version of x265.
Thanks for the hint, must have missed that point in the release notes or so.

I'm not using any filters on my own. I just kept the suggested values for "Interlace Detection = default" and "Deinterlace: Decomb->Default". Do I have to set these two to "Off" like all others as well?
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Please post the complete output of mediainfo of both the source and the encoded file.
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Re: Wrong / reversed HDR metadata after conversion?

Post by shad »

Source:

Code: Select all

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 2 h 4 min
Bit rate                                 : 9 199 kb/s
Width                                    : 1 920 pixels
Height                                   : 800 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.250
Stream size                              : 7.98 GiB (90%)
Writing library                          : x265 3.0_Au+4-dcbec33bfb0f:[Windows][GCC 8.2.1][64 bit] 10bit
Encoding settings                        : cpuid=1111039 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x800 / interlace=0 / total-frames=178627 / level-idc=50 / high-tier=1 / uhd-bd=0 / ref=6 / no-allow-non-conformance / repeat-headers / annexb / aud / hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=16 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=60 / lookahead-slices=0 / scenecut=40 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=4 / tu-intra-depth=4 / limit-tu=4 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=5 / limit-refs=0 / no-limit-modes / me=3 / subme=5 / merange=57 / temporal-mvp / weightp / weightb / no-analyze-src-pics / deblock=-3:-3 / no-sao / no-sao-non-deblock / rd=3 / no-early-skip / no-rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=1.10 / psy-rdoq=1.10 / no-rd-refine / no-lossless / cbqpoffs=-1 / crqpoffs=-1 / rc=crf / crf=14.0 / qcomp=0.75 / qpstep=4 / stats-write=0 / stats-read=0 / vbv-maxrate=100000 / vbv-bufsize=100000 / vbv-init=0.9 / crf-max=0.0 / crf-min=0.0 / ipratio=1.30 / pbratio=1.20 / aq-mode=0 / aq-strength=0.00 / no-cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2 / display-window=0 / master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,20) / max-cll=595,494 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / hdr / hdr-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / qp-adaptation-range=1.00
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0020 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 595 cd/m2
Maximum Frame-Average Light Level        : 494 cd/m2

Audio
ID                                       : 2
Format                                   : E-AC-3
Format/Info                              : Enhanced AC-3
Commercial name                          : Dolby Digital Plus
Format profile                           : Blu-ray Disc
Codec ID                                 : A_EAC3
Duration                                 : 2 h 4 min
Bit rate mode                            : Constant
Bit rate                                 : 1 024 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Stream size                              : 909 MiB (10%)
Title                                    : E-AC3 7.1
Language                                 : German
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 3
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 0 min
Bit rate                                 : 452 b/s
Count of elements                        : 38
Stream size                              : 399 KiB (0%)
Title                                    : Forced
Language                                 : German
Default                                  : Yes
Forced                                   : Yes

Text #2
ID                                       : 4
Format                                   : PGS
Muxing mode                              : zlib
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 2 min
Bit rate                                 : 35.2 kb/s
Count of elements                        : 2456
Stream size                              : 30.9 MiB (0%)
Title                                    : Full
Language                                 : German
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:Chapter 01
00:08:11.949                             : en:Chapter 02
00:14:56.562                             : en:Chapter 03
00:24:21.376                             : en:Chapter 04
00:30:38.628                             : en:Chapter 05
00:38:39.650                             : en:Chapter 06
00:45:51.832                             : en:Chapter 07
00:51:57.989                             : en:Chapter 08
00:57:55.096                             : en:Chapter 09
01:03:58.835                             : en:Chapter 10
01:12:22.421                             : en:Chapter 11
01:19:10.454                             : en:Chapter 12
01:28:26.884                             : en:Chapter 13
01:33:52.835                             : en:Chapter 14
01:42:19.967                             : en:Chapter 15
01:50:44.888                             : en:Chapter 16
01:53:46.069                             : en:Chapter 17

Encoded:

Code: Select all

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4@Main
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 2 h 4 min
Bit rate                                 : 2 737 kb/s
Width                                    : 1 920 pixels
Height                                   : 800 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.074
Stream size                              : 2.37 GiB (79%)
Writing library                          : x265 3.5+1-f0c1022b6:[Windows][clang 12.0.0][64 bit] 8bit+10bit+12bit
Encoding settings                        : cpuid=1111039 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x800 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=24 / keyint=240 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=5 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=17.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=0 / display-window=0 / master-display=G(34000,16000)B(13250,34500)R(7500,3000)WP(15635,16450)L(10000000,20) / cll=595,494 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.03 / no-opt-cu-delta-qp / no-aq-motion / hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / scenecut-aware-qp=0conformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0 / no-vbv-live-multi-pass
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0020 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 595
MaxCLL_Original                          : 595 cd/m2
Maximum Frame-Average Light Level        : 494
MaxFALL_Original                         : 494 cd/m2

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 2 h 4 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -5 ms
Stream size                              : 568 MiB (19%)
Title                                    : AC3 5.1
Language                                 : German
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 3
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 3 min
Title                                    : Forced
Language                                 : German
Default                                  : Yes
Forced                                   : Yes

Text #2
ID                                       : 4
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 2 h 3 min
Title                                    : Full
Language                                 : German
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : :Chapter 1
00:08:11.950                             : :Chapter 2
00:14:56.604                             : :Chapter 3
00:24:21.377                             : :Chapter 4
00:30:38.670                             : :Chapter 5
00:38:39.651                             : :Chapter 6
00:45:51.958                             : :Chapter 7
00:51:57.990                             : :Chapter 8
00:57:55.263                             : :Chapter 9
01:03:59.085                             : :Chapter 10
01:12:22.588                             : :Chapter 11
01:19:10.496                             : :Chapter 12
01:28:26.885                             : :Chapter 13
01:33:53.169                             : :Chapter 14
01:42:20.134                             : :Chapter 15
01:50:45.556                             : :Chapter 16
01:53:46.111                             : :Chapter 17

User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Could be just a bug in the x265 version used to encode your original file, because the "Mastering display color primaries" line is the same in both file.
The "Encoding settings" sections of media info is some additional informational text that the encoder library writes to the file, the "Mastering display color primaries" is the actual value read in the file.
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Re: Wrong / reversed HDR metadata after conversion?

Post by shad »

Hm, I don't know, not an expert here.

Irritating, that the FastFlix tool writes about the same HDR related values into the encoded file as the source file:

Code: Select all

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L4@Main
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Width                                    : 1 920 pixels
Height                                   : 800 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Writing library                          : x265 3.5+9-bf91444e0:[Windows][GCC 10.2.0][64 bit] 10bit
Encoding settings                        : cpuid=1111039 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x800 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / repeat-headers / annexb / no-aud / no-eob / no-eos / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=5 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=22.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2 / display-window=0 / master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,20) / cll=595,494 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.03 / no-opt-cu-delta-qp / no-aq-motion / hdr10 / hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / scenecut-aware-qp=0conformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0 / no-vbv-live-multi-pass
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0020 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 595 cd/m2
Maximum Frame-Average Light Level        : 494 cd/m2
The same bug in two tools is not very likely, I think.

If you say "Mastering display color primaries" is the important entry, does it mean, that "Display P3" has a pre-defined, fixed set of values for G/B/R/WP/L which is always the same for this value?
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Yes.
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Re: Wrong / reversed HDR metadata after conversion?

Post by shad »

Ok, thanks. I will test with some other files.

Could you please reply to this one, so that I use correct settings next time:
Totally unrelated to your issue, but to encode in HDR you have to disable the filters and select the 10bit version of x265.
Thanks for the hint, must have missed that point in the release notes or so.

I'm not using any filters on my own. I just kept the suggested values for "Interlace Detection = default" and "Deinterlace: Decomb->Default". Do I have to set these two to "Off" like all others as well?
[/quote]
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Yes, disable those two filters too.
I'm rechecking if there is a bug in the master display metadata ordering,
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

Yup there was a bug, fixed in https://github.com/HandBrake/HandBrake/ ... f5ed894269

the good news is that those values are unused by 99.99999999% of the players, and were still correct at the container level.
shad
Posts: 8
Joined: Tue Sep 14, 2021 8:26 am

Re: Wrong / reversed HDR metadata after conversion?

Post by shad »

Great, thanks for the info and the fix!

Are the other differences from my first post of any importance?
chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2
chromaloc=0

max-cll=595,494
cll=595,494

max-luma=1023
max-luma=255

hdr / hdr-opt / no-dhdr10-opt
hdr10 / no-hdr10-opt / no-dhdr10-opt
The 4. part is probably because of me not having used the 10bit encoder, but the others?
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

4k HDR Bluray have a different chroma location, and it's not handled in HandBrake yet, but your file is not 4k, so I have no idea what could be the right value or if it was downscaled correctly.

max-cll, cll, hdr / hdr-opt / no-dhdr10-opt, hdr10 / no-hdr10-opt / no-dhdr10-opt, are different because these options were renamed in newer x265 versions.

max-luma is set automatically by x265, I will check if it will need to be set manually or if the hdr10 option is enough.
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

max-luma is 255 because you are using the 8bit encoder.
User avatar
Rodeo
HandBrake Team
Posts: 12823
Joined: Tue Mar 03, 2009 8:55 pm

Re: Wrong / reversed HDR metadata after conversion?

Post by Rodeo »

Ritsuka wrote: Tue Sep 14, 2021 2:04 pmmax-cll, cll, hdr / hdr-opt / no-dhdr10-opt, hdr10 / no-hdr10-opt / no-dhdr10-opt, are different because these options were renamed in newer x265 versions.
As Ritsuka pointed out, the CLL metadata values are the same, just named differently in different versions of x265 used to encode the source vs. your encode.

max-cll=595,494

cll=595,494

source: hdr / hdr-opt / no-dhdr10-opt
encode: hdr10 / no-hdr10-opt / no-dhdr10-opt

hdr was renamed to hdr10, there is one difference: hdr-opt (== hdr10-opt) -> no-hdr10-opt (== no-hdr-opt), but that's also because:
Ritsuka wrote: Tue Sep 14, 2021 2:07 pm max-luma is 255 because you are using the 8bit encoder.
Which really isn't ideal for HDR, you should really use 10-bit x265 (also available in HandBrake).
User avatar
Rodeo
HandBrake Team
Posts: 12823
Joined: Tue Mar 03, 2009 8:55 pm

Re: Wrong / reversed HDR metadata after conversion?

Post by Rodeo »

It should definitely be possible to preserve/passthrough the chromaloc value, though it may be interesting to better understand what it actually means before making the change.
User avatar
Ritsuka
HandBrake Team
Posts: 1309
Joined: Fri Jan 12, 2007 11:29 am

Re: Wrong / reversed HDR metadata after conversion?

Post by Ritsuka »

User avatar
Rodeo
HandBrake Team
Posts: 12823
Joined: Tue Mar 03, 2009 8:55 pm

Re: Wrong / reversed HDR metadata after conversion?

Post by Rodeo »

You write patches faster than I can even read them :-D
Post Reply