Low performance with NVenc

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
nikkoaki
Posts: 14
Joined: Wed Mar 06, 2024 1:20 pm

Low performance with NVenc

Post by nikkoaki »

Description of problem or question:
Was re-encoding some videos from my current phone and noticed that NVenc wasn't giving me much faster encoding speeds compared to x265. Was getting around 20-30 fps when i usually get more than 100fps at the same settings with other 4K videos.
I tried other 4K videos from my old phone and those ones encode pretty fast. They have a lower bit rate so i matched the bit rate on my "new" phone but the slow speeds persisted. Only thing i see that it's different is the color profile.
Both CPU and GPU video encoding graphs don't even reach 50% in task manager, with the videos from the "new" phone where they both reach 100% with videos from the old one.
Also noticed that i have to change the deinterlace method to off from decomb or the speed tanks even more (this affects both phones). The videos are progressive. Is it supposed to be like that?



Steps to reproduce the problem (If Applicable):
Encode input video with NVenc h265, medium preset, 5000 ABR, no audio, peak frame rate, output resolution same as input



HandBrake version (e.g., 1.0.0):
1.7.3



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Win 10 22H2 x64



HandBrake Activity Log ***required*** (see How-to get an activity log)

Encode from a video from the old phone where i get 100+ FPS

Code: Select all

HandBrake 1.7.3 (2024030500)
OS: Microsoft Windows NT 10.0.19045.0
CPU: AMD Ryzen 7 3700X 8-Core Processor             
Ram: 16310 MB, 
GPU Information:
  NVIDIA GeForce RTX 2060 SUPER - 31.0.15.3623
Screen: 2048x1152
Temp Dir: C:\Users\Miguel\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake\
Data Dir: C:\Users\Miguel\AppData\Roaming\HandBrake

-------------------------------------------

 # Starting Encode ...

