October 20, 2016

NVidia NVENC settings in Nimble Streamer Live Transcoder

NVidia® Products with the Kepler, Maxwell and Pascal generation GPUs contain a dedicated accelerator for video encoding, called NVENC, on the GPU die.

NVENCODE API enables software developers to configure this dedicated hardware video encoder. This dedicated accelerator encodes video at higher speeds and power efficiency than CUDA-based or CPU-based encoders at equivalent quality. NVENCODE API allows the programmer to control various settings of the encoder to set the desired tradeoff between quality and performance.

Nimble Streamer Live Transcoder has full support for NVidia video encoding and decoding hardware acceleration. Having the hardware capable of the processing and drivers properly installed, our customer can choose NVENC to handle streams' encoding.

You can take a look at the list of NVidia GPUs capable of hardware encoding acceleration. To make HW acceleration work, you need to install the graphic card drivers into the system. Use this link to download and install them.

If you haven't yet installed Nimble Streamer transcoder, use this page to find proper setup instruction.

The transcoding scenarios are created using our excellent web UI. You can check this YouTube playlist to see how various use cases are defined. Takes just couple of minutes to complete.

Scenarios setup page
Part of ABR scenario setup example

To set up NVENC settings you need to open encoder settings dialog and choose "nvenc" as the Encoder.

After that you can add various parameters and set up specific values to tune up your encoding process. Please find full list of available encoding parameters below.


Specifies H.264 preset.

  • hp - high performance
  • default - tradeoff between performance and quality
  • hq - high quality
  • llhp - low latency high performance
  • ll   - default low latency preset and the quality and speed is midway of the two other presets
  • llhq - low latency high quality
  • lossless - default lossless preset
  • losslesshp - lossless high performance
  • bd - blueray disk? NV_ENC_PRESET_BD_GUID


Specifies H.264 profile.

  • baseline
  • main
  • high
  • high444


Specifies H.264 profile level.

  • 1
  • 1.0
  • 1b
  • 1.1
  • 1.2
  • 1.3
  • 2
  • 2.1
  • 2.2
  • 3
  • 3.1
  • 3.2
  • 4
  • 4.0
  • 4.1
  • 4.2
  • 5
  • 5.1


Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on.

If you set it to "auto" then transcoder will choose the least busy GPU.


Number of pictures within the current GOP (Group of Pictures).

  • 1 - only I-frames are used


Specifies maximum number of B frames between non-B-frames.

  • 0 - no B-frames
  • 1 - IBP
  • 2 - IBBP


Specifies the DPB size used for encoding.
Setting it to 0 will let driver use the default dpb size. The low latency application which wants to invalidate reference frame as an error resilience tool is recommended to use a large DPB size so that the encoder can keep old reference frames which can be used if recent frames are invalidated.

fps_n, fps_d

Set output FPS numerator and denominator. It only affects num_units_in_tick and time_scale fields in SPS.
If fps_n=30 and fps_d=1 then it's 30 FPS
If fps_n=60000 and fps_d=2002 then it's 29.97 FPS
Source stream FPS or filter FPS is used if fps_n and fps_d are not set.
Please also check Handling fuzzy FPS to get proper bitrate output article.


Sets bitrate type.

  • cqp - Constant QP mode
  • vbr - Variable bitrate mode
  • cbr - Constant bitrate mode
  • vbr_minqp - ariable bitrate mode with MinQP
  • ll_2pass_quality - Multi pass encoding optimized for image quality and works only with low latency mode
  • ll_2pass_size - Multi pass encoding optimized for maintaining frame size and works only with low latency mode
  • vbr_2pass - Multi pass VBR


Sets bitrate in Kbps.


Sets max bitrate in Kbps.


Specifies the VBV(HRD) initial delay in Kbits.

  • 0 - use the default VBV initial delay


Specifies the VBV(HRD) buffer size in Kbits.

  • 0 - use the default VBV buffer size

qpi, qpp, qpb

Specifies the initial QP to be used for encoding, these values would be used for all frames if in CQP mode.


Specifies the minimum QP used for rate control


Specifies the maximum QP used for rate control


Specifies the initial QP used for rate control


Target Constant Quality level for VBR mode (range 0-51 with 0-automatic);


