H.265 HDR

  • First of all, thank you a lot for this great plugin.

    Now, to my question. I'm trying to create some H.265 files to use in calibrating my projector. Ideally, I'm trying to produce SDR and HDR versions of the file in 4:2:2 and 4:2:0 chroma subsampling.

    The only color spaces available are BT.601 and 709. I'm no expert on this, but, I presume it should be possible to do 709 HDR, but in most discussions I've seen on detecting HDR people are checking BT.2020, that it's at least 10 bit, and the transfer function of something like PQ or HLG, and to select HDR in the normal HEVC exporter, you first have to select BT.2020.

    So, is HDR a feature you've not implemented yet?

  • As far as i know (and i am a programmer, not an encoding expert):

    - bt.601 is used for SD

    - bt.709 is used for HD

    - bt.2020 is used for UHD

    This color space / ranges topic is very complicated to me because i can't just tell premiere "Give me all pixel data in yuv422, 10bit and bt.2020". I am still not sure the current implementation for bt.601 and bt.709 works correct.

    Maybe someone else has some theoretical insight in this.

  • bt.2020 is a wide colour gamut.

    HDR metadata requires a transfer function like PQ or HDR10 which both use SMPTE ST 2084, or HLG (more complex, as it's per-scene), a bit depth of at least 10 bit and a colour space of bt.2020.

    Maybe a short cut would be if you allowed us add our own encoder parameters?

  • I have uncompressed pixel data as 16bit YUVA 4444 available. Can you tell me a ffmpeg command line to encode it the way you want it? This would help me to implement it.

  • I too am looking for HDR support for encoding videos in bt.2020 (HDR) format.

    CPU encoding takes way too long since HDR videos usually require higher bitrate (>100mpbs for 4k video).

    Please enable HDR support so that we can use this wonderful plugin to encode HDR videos in Premiere Pro CC (2017).

    I will search for ffmpeg commands to see if I can get an example for encoding HDR video in the meantime.

  • Vouk

    Added the Label Done
  • Vouk

    Added the Label 2.0
  • HDR displays are still a niche, so HDR content is not the big slice of the cake now. But some time in the near future HDR displays will become popular (also with lower prices) and it will increase the need of HDR content.

    Creating content in HDR fills that gap, and maybe it's not mainstream at this moment, but I'm sure it will be. So being one of the first that make this possible can place your plugin in a real advantage, usefull even for the own Adobe company.

    I'm sure that a lot of content creators as myself will be proud to test that feature :)

    Keep on doing a great job!

  • I just came across this plugin looking for ways to export HDR video from premiere. I'd like to add that HDR is more than just color space. In x265 I would need to include these commands to specify metadata values, which also triggers the correct HDR output settings as well:

    --max-cll "4000,250" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,0)"

    That represents content that has a MaxCLL of 4000 nits, and a MaxFALL of 250, with a mastering display defined at 4000 nits.

    I was trying to use x265vfw to output this but I get error compiling movie with that one, which is why I went googling and found this plugin. It would be nice to be able to simply include command line options like that for any features the encoder doesn't currently support, the way the x264vfw and x265vfw encoders do (I bypass the avi output and output directly to mp4 with those)

    Note that premiere does have native HDR editing which allows values greater than 100 nits in the editor, but it's also possible to work on an unprocessed 10bit HDR capture (I have an external HDR monitor which can handle that data so this is useful to me), so it would be nice to be able to export either way. The above x265 command would assume the raw 10bit source (which looks like a washed out image with wrong gamma when displayed on a non-HDR monitor). I couldn't say how natively edited HDR content gets sent to the exporter, so I don't know if there would be something different about how you'd set that up either.

  • I'm also fairly new to doing this so I only know x265 for now. I did finally get it working through x265vfw after originally having some errors in premiere. I used direct HEVC track output instead of MP4 in the x265 settings. I don't embed it in the AVI because I eventually intent to remux with my audio to MP4/MKV/M2TS depending on what I'm doing with it.

    I don't know if all of these are necessary or not, but these are the final settings I used to encode an HDR compatible file (verified working in both HDR youtube and native on my TV):

    --max-cll "4000,250" --master-display "G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(40000000,0)" --colorprim bt2020 --colormatrix bt2020nc --transfer smpte2084 --output-depth 10 --uhd-bd

    These are x265 cli arguments, so I don't know how libx265 might differ

    I had to change the --master-display RGB values to match BT2020. In the earlier post I had DCI-P3 values, which youtube didn't like when I uploaded it.

    the --max-cll values and at least the final parameter in the --master-display value will vary depending on the content, so ideally the user should be able to enter these such as:

    MaxCLL: 4000

    MaxFALL: 250

    Mastering Display Maximum Nits: 4000
    Mastering Display Minimum Nits: 0

    You could also use the common values if users don't enter them. I often see people use MaxCLL 1000 MaxFALL 400, with the mastering display as 1000/0.005, although ideally people would want to enter these correctly to ensure the image tonemaps properly on different displays.


    These are also assuming you have the source in its flat ST2084 source, which is what I've been using (it looks like viewing something at the wrong gamma, low contrast, etc). Premiere likely outputs this in the same range of values it does for standard rec709 content, just in a higher bit depth precision.

    Premiere also has a native HDR implementation, and I don't know how that data is sent to the exporter though. If standard data is exported as 0.0-1.0 floating point, I would imagine the native HDR implementation would expand into the above 1.0 space, up to 100.0 for 10,000 nits. If that's the case, I believe you would need to make sure to map these to the correct range of input values based on the ST2084 transfer function before applying the above settings.

    I don't know for sure whether premiere would be able to signal to you whether the native HDR functionality is being used at all or not. It's possible premiere may not even be able to know for sure, since even regular color grading could unintentionally extend into that HDR range. So you may need to include an option asking whether the input is raw preformatted ST2084 values, or whether they need to be reformatted first.

    Sorry if this is all really confusing. I know HDR is a very different beast from regular encoding.

  • for x265 you also need --chromaloc 2 for bt2020 color

    so if you could add x265 pass though commands for:

    --colorprim --transfer --colormatrix --range --chromaloc --max-cll --master-display

    thats should be good for HDR metadata

    if you could also please add x265 pass through for:

    --aud --sar --hrd --repeat-headers

    that would enable bluray and UHD-bluray compatible encoding -now that 2pass is an option.

    For HDR using NVENC, it would be similar SEI/metadata settings:

    videoformat range colorprim transfer colormatrix max-cll master-display