HDR color space irregularities

  • well so demux/mux not working

    Vouk... can you confirm that HDR metadata is still being added to the h265 stream. It obv was in 2.2, and seems it might be, or is, for some users.... but I can't replicate that 2.2 behavior in 2.3 now. Do you think anything changed. The main difference I see is no longer being able to select BT2020CL or BT2020NCL in the main media export Premiere window.

    • Offizieller Beitrag

    Did you do a MediaInfo (https://mediaarea.net/en/MediaInfo) of both files to compare them with each other?

    In my case:

    As Voukoder is using FFmpeg internally, maybe it would be a good idea to create an FFmpeg command line that creates a perfect video from your point of view.

  • well so demux/mux not working

    Vouk... can you confirm that HDR metadata is still being added to the h265 stream. It obv was in 2.2, and seems it might be, or is, for some users.... but I can't replicate that 2.2 behavior in 2.3 now. Do you think anything changed. The main difference I see is no longer being able to select BT2020CL or BT2020NCL in the main media export Premiere window.

    Be careful with how you describe this. With the NVENC process, no "metadata" will be created. Metadata is specifically describing MaxCLL, MaxFALL, and mastering display characteristics. That unfortunately can't be included in NVENC encodes as far as I can tell. But most devices don't actually require this to display HDR video. They just fall back to a default tonemapping algorithm.

    However, mediainfo confirms colorspace, transfer characteristics, and primaries flags are correctly included in the video stream. My TV recognizes these and plays them correctly without modification. Why your TV doesn't is unknown. I would imagine some difference with the container formats. Are you making sure to select 10bit in your encoder settings? (although my TV still recognizes it as HDR even with 8bit as long as those other flags are in there)

    Maybe you can upload a file that worked, and then a file that doesn't, and I can see if I can find anything about them that differ.

  • hey guys thanks for looking at this. Look back at one of my original posts...

    vouk-16.235.bt2020.ncl.mkv (done in 2.2):
    https://drive.google.com/file/…S6JCsuWj/view?usp=sharing

    Premiere native h265 Main10 bt2020 output:
    https://drive.google.com/file/…q41Pxu21/view?usp=sharing

    source mp4 file (trimmed):
    https://drive.google.com/file/…B3oHj9CP/view?usp=sharing

    It is the vouk-16.235.bt2020.ncl.mkv file, as produced by v2.2, that allows HDR on my TV (but the colors are wrong, etc).

    Then here is a file (2020.2020.2020.mkv) encoded w/ 2.3:
    https://drive.google.com/file/…qmJ4TJTc/view?usp=sharing
    This file does not make TV go into HDR mode.

    Mediainfo vouk-16.235.bt2020.ncl.mkv made w/ v2.2:

    ID : 1
    Format : HEVC
    Format/Info : High Efficiency Video Coding
    Format profile : Main 10@L5@High
    Codec ID : V_MPEGH/ISO/HEVC
    Duration : 3 min 2 s
    Bit rate : 41.8 Mb/s
    Width : 3 840 pixels
    Height : 2 160 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 23.976 (24000/1001) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Bits/(Pixel*Frame) : 0.210
    Stream size : 909 MiB (96%)
    Default : Yes
    Forced : No
    Color range : Limited
    Color primaries : BT.2020
    Transfer characteristics : PQ
    Matrix coefficients : BT.2020 non-constant



    MediaInfo 2020.2020.2020.mkv mad with v.2.3:


    ID : 1
    Format : HEVC
    Format/Info : High Efficiency Video Coding
    Format profile : Main 10@L5@High
    Codec ID : V_MPEGH/ISO/HEVC
    Duration : 3 min 51 s
    Bit rate : 34.3 Mb/s
    Width : 3 840 pixels
    Height : 2 160 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 23.976 (24000/1001) FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Bits/(Pixel*Frame) : 0.173
    Stream size : 946 MiB (96%)
    Default : Yes
    Forced : No
    Color range : Limited
    Color primaries : BT.2020
    Transfer characteristics : BT.2020 non-constant
    Matrix coefficients : BT.2020 non-constant

    As you can see they are essentially exactly the same except for "transfer characteristics" which was PQ in v2.2 and now, I guess with setparams filter, it becomes something else.

    I uninstalled v2.3, and reinstalled v2.2. I made two new files...
    using x265...(~14 min encode time fwiw):
    https://drive.google.com/file/d/1xrxrkN…iew?usp=sharing
    using NVENC...(~4 min encode time fwiw):
    https://drive.google.com/file/d/1DhzaF1…iew?usp=sharing

    Testing these, both make TV enter HDR mode. Which is interesting and hard to believe I know. So at least in my case, 2.2 produced HDR outputs my HDR TV recognize but 2.3 does not. And I can't make any of the 2.3-produced files "engage" HDR. It's 100% consistent working in 2.2 and 100% consistent not working in 2.3. For me. I feel like if I could get these 2.3 encodes to engage HDR on the TV I would be close to having good-looking outputs. Doing Lumetri etc in Premiere (HDR encoding guide) will not give me HDR-TV-engagement in 2.3. It will help outputs look good ultimately but won't solve this main issue for me.

    Would be interesting (maybe) if you could add setparams filter to v2.2. Can this be done. I still go back to the fact that BT2020 was selectable in v2.2. (https://i.imgur.com/tvPv6kc.png). Vouk, why can this BT2020 not be selected in main media export dialog in v2.3? Why BT709 only? Why did that change from 2.2 to 2.3 versions?

  • As you can see they are essentially exactly the same except for "transfer characteristics" which was PQ in v2.2 and now, I guess with setparams filter, it becomes something else.

    That's your problem. PQ is what's required for HDR10. With setparams you should set transfer characteristics to SMPTE2084, like this:

    740-setparams-png

    BT2020-10bit is a totally different transfer function, not what your TV expects for HDR. In your earlier post you said it looked bad, but it will look bad if you don't apply my preset to it first. Import and apply the Premiere preset, then encode with the above settings, then test it on the TV.

    • Offizieller Beitrag

    Lets look at the whole processing chain:

    • You'd like to export with yuv420 10bit and hevc_nvenc => using "p010le"
    • Version 2.2 requested the frame data in either:
      • Format: PrPixelFormat_YUV_420_MPEG4_FRAME_PICTURE_PLANAR_8u_709 (bt709 selected)
        Input: bt709
        Output: bt709 or bt2020
      • Format: PrPixelFormat_YUV_420_MPEG4_FRAME_PICTURE_PLANAR_8u_601 (all other selections)
        Input: smpte170m
        Output: smpte170m
        • 1. Issue: It requested 8bit and converted it up to 10bit
        • 2. Issue: It used bt601 and converted it to bt2020
    • Version 2.3 changed this behaviour to:
      • Format: PrPixelFormat_VUYX_4444_32f (BT601 selected)
        Input: bt601
        Output: unspecified (or set by setparams / colorspace)
      • Format: PrPixelFormat_VUYX_4444_32f_709 (all other selections)
        Input: bt709
        Output: unspecified (or set by setparams / colorspace)
    • Premiere will render in 32bit float
    • Connector converts it to yuv444 (16 bit)
    • FFmpeg converts it to p010le

    So it's more or less clear why this is not working:

    1. Using 32bit float is a good (but slower) decision because we are downscaling, not upscaling.
    2. I somehow need to get the information what PrPixelFormat_VUYX_4444_32f means. Is it bt601? Or does it depend on the source? How to identify this? And what is the color range?

    I have to admit the 10bit (and higher) modes really need improvement.

    But all changes need to be done in the connector, not in the voukoder itself. It is about how to get the right information from Premiere.

  • That's your problem. PQ is what's required for HDR10. With setparams you should set transfer characteristics to SMPTE2084, like this:

    740-setparams-png

    BT2020-10bit is a totally different transfer function, not what your TV expects for HDR. In your earlier post you said it looked bad, but it will look bad if you don't apply my preset to it first. Import and apply the Premiere preset, then encode with the above settings, then test it on the TV.

    In 2.2, PQ is not selectable. The encode just comes out that way. In 2.3, I set the settings just like you showed for another file I previously provided a link to...
    2020.2084.2020.mkv:
    https://drive.google.com/file/d/1t5zjJe…iew?usp=sharing
    And still no HDR-detectability by TV.

    Re: HDR encoding guide, here is monitor with the Lumetri presets you provide:
    https://i.imgur.com/ZjRO5fV.jpg
    And here is what it is "supposed" to roughly look like:
    https://i.imgur.com/QPMnHsA.jpg

    And here is output file sample using BT2020/SMPTE2084/BT2020NC:
    (the link is coming! will update in a minute....)
    Using your guide, the output is ULTRA-dark, almost unwatchable; this is what we might guess it would be just from the monitor view in Premiere. For me for whatever reason your HDR encoding guide is the worst I have seen so far in terms of outputs. Try it on the source file I originally linked to.

    Einmal editiert, zuletzt von scarbrtj (6. Dezember 2019 um 15:27)

    • Version 2.3 changed this behaviour to:
      • Format: PrPixelFormat_VUYX_4444_32f (BT601 selected)
        Input: bt601
        Output: unspecified (or set by setparams / colorspace)
      • Format: PrPixelFormat_VUYX_4444_32f_709 (all other selections)
        Input: bt709
        Output: unspecified (or set by setparams / colorspace)

    Dumb question:
    Can we not have

  • The monitor SHOULD look dark/incorrect. It's pre-processing the output in SMPTE2084/BT2020, which your monitor is not displaying in. If you displayed it on an HDR monitor, in HDR mode, it would look correct. Since your TV is not displaying it correctly, what are you watching it with? It's very likely your player is not processing the HDR signal, an is therefore just showing you an image similar to the premiere monitor window. What does it look like if you re-import it back into premiere without my preset applied?

    I'll test your video and see what I get.

  • I just realized something from your screenshot. Are you using Premiere 2020? I created and tested my preset in 2019, and that's what I'm still using for now. It's possible 2020 is handling HDR input differently than 2019 did. For example, 2019 doesn't map black levels correctly on HDR inputs, as it expected a full range video and got limited range instead, and so my preset had to correct for that as well. So if 2020 is handling HDR input differently, I'd need to create a different preset for 2020. If you happen to have a copy of 2019 still, I'd see if it's working there.

  • I just realized something from your screenshot. Are you using Premiere 2020? I created and tested my preset in 2019, and that's what I'm still using for now. It's possible 2020 is handling HDR input differently than 2019 did. For example, 2019 doesn't map black levels correctly on HDR inputs, as it expected a full range video and got limited range instead, and so my preset had to correct for that as well. So if 2020 is handling HDR input differently, I'd need to create a different preset for 2020. If you happen to have a copy of 2019 still, I'd see if it's working there.

    yes I am using Premiere 2020, the latest version, just upgraded a couple weeks ago. Re: the "other" Lumetri you saw which I had added, it was empty/doing nothing. Only your two were active.

    Your monitor is def showing the footage w/Lumetri correction a lot brighter/visible than mine (I understand it prob would look darker; mine is just REALLY dark w/your correction). Maybe the difference is Premiere 2020??? If so... I'm worn out! I don't wanna change and downgrade lol. And as mentioned, for whatever reason, it's essentially impossible (I am too dumb) for me to get Voukoder v2.3 to give me an output my HDR TV recognizes as HDR right now.

  • That would seem to be... problematic for sure.

    It's not. It doesn't matter what pixel format is being sent by Premiere, it only matters that the RGB/YUV values are correct for what your encoder expects based on the flags. Hence this whole preset I've been working on. It works fine in 2019, but I need to create a new one for 2020 it seems.

  • I just tested in 2020 and my preset still works correctly. Not sure what's going on with your end. Try redownloading the preset as I do see the preset is named differently in your screenshots and mine. Perhaps you grabbed an older version of it before I reuploaded. I don't remember exactly what I changed before I reuploaded, but I did change something.

    Nevermind, found the issue

    2 Mal editiert, zuletzt von morphinapg (6. Dezember 2019 um 22:00)

  • Never mind the previous post. I found the issue and created a new preset for Premiere 2020. Use this and then try encoding to HDR.

    Remember, the output window will look desaturated and darker, but that's because it is transformed into a format that your display is not set up to preview correctly. It should however be in the correct format for 2020/2084 output.

    and now maybe I can get a little bit of sleep today (lol)