PDA

View Full Version : How to maximize GPU encoding for best fps transcoding



smitbret
09-30-2021, 02:49 AM
What kind of setup/settings is everyone using to maximize fps on transcoding for remote access? I have figured out MY best situation and settings but I am hoping that someone has some ideas for upping the fps and the GPU utilization for the NVENC encoding since I can never really get it above 17%.

I haven't done much in the past but I am expecting to want to use remote streaming considerably more in the future (new ISP with fast upload speeds) so I started playing with things. Transcoding from h264 encoded files has always been a breeze with fps well over 100fps but I am shooting for worst case scenario type situations, so my test file is:

HEVC
3840x1606
12.0 MB/s
10 bit

Running for at least 5 minutes while I watch the Performance tab of the Windows Task Manager and the reported fps of Mezzmo

The hardware/OS:

Ryzen 5 3600x
nVidia GeForce GTX 1650
Windows 10 Pro 64 bit

My Mezzmo Transcoding Settings:

Maximum Bitrate: 50Mbps
Maximum Video Size: High Definition 1080p 1920x1080

Starting with all stock software, I ran it through four trials with the miscellaneous Hardware Acceleration combinations:
Decode: None Encode: None
Decode: Direct3D Encode: None
Decode: None Encode: Nvidia NVENC
Decode: Direct3D Encode: Nvidia NVENC

All of them ended up with 19-20fps.... not fast enough for real time. Interestingly, according to the Windows 10 Task Manager, the CPU is pegged at 100% but the GPU Video Encode just floated between 7% and 9% when NEVNC was activated

So, I updated to the latest Studio Drivers from Nvidia (v472.12) and updated FFMpeg to the latest build from 09/27/2021:
Decode: None Encode: None 43 fps CPU 100% GPU 3D 0% Video Encode 0% Video Decode 0 %
Decode: Direct3D Encode: None 24 fps CPU 100% GPU 3D 14-17% Video Encode 0% Video Decode 19-24%
Decode: Direct3D Encode: NVENC 26-27fps CPU 87-100% GPU 3D 4-5% Video Encode 7-8% Video Decode 7-8%
Decode: None Encode: NVENC 46-47 CPU 100% GPU 3D 0% Video Encode 12-14% Video Decode 0%

I will take 100% improvement any time!!!!

However, the interesting thing was that anytime I switched to hardware decoding, performance dropped to the floor. It's something I have noticed for years through 3 different CPUs and a couple of different GPUs.

I also ran through the same set of tests with an HEVC encoded 1080p file (instead of 2160p) and the fps ran 45-47 and the GPU Video Encode utilization was slightly higher 14-21%. So, obviously the bottleneck is the Decoding. Another unexpected observation. I ran a 50MB/s 4K HEVC encoded file through the same test and expected considerably lower fps but in reality I still got 40+ fps on the transcode.

I know there are some people out there that understand the inner machinations a little better and I am hoping that someone has run into something that cranks these numbers up a bit higher. I would think it would be particularly useful to get the GPU utilization much higher.