[17:02:59] base preset: Medium FullHD x265 (Modified)
[17:02:59] Remote Process started with Process ID: 15820 using port: 8037. Max Allowed Instances: 1
[17:02:59] Worker: Starting HandBrake Engine ...
[17:02:59] Worker: Parent Process Id 10384
[17:02:59] Worker: Starting Web Server on port 8037 ...
[17:02:59] Worker: Starting Listener: 1
[17:02:59] Worker: Server Started
[17:02:59] Worker: Disconnected worker monitoring enabled!
[17:02:59] Compile-time hardening features are enabled
[17:02:59] nvenc: version 12.1 is available
[17:02:59] nvdec: is not compiled into this build
[17:03:00] CUDA Version: 7.5
[17:03:00] vcn: not available on this system
[17:03:00] qsv: not available on this system
[17:03:00] hb_init: starting libhb thread
[17:03:00] Starting work at: Sat Mar 09 17:03:00 2024
[17:03:00] 1 job(s) to process
[17:03:00] json job:
{
  "Audio": {
    "AudioList": [],
    "CopyMask": [
      "copy:aac"
    ],
    "FallbackEncoder": "av_aac"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": true,
    "File": "C:\\Users\\Miguel\\Desktop\\Output\\Aquaris X-1.mp4",
    "Options": {
      "IpodAtom": false,
      "Optimize": false
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 19,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "2160",
          "width": "3840"
        }
      },
      {
        "ID": 10,
        "Settings": {
          "mode": "2",
          "rate": "27000000/900000"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "C:\\Users\\Miguel\\Desktop\\aquaris X.mp4",
    "HWDecode": 4
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "nvenc_h265",
    "Level": "auto",
    "Bitrate": 5000,
    "MultiPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "medium",
    "Profile": "auto",
    "QSV": {
      "Decode": false
    },
    "HardwareDecode": 4
  }
}
[17:03:00] CPU: AMD Ryzen 7 3700X 8-Core Processor
[17:03:00]  - logical processor count: 16
[17:03:00] Intel Quick Sync Video support: no
[17:03:00] hb_scan: path=C:\Users\Miguel\Desktop\aquaris X.mp4, title_index=1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Miguel\Desktop\aquaris X.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2021-05-12T11:49:14.000000Z
    location        : +39.8010-008.2019/
    location-eng    : +39.8010-008.2019/
    com.android.version: 8.1.0
  Duration: 00:01:13.56, start: 0.000000, bitrate: 35577 kb/s
  Stream #0:0[0x1](eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, smpte170m), 3840x2160, 35408 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 30 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2021-05-12T11:49:14.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2021-05-12T11:49:14.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
[17:03:00] scan: decoding previews for title 1
[17:03:00] scan: audio 0x1: aac, rate=44100Hz, bitrate=189816 English (AAC LC, 2.0 ch, 189 kbps)
[17:03:01] scan: 10 previews, 3840x2160, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 9-1-9, chroma location: left
[17:03:02] libhb: scan thread found 1 valid title(s)
[17:03:02] Skipping subtitle scan.  No suitable subtitle tracks.
[17:03:02] Starting Task: Encoding Pass
[17:03:02] work: skipping crop/scale filter
[17:03:02] work: only 1 chapter, disabling chapter markers
[17:03:02] job configuration:
[17:03:02]  * source
[17:03:02]    + C:\Users\Miguel\Desktop\aquaris X.mp4
[17:03:02]    + title 1, chapter(s) 1 to 1
[17:03:02]    + container: mov,mp4,m4a,3gp,3g2,mj2
[17:03:02]    + data rate: 35577 kbps
[17:03:02]  * destination
[17:03:02]    + C:\Users\Miguel\Desktop\Output\Aquaris X-1.mp4
[17:03:02]    + container: MPEG-4 (libavformat)
[17:03:02]      + align initial A/V stream timestamps
[17:03:02]  * video track
[17:03:02]    + decoder: hevc 8-bit (yuv420p)
[17:03:02]      + bitrate 35408 kbps
[17:03:02]    + filter
[17:03:02]      + Framerate Shaper (mode=2:rate=27000000/900000)
[17:03:02]        + frame rate: 29.970 fps -> peak rate limited to 30.000 fps
[17:03:02]    + Output geometry
[17:03:02]      + storage dimensions: 3840 x 2160
[17:03:02]      + pixel aspect ratio: 1 : 1
[17:03:02]      + display dimensions: 3840 x 2160
[17:03:02]    + encoder: H.265 (NVEnc)
[17:03:02]      + preset:  medium
[17:03:02]      + profile: auto
[17:03:02]      + level:   auto
[17:03:02]      + bitrate: 5000 kbps, pass: 0
[17:03:02]      + color profile: 9-1-9
[17:03:02]      + chroma location: left
[17:03:02] sync: expecting 2204 video frames
[17:03:02] encavcodecInit: H.265 (Nvidia NVENC)
[17:03:02] encavcodec: encoding at rc=vbr, Bitrate 5000
[17:03:02] encavcodec: encoding with stored aspect 1/1
[17:03:02] sync: first pts video is 0
[17:03:02] sync: "Chapter 1" (1) at frame 1 time 0
[17:03:22] reader: done. 1 scr changes
[17:03:23] work: average encoding speed for job is 106.515152 fps
[17:03:23] vfr: 2198 frames output, 0 dropped and 0 duped for CFR/PFR
[17:03:23] vfr: lost time: 0 (0 frames)
[17:03:23] vfr: gained time: 0 (0 frames) (0 not accounted for)
[17:03:23] hevc-decoder done: 2198 frames, 0 decoder errors
[17:03:23] sync: got 2198 frames, 2204 expected
[17:03:23] sync: framerate min 14.980 fps, max 44.978 fps, avg 29.966 fps
[17:03:23] mux: track 0, 2198 frames, 50130064 bytes, 5465.76 kbps, fifo 1024
[17:03:23] Finished work at: Sat Mar 09 17:03:23 2024
[17:03:23] libhb: work result = 0

 # Job Completed!



Encode from the "new" phone with low FPS

Code: Select all

HandBrake 1.7.3 (2024030500)
OS: Microsoft Windows NT 10.0.19045.0
CPU: AMD Ryzen 7 3700X 8-Core Processor             
Ram: 16310 MB, 
GPU Information:
  NVIDIA GeForce RTX 2060 SUPER - 31.0.15.3623
Screen: 2048x1152
Temp Dir: C:\Users\Miguel\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake\
Data Dir: C:\Users\Miguel\AppData\Roaming\HandBrake

-------------------------------------------

 # Starting Encode ...

[17:19:50] base preset: Medium FullHD x265 (Modified)
[17:19:50] Remote Process started with Process ID: 8604 using port: 8037. Max Allowed Instances: 1
[17:19:50] Worker: Starting HandBrake Engine ...
[17:19:50] Worker: Parent Process Id 10384
[17:19:50] Worker: Starting Web Server on port 8037 ...
[17:19:50] Worker: Starting Listener: 1
[17:19:50] Worker: Server Started
[17:19:51] Worker: Disconnected worker monitoring enabled!
[17:19:51] Compile-time hardening features are enabled
[17:19:51] nvenc: version 12.1 is available
[17:19:51] nvdec: is not compiled into this build
[17:19:51] CUDA Version: 7.5
[17:19:51] vcn: not available on this system
[17:19:51] qsv: not available on this system
[17:19:51] hb_init: starting libhb thread
[17:19:51] Starting work at: Sat Mar 09 17:19:51 2024
[17:19:51] 1 job(s) to process
[17:19:51] json job:
{
  "Audio": {
    "AudioList": [],
    "CopyMask": [
      "copy:aac"
    ],
    "FallbackEncoder": "av_aac"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": true,
    "File": "C:\\Users\\Miguel\\Desktop\\Output\\Nothing Phone-1.mp4",
    "Options": {
      "IpodAtom": false,
      "Optimize": false
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 19,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "2160",
          "width": "3840"
        }
      },
      {
        "ID": 10,
        "Settings": {
          "mode": "2",
          "rate": "27000000/900000"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "C:\\Users\\Miguel\\Desktop\\nothing phone.mp4",
    "HWDecode": 4
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "nvenc_h265",
    "Level": "auto",
    "Bitrate": 5000,
    "MultiPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "medium",
    "Profile": "auto",
    "QSV": {
      "Decode": false
    },
    "HardwareDecode": 4
  }
}
[17:19:51] CPU: AMD Ryzen 7 3700X 8-Core Processor
[17:19:51]  - logical processor count: 16
[17:19:51] Intel Quick Sync Video support: no
[17:19:51] hb_scan: path=C:\Users\Miguel\Desktop\nothing phone.mp4, title_index=1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Miguel\Desktop\nothing phone.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2024-03-09T16:47:14.000000Z
    location        : +38.6760-009.1639/
    location-eng    : +38.6760-009.1639/
    com.android.version: 14
  Duration: 00:00:20.59, start: 0.000000, bitrate: 60203 kb/s
  Stream #0:0[0x1](eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt470bg/bt470bg/smpte170m), 3840x2160, 59950 kb/s, 30.11 fps, 30 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2024-03-09T16:47:14.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      creation_time   : 2024-03-09T16:47:14.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
[17:19:51] scan: decoding previews for title 1
[17:19:51] scan: audio 0x1: aac, rate=48000Hz, bitrate=96127 English (AAC LC, 2.0 ch, 96 kbps)
[17:19:53] scan: 10 previews, 3840x2160, 30.108 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[17:19:53] libhb: scan thread found 1 valid title(s)
[17:19:53] Skipping subtitle scan.  No suitable subtitle tracks.
[17:19:53] Starting Task: Encoding Pass
[17:19:53] work: skipping crop/scale filter
[17:19:53] work: only 1 chapter, disabling chapter markers
[17:19:53] job configuration:
[17:19:53]  * source
[17:19:53]    + C:\Users\Miguel\Desktop\nothing phone.mp4
[17:19:53]    + title 1, chapter(s) 1 to 1
[17:19:53]    + container: mov,mp4,m4a,3gp,3g2,mj2
[17:19:53]    + data rate: 60203 kbps
[17:19:53]  * destination
[17:19:53]    + C:\Users\Miguel\Desktop\Output\Nothing Phone-1.mp4
[17:19:53]    + container: MPEG-4 (libavformat)
[17:19:53]      + align initial A/V stream timestamps
[17:19:53]  * video track
[17:19:53]    + decoder: hevc 8-bit (yuv420p)
[17:19:53]      + bitrate 59950 kbps
[17:19:53]    + filter
[17:19:53]      + Framerate Shaper (mode=2:rate=27000000/900000)
[17:19:53]        + frame rate: 30.108 fps -> peak rate limited to 30.000 fps
[17:19:53]    + Output geometry
[17:19:53]      + storage dimensions: 3840 x 2160
[17:19:53]      + pixel aspect ratio: 1 : 1
[17:19:53]      + display dimensions: 3840 x 2160
[17:19:53]    + encoder: H.265 (NVEnc)
[17:19:53]      + preset:  medium
[17:19:53]      + profile: auto
[17:19:53]      + level:   auto
[17:19:53]      + bitrate: 5000 kbps, pass: 0
[17:19:53]      + color profile: 1-1-1
[17:19:53]      + chroma location: left
[17:19:53] sync: expecting 619 video frames
[17:19:53] encavcodecInit: H.265 (Nvidia NVENC)
[17:19:53] encavcodec: encoding at rc=vbr, Bitrate 5000
[17:19:53] encavcodec: encoding with stored aspect 1/1
[17:19:55] sync: first pts video is 0
[17:19:55] sync: "Chapter 1" (1) at frame 1 time 0
[17:20:18] reader: done. 1 scr changes
[17:20:19] work: average encoding speed for job is 24.924217 fps
[17:20:19] vfr: 618 frames output, 2 dropped and 0 duped for CFR/PFR
[17:20:19] vfr: lost time: 0 (0 frames)
[17:20:19] vfr: gained time: 0 (0 frames) (0 not accounted for)
[17:20:19] hevc-decoder done: 620 frames, 0 decoder errors
[17:20:19] sync: got 620 frames, 619 expected
[17:20:19] sync: framerate min 30.108 fps, max 30.108 fps, avg 30.108 fps
[17:20:19] mux: track 0, 618 frames, 14287686 bytes, 5539.65 kbps, fifo 512
[17:20:19] Finished work at: Sat Mar 09 17:20:19 2024
[17:20:19] libhb: work result = 0

 # Job Completed!
mduell
Veteran User
Posts: 8207
Joined: Sat Apr 21, 2007 8:54 pm

Re: Low performance with NVenc

Post by mduell »

The frame rate is curiously high... what if you choose same as source or 60 fps, still with peak/variable framerate, instead of forcing it down to 30.
nikkoaki
Posts: 14
Joined: Wed Mar 06, 2024 1:20 pm

Re: Low performance with NVenc

Post by nikkoaki »

mduell wrote: Sat Mar 09, 2024 6:27 pm The frame rate is curiously high... what if you choose same as source or 60 fps, still with peak/variable framerate, instead of forcing it down to 30.
I'm not sure i get what you mean. I did choose "peak frame rate" instead of a fixed one. Choosing fixed does the same thing.
mduell
Veteran User
Posts: 8207
Joined: Sat Apr 21, 2007 8:54 pm

Re: Low performance with NVenc

Post by mduell »

For the frame rate, choose 60 or same as source, not 30.
nikkoaki
Posts: 14
Joined: Wed Mar 06, 2024 1:20 pm

Re: Low performance with NVenc

Post by nikkoaki »

mduell wrote: Sat Mar 09, 2024 9:40 pm For the frame rate, choose 60 or same as source, not 30.
Oh, sorry!

Just tested it, unfortunately it behaves the same.
Post Reply