10-bit processing, HDR color conversion and HDR metadata are separate requirements. A 10-bit source can be SDR. Enabling 10-bit output preserves precision where supported, but does not by itself convert SDR pictures to HDR.
HDR files decoding and processing
For the GPU processing workflow described here, enable the GPU pipeline before creating and opening the media objects. This initialization fragment uses an application-owned MFFactoryClass from the appropriate SDK namespace:
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
video.color_range = full
HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile
output.10bit = trueOr define these props in FileNameSet method:
m_objFile.FileNameSet(inputPath, "decoder.nvidia=true output.10bit=true");MFormats
HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFReader
decoder.nvidia = true
output.10bit = trueOr define these props in ReaderOpen method:
m_objFile.ReaderOpen(inputPath, "decoder.nvidia=true output.10bit=true");The application retrieves frames through SourceFrameGet*, processes them and passes them to consumers through ReceiverFramePut. Release every retrieved or newly created frame in a finally block after its consumers have used it. Stop the frame loop before closing the reader and consumers, then release their COM objects.
Nvidia decoding requires compatible hardware, drivers and input formats. It is a decoder choice, not an HDR color-conversion switch.
All 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.
Decoder output controls
The following configurable controls belong to the Nvidia decoder output-selection family. Supply them as source-open options. The preservation controls default to false on MFile and MFReader; the force controls are unset by default. Hardware and codec capabilities still apply.
| Option | Type | Meaning on the Nvidia path |
|---|---|---|
output.10bit |
Boolean | Preserve higher bit depth when the decoded input has it. |
output.422 |
Boolean | Preserve 4:2:2 output when the decoded input is 4:2:2. |
output.444 |
Boolean | Preserve 4:4:4 output when the decoded input is 4:4:4. |
output.force_10bit |
Optional Boolean | Override the bit-depth selection made from the input and output.10bit. |
output.force_422 |
Optional Boolean | Override the 4:2:2 selection. |
output.force_444 |
Optional Boolean | Override the 4:4:4 selection. The decoder checks 4:2:2 selection first. |
These options select an output representation. Forcing a higher bit depth does not restore lost precision or perform SDR-to-HDR conversion.
When requesting a pixel-format conversion, choose a format that retains the required precision. eMFCC_r210 is packed 10-bit RGB; eMFCC_v210 is packed 10-bit YUV 4:2:2. Support depends on the conversion and downstream processing path; selecting either format does not guarantee that every subsequent operation retains 10-bit precision.
Color range
video.color_range overrides the range assigned to source frames. The file decoder used by MFile and MFReader, and the current Blackmagic capture integration used by MLive and MFLive, recognize the following values:
| Value | Aliases | Meaning |
|---|---|---|
full |
jpeg, pc
|
Assign full-range interpretation. |
limited |
mpeg, tv
|
Assign limited-range interpretation. |
An empty value leaves the detected range unchanged. This setting changes range information attached to a frame; it is not a tone-mapping operation. Do not force full merely because a source is HDR. Match the actual source range.
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
Mixing SDR and HDR sources
MMixer does not automatically convert SDR and HDR sources into a common HDR color space. When the composite is interpreted as HDR, unconverted SDR regions may appear excessively bright or saturated.
As a workaround, apply a libplacebo filter with inverse tone mapping to the SDR source before mixing. This prepares its pixel values for HDR output and can compensate for the incorrect appearance caused by interpreting SDR values using the composite’s HDR color signaling.
MPlatform: MMixer
Keep the GPU pipeline and the required 10-bit processing settings enabled. Apply the correction through object::vfilter on the SDR source before opening it and adding it to MMixer:
String SDRFilter = "libplacebo=colorspace=bt2020nc:color_primaries=bt2020:color_trc=arib-std-b67:range=tv:inverse_tonemapping=true";
m_objFile_SDR.PropsSet("decoder.nvidia", "true");
m_objFile_SDR.PropsSet("output.10bit", "true");
m_objFile_SDR.PropsSet("object::vfilter", SDRFilter);
m_objFile_SDR.FileNameSet(PathToSDRFile, "");
m_objMixer.StreamsAdd("SDR", m_objFile_SDR, "", "", out MItem SDRItem, 0.0d);The example prepares the SDR source for BT.2020/HLG output with limited range:
| Parameter | Purpose |
|---|---|
colorspace=bt2020nc |
Selects the BT.2020 non-constant-luminance matrix. |
color_primaries=bt2020 |
Selects BT.2020 output primaries. |
color_trc=arib-std-b67 |
Selects the HLG transfer function. |
range=tv |
Selects limited video range. |
inverse_tonemapping=true |
Enables expansion of SDR content into the HDR output range. |
Match the filter’s target to the intended HDR output and the other sources. For a PQ workflow, use color_trc=smpte2084 instead of color_trc=arib-std-b67, and validate the resulting brightness and colors on the intended receiver.
Apply this correction to the SDR input before composition. Applying it to the complete mixer output would also process the HDR regions. An HDR source that already matches the chosen output format can retain its existing processing path.
Keep 10-bit precision through the remaining pipeline, including an appropriate SDK conversion format such as r210.
MFormats: frame composition
Apply the same libplacebo correction to the SDR frames through MFXMediaConverter before passing them to MFOverlay or MFOverlayRect. Configure the filter using video::xmedia_conversion_props and av_filter_graph_desc_in, following the MFormats video-filter workflow.
Overlaying SDR and HDR frames alone does not perform the required color conversion.
Checking the result
The appropriate filter settings depend on the source material, target transfer function, SDR white level, and receiver. Check brightness, saturation, neutral grays, and highlights in both source regions on the actual HDR output.
Also verify output precision and color signaling. A restored HDR flag confirms signaling, but does not establish that the complete composition has correct colors and luminance.
Input/output 10-bit with BMD
If you have HDR/10-bit BMD source, enable the following properties:
Computer\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFLive\BMD
bmd.10bit = true
video.color_range = fullFor 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'The configurable string property video.color_range overrides the range assigned to source frames. It is available on the MFile, MFReader, and the current Blackmagic capture integration used by MLive and MFLive. Possible values: full and limited.
Still have questions?
Tell us what didn’t work or what you’d like clarified.