First, we should note that 10-bit videos may be SDR, but all HDR videos are 10-bit (at least). So, only part of this article is valid for 10-bit SDR video, the main focus is on 10-bit HDR video.
HDR files decoding and processing
To enable HDR/10-bit processing, you should enable the GPU-pipeline:
MFFactoryClass myFactory = new MFFactoryClass();
myFactory.PropsSet("gpu_pipeline", "true");The HDR/10-bit support requires some extra properties. You can enable them in the system registry:
MPlatform
HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile\MFileFFM
decoder.nvidia = true
HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile
output.10bit = trueMFormats
HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFReader
decoder.nvidia = true
output.10bit = trueAll the properties can be specified at the moment of initialization of a file. Note that for video conversion, you should use r210 eMFCC type to keep 10-bit video pixel format.
Previewing HDR videos (using libplacebo vfilter)
Libplacebo video filter provides high-quality GPU-accelerated video processing for color space conversion (e.g., HDR to SDR). It supports many HDR features, and the features such as:
- High-quality scaling (e.g., EWA Lanczos, spline)
- Advanced color management and tone mapping
- Debanding, dithering, and other post-processing
- HDR to SDR conversion and color space transformations
Please note that vfilters are available for MFormats objects starting from version 2.10.0.14414.
Below is a screenshot demonstrating one of the video filter in action with the following configuration:
m_objFile.PropsSet("object::vfilter", "libplacebo=format=gbrpf32le:color_trc=linear:tonemapping=mobius:tonemapping_param=0.4:colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv,format=yuv420p");More information about other vfilters is written in this article → https://support.medialooks.com/hc/en-us/articles/360021057932-Video-filters
Input/output 10-bit with BMD
If you have HDR/10-bit BMD source, enable the following property:
Computer\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFLive\BMD
bmd.10bit = trueFor outputting HDR/10-bit via BMD card, enable this property:
Computer\HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MRenderer
output.10bit = trueEncoding HDR metadata using Nvidia HEVC
Starting with the 2.10.0 version of the SDK, you can record HDR metadata using N265 (Nvidia HEVC) as an encoder.
First, make sure all necessary settings are made for the source (BMD SDI or HDR file) and GPU-pipeline is enabled. Also, enable the following MWriter property:
Computer\HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MWriter
mfcodecs.gpu_frame_encoding = trueThen you can encode the HDR file with the config like this:
format='mov' video::codec='n265' video::b='10M' video::output.10bit='true' audio::codec='aac'