Enabling HDR processing
Since the 2.1.0 version of the SDK, you can play HDR videos with GPU-powered decoding and processing 10bits data.
For this, you should enable the GPU-pipeline to make frame rate and video conversion fast:
MFFactoryClass myFactory = new MFFactoryClass();
myFactory.PropsSet("gpu_pipeline", "true");
The HDR support is implemented for NVIDIA decoder only and requires some extra properties.
You can enable them in the system registry:
MPlatform
HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile\MFileFFM
decoder.nvidia = true
experimental.mfcodecs = true
HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile
output.10bit = true
MFormats
HKEY_CURRENT_USER\Software\Medialooks\MFormats\MReader
decoder.nvidia = true
experimental.mfcodecs = true
output.10bit = true
All the properties can be specified at the moment of initialization of a file:
myReader.ReaderOpen(pathToFile,
"decoder.nvidia = true experimental.mfcodecs = true output.10bit = true");
myFile.FileNameSet(pathToFile,
"decoder.nvidia = true experimental.mfcodecs = true output.10bit = true")
Note that for video conversion, you should use r210 eMFCC type to keep the video processed by GPU.
Using Libplacebo vfilter for color space conversion (e.g., HDR to SDR)
Libplacebo vfilter provides high-quality GPU-accelerated video processing. 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 only for MPlatform objects.
Below is a screenshot demonstrating the video filter in action with the following configuration:
libplacebo=format=gbrpf32le:color_trc=linear:tonemapping=mobius:tonemapping_param=0.4:colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv:format=yuv420p
Here are a table of Libplacebo Usage Examples:
Advanced Tone Mapping with Gamma Adjustment
object::vfilter="libplacebo=tone_map=bt2390:gamma=2.2"
Applies bt2390 tone mapping with a gamma adjustment of 2.2, suitable for HDR-to-SDR conversion on
screens with a slightly higher gamma level.
Adaptive Sharpening with Dynamic Range
object::vfilter="libplacebo=sharpen=2.0:range=limited"
Applies strong sharpening (2.0) with a limited dynamic range, ideal for enhancing detail without excessive
contrast in SDR footage.
Noise Reduction with Temporal Smoothing
object::vfilter="libplacebo=denoise=0.8:spatial=0.5:temporal=0.3"
Reduces noise with both spatial (0.5) and temporal (0.3) components for smoother, clearer images while
keeping some fine details.
Debanding for Gradient Smoothing
object::vfilter="libplacebo=deband=0.6"
Smooths out color banding with a debanding strength of 0.6, especially useful for compressing gradients in sky scenes or dark areas.
Applying a BT2020 Color Gamut Conversion
object::vfilter="libplacebo=colorspace=bt2020:trc=smpte2084:primaries=bt2020"
Converts colorspace to BT2020 with SMPTE 2084 transfer characteristics, maintaining high dynamic range
color details.
Enhanced Dithering for Bandwidth-Limited Output
object::vfilter="libplacebo=dither=1.0"
Adds dithering to simulate higher bit-depth on lower bit-depth displays, reducing color banding while keeping detail.
Custom Brightness and Contrast
object::vfilter="libplacebo=brightness=0.1:contrast=1.2"
Adjusts brightness by +0.1 and contrast by 1.2, enhancing image vibrancy without overexposing highlights.
HDR Conversion with Custom White Point
object::vfilter="libplacebo=hdr=on:whitepoint=6500"
Enables HDR processing with a white point of 6500K (daylight balance), ensuring that whites remain true
across different lighting conditions.
Applying Soft Light Filter for a Cinematic Look
object::vfilter="libplacebo=softlight=0.7"
Adds a soft light effect with a strength of 0.7 for a gentle glow, enhancing shadows and midtones in a
cinematic style.
Custom Saturation and Vibrance Boost
object::vfilter="libplacebo=saturation=1.5:vibrance=1.3"
Boosts color saturation and vibrance, intensifying colors for a vivid and dynamic image.
HDR Peak Adjustment for Highlight Preservation
object::vfilter="libplacebo=peak_detect=1.0:peak=1000"
Enables peak detection with a target of 1000 nits, ensuring that highlights are preserved without clipping in HDR displays.
Using a Custom Transfer Function (Hybrid Log-Gamma)
object::vfilter="libplacebo=trc=hlg"
Applies the Hybrid Log-Gamma (HLG) transfer function, commonly used in live HDR broadcasts for wider
dynamic range in real-time content.
Color Temperature Adjustment
object::vfilter="libplacebo=colortemp=5500"
Adjusts the color temperature to 5500K, creating a cooler tone for daylight scenes or correcting for warm
indoor lighting.
Perceptual Deblocking Filter
object::vfilter="libplacebo=deblock=1.0"
Applies a perceptual deblocking filter to reduce block artifacts, particularly useful for highly compressed or low-bitrate videos.
More information about other vfilters is writen in this article → https://support.medialooks.com/hc/en-us/articles/360021057932-Video-filters