By default, all media files in our tools are decoded in software-only mode: your CPU will be used, which is not the best solution in some scenarios. MPlatform's Decoder Lib and the Expert edition of MFormats SDK offer the following options for GPU-powered decoding: Nvidia's NVDEC, Intel's Quick Sync and AMD's AMF Decoder.
Usually, these decoders are used for H.264 video, but if your hardware supports it, you can decode H.265 or even AV1 (using NVDEC, since 2.8.0 SDK version) video as well.
Once enabled, decoder tries to open any video. And if it fails using GPU, it falls back to software mode.
Using Nvidia NVDEC
To find out whether your NVIDIA graphics card supports H.264, H.265 or AV1 hardware decoding, please check the chipset model of your card and refer to Nvidia's documentation. Always make sure that you use the latest drivers for your graphics board.
To decode a file with NVDEC, specify the 'decoder.nvidia' property on file initialization:
In MPlatform SDK:
myFile.FileNameSet(pathToFile, "decoder.nvidia = true");In MFormats SDK:
myReader.ReaderOpen(pathToFile, "decoder.nvidia = true");In this case, every file you open with that method is decoded with the NVIDIA GPU decoder.
You can enable the NVDEC decoder by default for all files via the following setting in the registry:
In MPlatform SDK:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MPlatform\MFile\MFileFFM
decoder.nvidia = trueIn MFormats SDK:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFReader
decoder.nvidia = true10-bit video decoding
With the newest SDK release, it's possible to get the true 10-bit video. To get the 10-bit decoding we need to turn on these properties:
In MPlatform SDK:
\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFFactory
gpu_pipeline = true
\HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile
output.10bit = true
\HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile\MFileFFM
experimental.mfcodecs = true
\HKEY_CURRENT_USER\Software\Medialooks\MPlatform\MFile\MFileFFM
decoder.nvidia = trueIn MFormats SDK:
\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFFactory
gpu_pipeline = true
\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFReader
output.10bit = true
\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFReader
experimental.mfcodecs = true
\HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFReader
decoder.nvidia = trueUsing Intel Quick Sync
Your Intel processor supports Quick Sync decoding if it is equipped with Intel HD Graphics 4200 or higher. Note, that for all XEON processors a mainboard with C226 chipset is required.
To decode a file with Quick Sync, specify the 'decoder.quicksync' property on file initialization:
In MPlatform SDK:
myFile.FileNameSet(pathToFile, "decoder.quicksync = true");In MFormats SDK:
myReader.ReaderOpen(pathToFile, "decoder.quicksync = true");Just like with NVDEC, in this case, the Quick Sync decoder will be used for each file opened via this method.
To enable Quick Sync by default for all files, use the following registry settings:
In MPlatform SDK:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MPlatform\MFile\MFileFFM
decoder.quicksync = trueIn MFormats SDK:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFReader
decoder.quicksync = truePossible values for the "decoder.quicksync":
- 0 - disabled
- 1 - QuickSync(HW, system memory)
- 2 - QuickSync(HW, video memory) - experimental mode
- 3 - QuickSync(SW) - experimental mode
Using AMD AMF
Since the SDK version 2.11.1, it's possible to use AMD AMF decoder.
To decode a file with it, specify the 'decoder.amd' property on file initialization:
In MPlatform SDK:
myFile.FileNameSet(pathToFile, "decoder.amd = true");In MFormats SDK:
myReader.ReaderOpen(pathToFile, "decoder.amd = true");In this case, the AMF decoder will be used for each file opened via this method.
To enable AMF by default for all files, use the following registry settings:
In MPlatform SDK:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MPlatform\MFile\MFileFFM
decoder.amd = trueIn MFormats SDK:
HKEY_CURRENT_USER\SOFTWARE\Medialooks\MFormats\MFReader
decoder.amd = true