Enable lossless encode as following: sets QP to 0 and RC_mode to NV_ENC_PARAMS_RC_CONSTQP and profile to HIGH_444_PREDICTIVE_PROFILE.

  • 0 - disable
  • 1 - enable


If your input stream is anamorphic you might need to save its SAR parameter in the output as well, especially if you’re using a 'scale' filter in your Transcoder pipeline while DAR = SAR x Width / Height. Nimble supports keeping input SAR using keep-sar parameter set to true for encoder in its ‘Video output’ section. SAR/DAR/PAR correlation is described in this article.


  • 0 - disable
  • 1 - enable


Specifies the frame/field mode.



Specifies the desired motion vector prediction precision.



Enable Spatial adaptive quantization

  • 0 - disable
  • 1 - enable


Specifies AQ strength.
AQ strength scale is from 1 (low) - 15 (aggressive).


Specifies Temporal adaptive quantization

  • 0 - disable
  • 1 - enable


Set to enable to minimize GOP-to-GOP rate fluctuations

  • 0 - disable
  • 1 - enable


Enable lookahead with depth <lookaheadDepth>;


Maximum depth of lookahead with range 0-32 (only used if enableLookahead=1)


Disable adaptive I-frame insertion at scene cuts (only has an effect when lookahead is enabled).

  • 0 - none
  • 1 - disable adaptive I-frame insertion


Disable adaptive B-frame decision (only has an effect when lookahead is enabled)

  • 0 - none
  • 1 - Disable adaptive B-frame decision


Enable intra refresh. If the GOP structure uses B frames this will be ignored

  • 0 - disable
  • 1 - enable


Interval between successive intra refresh.


Length of intra refresh in number of frames for periodic intra refresh. This value should be smaller than intraRefreshPeriod.


Set this to 1 to enable constrainedFrame encoding where each slice in the constarined picture is independent of other slices


Set 1 to enable constrained intra prediction.


Set to 1 to enable 4:4:4 separate colour planes


Specifies the deblocking filter mode. Permissible value range : [0, 2]


Specifies the AdaptiveTransform Mode

  • auto - Adaptive Transform 8x8 mode is auto selected by the encoder driver
  • disable - Adaptive Transform 8x8 mode disabled
  • enable - ptive Transform 8x8 mode should be used


Specified the FMO Mode

  • auto - FMO usage is auto selected by the encoder driver
  • enable - Enable FMO
  • disable -Disble FMO


Specifies the BDirect mode

  • auto - BDirect mode is auto selected by the encoder driver
  • disable - Disable BDirect mode
  • temporal - Temporal BDirect mode
  • spatial - Spatial BDirect mode


Specifies the entropy coding mode

  • auto - Entropy coding mode is auto selected by the encoder driver
  • cabac - Entropy coding mode is CABAC
  • cavlc - Entropy coding mode is CAVLC


Specifies the way in which the picture is divided into slices.

  • 0 - MB based slices,
  • 1 - Byte based slices,
  • 2 - MB row based slices,
  • 3 - numSlices in Picture

When sliceMode == 0 and sliceModeData == 0 whole picture will be coded with one slice


Specifies the sliceMode parameter.

  • sliceMode=0, sliceModeData specifies # of MBs in each slice(except last slice)
  • sliceMode=1, sliceModeData specifies maximum # of bytes in each slice(except last slice)
  • sliceMode=2, sliceModeData specifies # of MB rows in each slice(except last slice)
  • sliceMode=3, sliceModeData specifies number of slices in the picture. Driver will divide picture into slices optimally;

These are the parameters which you can use already in order to control NVidia video encoding hardware acceleration. Live Transcoder also supports NVidia hardware decoding.

To improve your NVENC transcoding experience, please also take a look at Transcoder troubleshooting covering most frequent questions.

Zabbix monitoring of Nimble Streamer allows tracking server status, SRT streams and NVidia GPU status.

We keep improving our transcoder feature set, contact us for any questions.

Related documentation

NVIDIA, the NVIDIA logo and CUDA are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and/or other countries. 

No comments:

Post a Comment

If you face any specific issue or want to ask some question to our team,

This will give much faster and precise response.
Thank you.

Note: Only a member of this blog may post a comment.