Nvidia's NVENC hardware H.264 video encoder

MPlatform's encoding pack - Encoder lib - now features built-in encoding via NVENC, Nvidia's truly hardware H.264 video encoder based on a semiconductor intellectual property (SIP) core. This codec is now also available as one of the add-ons for MFormats SDK.

Today there are 3 options for H.264 encoding based on a SIP core: Intel's Quick Sync Video, AMD's Video Codec Engine and Nvidia's NVENC. Quick Sync support has been available in MPlatform since version; AMD support is on the roadmap (but not under high priority as of this moment).

NVENC is available with the latest generation of Nvidia's GPUs - those based on Kepler and Maxwell architectures. Previously, Nvidia's hardware encoding was based on CUDA, which used both the CPU and the GPU for video encoding (taking away the processing power of both units). NVENC uses a dedicated H.264 encoding chip, so most of the processing power of the GPU is available for other tasks (read the H.264 encoding options post for performance tests).

Since version 340.52 of Nvidia's drivers CUDA is disabled and replaced with NVENC. It is still possible to use CUDA via the old drivers with MPlatform SDK, but we don't recommend doing so - it's best to upgrade to NVENC.

NVENC support is available in MPlatform SDK starting with version This feature requires valid licenses for both MPlatform SDK and Encoder lib (see prices).

Download MPlatform SDK

Supported H.264 profiles

The first generation of NVENC (Kepler-based GPUs) supports H.264 high-profile (YUV420, I/P/B frames, CAVLC/CABAC), H.264 SVC Temporal Encode VCE and Display Encode Mode (DEM). The second generation (Maxwell-based GPUs), also supports HiP444 profile (YUV4:4:4, predictive lossless encoding).

Nvidia models with NVENC support

The following product lines have NVENC on board:

  • NVIDIA GeForce
  • NVIDIA Quadro K4000 and above
  • NVIDIA Tesla K10 and above

According to NVENC specs there is a limit for number of simultaneous encoding threads. GeForce cards are limited by 2 streams and Quadro are limited by 6 streams. It means that you are unable to start 3 MWriter objects with NVENC encoding at the same time on a single machine if it has GeForce graphic card.

Using NVENC with MWriter

NVENC is available via the MWriter object in MPlatform SDK. The NVENC encoder's ID is "n264". You can begin encoding immediately with the use of the Writer sample.

Choose "H.264" and then choose "NVidia NVEnc H.264 Encoder" from the list of available options:

If you can't find it there, please see the Troubleshooting section below. Otherwise, you are ready to start encoding:

Troubleshooting: NVENC is not found in the list of encoding options

If your computer is equipped with an Nvidia card with NVENC, but you don't see this encoder as available for MWriter, please check the following:

1. Make sure that you have the latest version of Nvidia's drivers installed. You can download the latest drivers at Nvidia's web site.

2. If this doesn't help, then you probably need to change your default GPU to Nvidia. Open NVIDIA Control Panel and go to Manage 3D Settings. You can configure NVENC either globally or for selected applications.

  • To enable NVENC for all applications, open the Global Settings tab and select "High-performance NVIDIA processor" in the Preferred graphics processor dropdown menu:

  • To enable NVENC for a specific application, go to the Program Settings tab, click the Add button and locate "MServer.exe" on your computer (you will find it here: "...\Program Files (x86)\Medialooks\MPlatform\Bin\x86\MServer.exe"). Then also choose "High-performance NVIDIA processor" in the Preferred graphics processor drop-down menu:

Some motherboards won't allow switching from an integrated to an external graphics card. In this case, use a third-party application, such as VIRTU MVP 2.0.

See also: