Nvenc & HDR10

Hi,

We have been using nvenc to generate a video stream out of our vulkan based application (we went for nvenc solution because Vulkan Video extension wasn’t available at that time).

We based our implementation on the Cuda interop sample, and that works great.

However, we have implemented support for HDR rendering in our engine, so we would like to generate a HDR HEVC stream in that case.

I’ve modified the code according to the documentation (SDK 13):
encConfig.encodeCodecConfig.hevcConfig.inputBitDepth = NV_ENC_BIT_DEPTH_10;
encConfig.encodeCodecConfig.hevcConfig.outputBitDepth = NV_ENC_BIT_DEPTH_10;

encConfig.profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;

eNVFormat = NV_ENC_BUFFER_FORMAT_ABGR10;

Our HDR pipeline relies on RGBA16f, however, we convert that into a ABGR10 through a custom shader. I assumed we had to convert the colorspace (linear/rec.709 to rec.2020/st2084) but that doesn’t seems to give correct results.

I’m not completely sure how to progress.

Is the 10-bits video format a HDR format, or simply a 10-bits normalized format ? What colour space should be used ?

Thanks for any help, I’m quite confused at the moment!

I found my problem, there were a few additional options that had to be enabled:

encConfig.encodeCodecConfig.hevcConfig.inputBitDepth = NV_ENC_BIT_DEPTH_10;
encConfig.encodeCodecConfig.hevcConfig.outputBitDepth = NV_ENC_BIT_DEPTH_10;

encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoSignalTypePresentFlag = 1;
encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFormat = NV_ENC_VUI_VIDEO_FORMAT_UNSPECIFIED;
encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag = 0;
encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourDescriptionPresentFlag = 1;
encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourPrimaries = NV_ENC_VUI_COLOR_PRIMARIES_BT2020;
encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.transferCharacteristics = NV_ENC_VUI_TRANSFER_CHARACTERISTIC_SMPTE2084;
encConfig.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourMatrix = NV_ENC_VUI_MATRIX_COEFFS_BT2020_NCL;

encConfig.profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;