Nvenc driver 470

Hello, I’m using Ubuntu 22.04 and driver 470 (GT 740 2G GDDR5). This card uses Nvenc 1. I’m using Nvenc for video rendering in Kdenlive 21.12.3.

By default, Nvenc in Kdenlive is set to a Preset: Medium and B Frames: 1.

While rendering, I noticed that the encoder was at 100% usage and the CPU at 30%. I changed the preset to Fast, and now the encoder is at 50% usage and the CPU at 60% for video rendering. I don’t know if I’m sacrificing quality by doing this.

I know there are two settings: Preset P1-P7 and Preset: Low, Medium, Fast… I don’t know how they relate to each other, and I don’t have the option for P1-P7.

My goal is to adjust correctly for performance and quality.

Looking at this article, I conclude that :

preset: (‘P1’, ‘P2’, ‘P3’, ‘P4’, ‘P5’, ‘P6’, ‘P7’), is equivalent (‘default’, ‘slow’, ‘medium’, ‘fast’, ‘hp’, ‘hq’, ‘bd’, ‘ll’, ‘llhq’, ‘llhp’) . default=medium

Other sources (ffmpeg):

P1 = Fastest or Ultrafast

P2 = Faster or Superfast or Veryfast

P3 = Fast

P4 = Medium

P5 = Slow

P6 = Slower

P7 = Slowest

Some of these options are not supported due to encoder/decoder limitations and higher video resolutions.

I ran some quality tests and Nvenc-1 performed better than I expected.

I downloaded two movie trailers to make comparison with VMAF

1) First video it was H.264 and 25fps - 15Kbps (331MB) - MP4 (Reference)

Using H.264.lib on Medium and Slower resulted in very little difference (0.2%) in VMAF.

  • H.264.lib Slower- 8634bps - VBR (188 MB) = 93.65 VMAF
  • H.264.lib Slower- 3625bps - VBR (82 MB) = 89.57 VMAF
  • H.264.HVENC Medium - 8342bps - VBR (180 MB) = 93.71 VMAF
  • H.264.HVENC Medium - 4028bps - VBR (89 MB) = 90.18 VMAF
  • H.264.HVENC Faster - 8701bps - VBR (188MB) = 93.18 VMAF
  • H.264.HVENC Faster - 3653bps - VBR (81 MB) = 87.75 VMAF

2) Second video it was H.265 10 Bits and 25fps -40Kbps (1.3 GB) - MKV. Converted to H.264 and 30fps - 42Kbps (950 MB) - MP4, using H264.lib Slower (Reference)

  • H.264.HVENC Medium - 45903bps - VBR (974 MB) = 96.83 VMAF
  • H.264.HVENC Medium - 8463bps - VBR (183 MB) = 92.28 VMAF
  • H264.HVENC Medium -3276bps - VBR (74 MB) = 88.42 VMAF
  • H.264.HVENC Faster -8871bps - VBR (191 MB) = 91.73 VMAF
  • H.264.HVENC Faster -3793bps - VBR (84 MB) = 87.26 VMAF