MPlatform and MFormats can use NVIDIA NVDEC, Intel Quick Sync and AMD AMF for video decoding. Availability depends on your SDK package and license, the installed codec backend, the graphics hardware and its driver. NVIDIA, Quick Sync and AMD acceleration are disabled in the reader's component defaults; registry settings and application parameters can override those defaults.
Usually, these decoders are used for H.264 video, but if your hardware supports it, you can also decode H.265 or even AV1 (using NVDEC, starting with SDK version 2.8.0).
Enabling a decoder requests its use. It does not guarantee hardware decoding for every input. The codec, profile, bit depth and resolution must be supported. The current decoder selection path can proceed to FFmpeg when an NVIDIA or Quick Sync candidate is unavailable or rejects the stream; this does not guarantee recovery from every error after decoding starts.
Configure decoding before opening the source
Pass decoder settings in the second argument of MFile.FileNameSet in MPlatform or MFReader.ReaderOpen in MFormats. The opening strings use the unprefixed names shown below. Decoder initialization reads these settings, so reopen the source when changing them.
The following table covers the decoder switches and output settings used in this article. Defaults are component defaults before registry or application overrides. All entries in this table are configurable.
| Property | Type and default | Meaning and scope |
|---|---|---|
decoder.nvidia |
Boolean; false
|
Enable NVIDIA NVDEC as a decoder candidate for the source. |
decoder.nvidia.normalize_sps |
Boolean; false
|
Opt in to the H.264 SPS compatibility processing described below. Requires NVIDIA decoding and a build containing this option. |
decoder.quicksync |
Enable switch; disabled by default (0). Use true or false. |
Enable Intel Quick Sync. In the current codec backend, this is not a numeric memory-mode selector. |
decoder.amd |
Boolean; false
|
Request an AMD AMF decoder through the FFmpeg decoding path when available. |
experimental.mfcodecs |
Boolean; true
|
Select the current codec backend. The SPS examples explicitly enable this backend. |
output.10bit |
Boolean; false
|
Request higher-bit-depth output from a suitable source and decoder. This does not guarantee that every downstream component preserves that bit depth. |
gpu_pipeline |
Boolean; false
|
A factory setting, not a source-opening parameter. Controls the GPU processing pipeline and influences decoder output-memory selection. Configure it before creating dependent SDK objects. |
Using NVIDIA NVDEC
Check your graphics card's decoding capabilities in NVIDIA's documentation and install a suitable driver. The current NVIDIA backend includes H.264, H.265/HEVC and AV1 decoding paths, but actual support depends on the card and stream format.
These C# fragments assume that pathToFile contains the input path and that myFile or myReader is an application-owned SDK object. They show source initialization, not a complete player.
MPlatform:
myFile.FileNameSet(pathToFile,
"decoder.nvidia=true decoder.quicksync=false decoder.amd=false");
myFile.FilePlayStart();MPlatform produces frames through its connected-object pipeline. Configure the preview, renderer or other receiver as required by your application before playback. When finished, stop the pipeline, close the file with ObjectClose(), and release application-owned COM references after their users have stopped.
MFormats:
myReader.ReaderOpen(pathToFile,
"decoder.nvidia=true decoder.quicksync=false decoder.amd=false");MFormats uses an application-owned frame loop: retrieve frames with SourceFrameGet or the appropriate time/frame-number method, pass them to receivers, and release each returned frame in a finally block. Stop and join that loop before calling ReaderClose() and releasing the reader's COM reference.
H.264 SPS normalization
Some H.264 streams contain contradictory sequence parameter set (SPS) information. For example, a stream can declare Constrained Baseline and zero frame-reordering depth while containing B-frames. Such input may play differently with CPU and NVIDIA decoders, including missing frames or incorrect presentation order.
decoder.nvidia.normalize_sps=true enables optional compatibility processing before the compressed data reaches the NVIDIA parser. It adjusts supported Baseline/Main SPS declarations using the B-frame delay reported by stream analysis. This can include changing a contradictory Baseline declaration to Main and increasing insufficient reordering and buffering declarations.
Normalization operates on an in-memory copy prepared for decoding. It does not re-encode the video or rewrite the source file. It is limited to H.264 Baseline/Main input with positive B-frame-delay information; unsupported or unparseable SPS data is passed through unchanged. It is not a general repair option for damaged video and does not apply to HEVC or AV1.
Enable it together with NVIDIA decoding before opening the source:
MPlatform:
myFile.FileNameSet(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=true " +
"decoder.nvidia.normalize_sps=true " +
"decoder.quicksync=false decoder.amd=false");
myFile.FilePlayStart();MFormats:
myReader.ReaderOpen(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=true " +
"decoder.nvidia.normalize_sps=true " +
"decoder.quicksync=false decoder.amd=false");The option defaults to false. Confirm that your installed SDK package includes it; the first released version must be confirmed for your package. Enable it for affected inputs and compare the resulting picture and presentation timing with software decoding.
Check which decoder was selected
Read decoder information after initialization and decoding have begun. A successful open call or a read-back of decoder.nvidia=true alone does not establish which decoder is active.
| SDK | Property read with PropsGet | Meaning |
|---|---|---|
| MFormats | info::hw_acceleration |
Read-only diagnostic string identifying the selected NVIDIA or Quick Sync acceleration path. |
| MPlatform | file::ffm::info::hw_acceleration |
The corresponding read-only information from the active file reader. |
// MPlatform: after playback has initialized the file reader.
myFile.PropsGet("file::ffm::info::hw_acceleration",
out string platformAcceleration);
// MFormats: after opening and retrieving decoded frames.
myReader.PropsGet("info::hw_acceleration",
out string formatsAcceleration);NVIDIA identification contains NVidia NVDec; Quick Sync identification contains Intel QuickSync. An empty value does not prove acceleration. These diagnostics identify the selected path; also check decoded frames and timing when investigating playback quality. This field is not an AMD AMF confirmation mechanism.
Registry defaults
For application-wide defaults, use the registry locations below. Values are loaded during component initialization, so set them before starting the application or creating SDK objects. Opening parameters can override the corresponding source settings.
| SDK | Registry key | Source settings |
|---|---|---|
| MPlatform | HKEY_CURRENT_USER\SOFTWARE\Medialooks\MPlatform\MFile\MFileFFM |
decoder.nvidia, decoder.nvidia.normalize_sps, decoder.quicksync, decoder.amd and experimental.mfcodecs
|
| MFormats | HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFReader |
The same source settings |
For example, set decoder.nvidia=true in the appropriate key to request NVIDIA decoding by default. Prefer opening parameters for SPS normalization when only particular inputs need it.
10-bit video decoding
For a GPU-pipeline NVDEC workflow that preserves higher-bit-depth source video, enable the factory GPU pipeline and request 10-bit output. The input must actually contain higher-bit-depth video, and the GPU and driver must support that codec, profile and output format. The settings cannot recover precision absent from an 8-bit source.
| Applies to | Registry key | Setting |
|---|---|---|
| Both SDKs | HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFFactory |
gpu_pipeline=true |
| MPlatform | HKEY_CURRENT_USER\SOFTWARE\Medialooks\MPlatform\MFile |
output.10bit=true |
| MFormats | HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFReader |
output.10bit=true |
Also set experimental.mfcodecs=true and decoder.nvidia=true in the source registry key listed above. Alternatively, after configuring the factory before object creation, request the source settings when opening:
MPlatform:
myFile.FileNameSet(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=true output.10bit=true");
myFile.FilePlayStart();MFormats:
myReader.ReaderOpen(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=true output.10bit=true");Check the actual decoded-frame format and the formats accepted by subsequent processors and receivers. NVIDIA decoder creation can fall back to an 8-bit output surface when a requested higher-bit-depth surface cannot be created, and later conversion can also reduce bit depth. The settings alone therefore do not prove an end-to-end 10-bit result.
Using Intel Quick Sync
Use an Intel graphics device and driver that support decoding the input codec and profile. A processor family name alone does not establish those capabilities.
MPlatform:
myFile.FileNameSet(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=false " +
"decoder.quicksync=true decoder.amd=false");
myFile.FilePlayStart();MFormats:
myReader.ReaderOpen(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=false " +
"decoder.quicksync=true decoder.amd=false");In the current backend, decoder.quicksync enables or disables Quick Sync. Numeric values must not be used as selectors for hardware/system-memory, hardware/video-memory or software modes. The initial memory path follows the factory's gpu_pipeline setting:
| Factory setting | Initial Quick Sync path |
|---|---|
gpu_pipeline=false |
Hardware decoding with system-memory output. |
gpu_pipeline=true |
Hardware decoding using a Direct3D memory path, subject to initialization support and fallback. |
Read the selected decoder diagnostic to distinguish the actual path, such as HW-SYS, HW-DX11, HW-DX9 or SW. To request Quick Sync by default, set decoder.quicksync=true in the appropriate source registry key.
Using AMD AMF
decoder.amd=true requests an AMF decoder through FFmpeg (available since SDK version 2.11.1). The implementation selects AMF decoder names for H.264, HEVC, VP9 and AV1; availability still depends on the installed SDK/FFmpeg package, AMD hardware and driver. An AMF request alone does not confirm hardware decoding.
MPlatform:
myFile.FileNameSet(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=false " +
"decoder.quicksync=false decoder.amd=true");
myFile.FilePlayStart();MFormats:
myReader.ReaderOpen(pathToFile,
"experimental.mfcodecs=true decoder.nvidia=false " +
"decoder.quicksync=false decoder.amd=true");To request AMF by default, set decoder.amd=true in the appropriate source registry key. The same source, frame and COM cleanup obligations described above apply to these fragments.
Still have questions?
Tell us what didn’t work or what you’d like clarified.