14 Replies Latest reply on Apr 17, 2017 6:38 PM by Zac Lam Branched to a new discussion.

    HDR video export...

    jeffr68402967 Level 1

      How do I get Premiere to give me high range pixels out of ->RenderVideoFrame() ?  I have selected the PrPixelFormat_BGRA_4444_32f pixel format, so I assumed I would get pixels with values above 1.0f (using some high color depth Red files).  Is there another flag I need somewhere?



        • 1. Re: HDR video export...
          jeffr68402967 Level 1

          Hello, hello...?

          • 2. Re: HDR video export...
            Bruce Bullis Adobe Employee

            Is "Me" an Exporter plug-in?

            • 3. Re: HDR video export...
              jeffr68402967 Level 1

              Yes, of course.

              • 4. Re: HDR video export...
                Zac Lam Adobe Employee

                Hi Jeff,


                Have you confirmed that you are getting PrPixelFormat_BGRA_4444_32f frames in the PPixHand returned from your RenderVideoFrame() call?  If you are not, you may also include PrPixelFormat_BGRX_4444_32f in the request, which is the same as BGRA but without an alpha channel, which is the case for RED files.


                Also, to make sure you're getting values above 1.0f, you could apply a ProcAmp effect and crank up the brightness.





                • 5. Re: HDR video export...
                  jeffr68402967 Level 1

                  I've tried both PrPixelFormat_BGRA_4444_32f and PrPixelFormat_BGRA_4444_32f_linear.  I'm getting all of the pixels from the RED files - I'm just not getting HDR values (values above 1.0f).  Does Premiere normalize the files when it imports them?  Is there a flag to say that I want large pixel values (larger than 1.0f).  Are only certain import file types imported as HDR files? Is there an HDR video file that you know exports as HDR that I can test with?

                  • 6. Re: HDR video export...
                    jeffr68402967 Level 1

                    I guess my point here is that - since you use PrPixelFormat_BGRA_4444_32f for normal SDR output (when you decode to normal video files) and that gets scaled down to SDR range, how does Premiere even know to send me HDR pixels??  You know?  It seem like there has to be an additional flag or just using the normal output export pipeline wouldn't work.

                    • 7. Re: HDR video export...
                      Zac Lam Adobe Employee

                      I believe this is what you're looking for: Try setting exQueryOutputSettingsRec.outUseMaximumRenderPrecision to kPrTrue / non-zero.

                      • 8. Re: HDR video export...
                        jeffr68402967 Level 1

                        > exQueryOutputSettingsRec.outUseMaximumRenderPrecision


                        That's already set to true - and it's set to true in your SDR example, so that can't be the HDR setting, right?


                        Can't we just ask the HDR team instead randomly trying stuff?  Obviously, there is a way to get HDR pixels, since the OpenEXR exporter works.  Can we make a heavier request for answers?

                        • 9. Re: HDR video export...
                          Zac Lam Adobe Employee

                          A search on outUseMaximumRenderPrecision doesn't yield any results in the SDK_Exporter code.  Where do you see it?


                          Also, feel free to check out the code for the OpenEXR plug-ins here:


                          • 10. Re: HDR video export...
                            jeffr68402967 Level 1

                            Sorry, it's in my plugin, but not the SDR example (which is weird, since I just copied).  Anyway, that flag doesn't work, regardless.


                            I still always get 0.0 to 1.0f no matter what input file type.  I expect 0.0 to 125.0 (10K nits), which is what I get if I read the openexr file directly...

                            • 11. Re: HDR video export...
                              jeffr68402967 Level 1

                              I suppose you could be storing everything 0.0 to 1.0 *always*, and then leaving the max as open to interpretation.  Is there a way to ask for the input file maxLuma or however it was imported initially?

                              • 12. Re: HDR video export...
                                Zac Lam Adobe Employee

                                I'm seeing greater than 1.0 values using the SDK_Exporter from the CC 2017 SDK with the following modifications in SDK_File.cpp:

                                Line 520 set to: pixelFormats[0] = PrPixelFormat_BGRA_4444_32f;

                                Line 1099 replace with:

                                if (pixelFormat == PrPixelFormat_VUYA_4444_32f ||

                                    pixelFormat == PrPixelFormat_BGRA_4444_32f)

                                Set breakpoint on 1202.

                                Create a project with footage, apply ProcAmp, increase brightness to 100 (so everything is pushed to overbrights).  Export.


                                The result in the debugger is I see values like this:

                                +   tempSrcBuffer    0x00000000987e0080 {1.18431377}    float *
                                   *(tempSrcBuffer + 1)    1.18248522    float
                                   *(tempSrcBuffer + 2)    1.19046533    float
                                   *(tempSrcBuffer + 3)    1.00000000    float


                                Although the code is not going to treat them as RGB floats (it is written for YUV), these are the RGB values coming in greater than 1.0.


                                So it looks like setting exQueryOutputSettingsRec.outUseMaximumRenderPrecision is unnecessary, and my original response in step 4 is sufficient.

                                • 13. Re: HDR video export...
                                  jeffr68402967 Level 1

                                  Can you try it with HDR source material?  I'll test with ProcAmp, but that's less important than returning the right values for imported files.  Grab any HDR file off here: Demo UHD-3D - Ultra-HD / 4K / HDR / 3D   They are HDR BT.2020, 10-bit input files - none ever give me more than 0..1.0 - and I should be getting 0..125.0.


                                  The values should be WAY higher than 1.0, not just a little...

                                  • 14. Re: HDR video export...
                                    Zac Lam Adobe Employee

                                    Hi Jeff,


                                    While the pipeline supports HDR, not every importer plug-in supports HDR.  Recently we added support for JPEG2000 MXF and HEVC with PQ curve, and before that we supported OpenEXR, CinemaDNG, and assorted RAW formats.  Perhaps you could find some OpenEXR footage to use as your source material.