Weird intermittent/jamming coding using NVENC with RTX 3070 + i9-13900

Lukke wrote on 4/20/2023, 6:36 AM

Hello.

I just built a new PC (i9-13900K + RTX 3070 8GB), installed the newest Vegas Pro 20 (Build 370) and was looking forward to encode "like a charm". But when I started encoing using a build-in nvenc Internet 1080 HD profile, encoing is intermitent (see the video) and I don't know why. Latest nvidia drivers.

I checked the Preferences - Video - GPU acceleration - Optimal - NVIDIA GeForce RTX 3070.
In Render As - MAGIX AVC/AAC MP4 - default - Internet HD 1080p 59.94 fps (NVENC) - encode mode NV Encoder.

Source video is 1920x1080 60fps AVC. See the YouTube video of coding here:

And here is a screenshot of CPU and GPU utilization:

I tried to encode using CPU only, it is not intermitent like using GPU, but encoding takes 2 times longer. Does anyone has an idea what can cause this issue? THANKS A LOT! Lukas

Comments

j-v wrote on 4/20/2023, 6:58 AM

With me this is pretty normal with NVENC encoding,
If you wish not to see that you can use Voukoder with Nvenc to render.

met vriendelijke groet
Marten

Camera : Pan X900, GoPro Hero7 Hero Black, DJI Osmo Pocket, Samsung Galaxy A8
Desktop :MB Gigabyte Z390M, W11 home version 24H2, i7 9700 4.7Ghz,16 DDR4 GB RAM, Gef. GTX 1660 Ti with driver
566.14 Studiodriver and Intel HD graphics 630 with driver 31.0.101.2130
Laptop  :Asus ROG Str G712L, W11 home version 23H2, CPU i7-10875H, 16 GB RAM, NVIDIA GeForce RTX 2070 with Studiodriver 576.02 and Intel UHD Graphics 630 with driver 31.0.101.2130
Vegas software: VP 10 to 22 and VMS(pl) 10,12 to 17.
TV      :LG 4K 55EG960V

My slogan is: BE OR BECOME A STEM CELL DONOR!!! (because it saved my life in 2016)

 

RogerS wrote on 4/20/2023, 7:00 AM

Everything looks fine from what I can see. While there are momentary pauses with NVENC it's still quite fast and only 10-15% behind what it would be without that. Decoding and 3D use also seem fine.

If you're concerned your system is falling behind similar ones try it on the two benchmark projects I have in my signature and see how your times compare.

If you really want to get that last 10% you can try a NVENC render through Voukoder. voukoder.org/ You can also use QSV- I highly recommend enabling your iGPU in bios and let it do decoding and potentially encoding.

3POINT wrote on 4/20/2023, 7:25 AM

The worse thing is that you can see these pausing/intermittents in the final render result. In equal coloured details you will see after rendering pulsing artifacts.

Just render, as already said, with Voukoder with NVENC support instead. Much faster and with better quality.

RogerS wrote on 4/20/2023, 8:03 AM

I just did a test render with NVENC of a color purge, gradient, checkerboard and test pattern and a piece of AVC footage with a lot of sky and couldn't see pulsing artifacts. Can you clarify when those are more likely to show up?

3POINT wrote on 4/20/2023, 8:10 AM

I could give some real footage examples in 4k but I'm limited in upload speed.

GJeffrey wrote on 4/20/2023, 8:12 AM

There is indeed a programming issue with Vegas and nvenc. I haven't seen that pulsing encoding behavior in any other other app using nvenc capabilities. It looks like a buffer allocation or ressource releasing issue but I'm not a programmer at all, so that's a wild guess.

I hope this behavior can be fixed and also Vegas exposing more nvenc encoding option like other NLE.

BTW, I've also never seen the pulsing in the rendered file itself

3POINT wrote on 4/20/2023, 8:57 AM

@RogerS a small rendertest with 4k footage (downscaled to 2k for quicker upload) with Magix HEVC 1080p50 NVENC rendertemplate and Voukoder HEVC CRF28 NVENC. Renderingspeed with Magix, average of 66fps and with Voukoder, average of 90fps. That's much faster than the 10-15% you stated.

But now, look at the resulting pulsing artifacts in the ornaments of this fountain, can you read the characters in the Magix render? Also compare that with the crispy result of Voukoder. Voukoder used an average bitrate of just 18 Mbps for that crispy result and Magix used an average bitrate 22,2 Mbps for this worse result.

Link to the original renders: https://we.tl/t-s4FQJP9yhb

RogerS wrote on 4/20/2023, 9:18 AM

To clarify, the 10-15% number is based on mine and other forum users' tests using MagixAVC vs AVC with NVENC in Voukoder. I've never rendered to HEVC.

I do agree Voukoder is more efficient in terms of quality at a given bitrate and faster for NVENC renders and use Voukoder x264 for just about all of my final renders where image quality matters.

At this rate the download will take a few hours so will try to check when it's done.

3POINT wrote on 4/20/2023, 9:30 AM

At this rate the download will take a few hours so will try to check when it's done.

My two uploaded renderfiles are just 48 and 40 Mb, the download must be done in a few seconds.

3POINT wrote on 4/20/2023, 9:46 AM

I could provide dozens examples of my recordings where Magix just produces poor renders like shown. I'm always wondering that I seem to be the only one who notice this.

I tried to answer @Former user but he probably deleted his post.

Last changed by 3POINT on 4/20/2023, 9:48 AM, changed a total of 1 times.

3POINT, Theo Houben, Vegasuser since version 5 and co-founder and moderator of the Dutch Vegasforum https://www.vegas-videoforum.nl/index.php

Recware: DJI Osmo Pocket/Mavic Mini, GoproHero7Black, PanasonicFZ300/HCX909.

Software: Vegaspro365+Vegasaur, PowerDirector365, Davinci Resolve 20

Hardware: i910900k, 32GB, GTX2080super, 2x1920x1200 display

Playware: Samsung Qled QE65Q6FN

Former user wrote on 4/20/2023, 9:51 AM

@Lukke Hi, as everyone has mentioned that's normal for Vegas + Nvenc, I too use Voukoder & thanks to @3POINT for those images, interesting that Magix is poorer with a bigger file size, Download was instant, It nice to have confirmation I'm using the better option.👍 & it's quicker.

Magix 4.10mins, jagged GPU very little use of CPU.

Voukoder better use of GPU & CPU

PS, yep I edited my post, prob while you were typing, thanks

Lukke wrote on 4/20/2023, 11:43 AM

Thank you for your replies! I just did some benchmarking:

1-minute video 1080p

Voukoder - H.264 (NVIDIA NVENC) - 83 fps - time 0:43
Voukoder - HEVC (NVIDIA NVENC) - 84 fps - time 0:43

MAGIX AVC -  (NVENC) -         73 fps - time 0:49
MAGIX AVC - (cpu Mainconcept) 71 fps - time 0:50
MAGIX HEVC/AAC - (NVENC) -     69 fps - time 0:51

Voukoder - H.264 (x264) - 37 fps - time 1:36
Voukoder - H.265 (x265) - 23 fps - time 2:37

So seems Voukoder really wins here. What was interesting - CPU only encoding using Mainconcept gives similar speed like Magix Nvenc on my i9-13900K. So seems everything is running fine on my PC, thanks for your help! Will continue testing!

GPU utilization using Voukoder is a little higher than using Magix nvenc.

Former user wrote on 4/20/2023, 1:28 PM

@Lukke 👍

Hi, can you click your icon at the top of this page - My Profile & fill in your Signature with the full name of your CPU, GPU & amount of RAM, also inc the Windows & Magix version, this will then always show at the bottom of your comments, thanks👍

RogerS wrote on 4/20/2023, 7:29 PM

Download was at 28kbs... Maybe WeTransfer doesn't have servers in Asia.

There is a huge difference between the MagixHEVC file and it looks like it's falling apart possibly due to bitrate. With far greater maximum bitrate does it retain more detail and lose the artifacts? I consider this file unacceptable.

Lukke, that isn't really normal for a CPU render to be the same speed as GPU but you have a very fast CPU! Would you try the benchmarks in my signature?

3POINT wrote on 4/21/2023, 2:07 AM

Download was at 28kbs... Maybe WeTransfer doesn't have servers in Asia.

There is a huge difference between the MagixHEVC file and it looks like it's falling apart possibly due to bitrate. With far greater maximum bitrate does it retain more detail and lose the artifacts? I consider this file unacceptable.

Strange that your download took so long.

I tested again now with Magix AVC 1080p50 NVENC rendertemplate, the result was even worse than with Magix HEVC.

Next test changed max bitrate from 40 Mbps to 240 Mbps, result, no change still worse.

Next test disable NVENC support and use Mainconcept AVC, result better but still far from perfect.

Last test with Voukoder AVC QP28 NVENC, (same crispy result as with Magix HEVC but slight higher average bitrate) against Magix AVC NVENC, see below:

With bitrateviewer (works only for AVC unfortunately not for HEVC) you see the difference between Magix and Voukoder bitrates and understand why I prefer Voukoder CRF for quality renders and not Magix VBR.

 

Lukke wrote on 4/21/2023, 3:52 AM

Lukke, that isn't really normal for a CPU render to be the same speed as GPU but you have a very fast CPU! Would you try the benchmarks in my signature?

Hi :) I just tried your benchmarks for Vegas 20. It's strange that both Mainconcept and NVENC takes the same time for me. Both 1:40 - check your Google sheet. It's because the Mainconcept uses GPU encoding power as well. When I turn off Hardware Graphic to OFF in Preferences/Video, the difference is HUGE.

mainconcept -                  GPU 60-70%, CPU 60-100%        1:40
mainconcept - Hardware GPU OFF - GPU 0%, CPU 30-85%        17:45
nvenc -                      GPU 70-95%, CPU 10-30%        1:40
voukoder nvenc -      GPU 70-95%, CPU 30%         1:30    

 

RogerS wrote on 4/21/2023, 3:58 AM

Take a look at the diagram here for how your NVIDIA GPU works: https://developer.nvidia.com/video-codec-sdk

Your GPU does 3D calcs, encoding (rendering) and decoding (playing back video) with separate circuitry. These functions are also are set independently in VEGAS (preferences/video, preferences/ file io and the render template respectively).

In Windows task manager/performance click on the NVIDIA GPU while rendering and you'll see activity broken out in these 3 categories. If you see encode activity while Mainconcept is working something is wrong.

RogerS wrote on 4/21/2023, 4:02 AM

Looking again at my own times I also didn't have much difference with Mainconcept and NVENC for this file- the bottleneck must be how intensive it is to compute the timeline (the GPU).

Do enable your iGPU- it decodes types of files that NVIDIA is unable to and is the most stable for VEGAS. I use it with my 13th gen. Intel.

3POINT wrote on 4/21/2023, 4:53 AM

It's a pity that this videoforum is more focused on benchmarking Vegas on different hardware and searching for fastest renderspeed instead of searching for best renderquality.

It reminds me a little of a competition of cars, just who first finishes wins.

RogerS wrote on 4/21/2023, 5:05 AM

It's helpful for when you want to buy a computer for video editing (as I did recently) to understand the playback and render performance of different hardware combinations.

Best render quality often isn't relevant- don't really care if I'm rerendering a multihour conference or webinar or doing a draft video. When it is we have other threads like those by Howard with a good guide to differences between encoders.

3POINT wrote on 4/21/2023, 5:26 AM

Best render quality often isn't relevant- don't really care if I'm rerendering a multihour conference or webinar or doing a draft video.

For such not quality related but speed related editing, I prefer a video editor capable smart rendering.

Former user wrote on 4/21/2023, 5:43 AM
 

With bitrateviewer (works only for AVC unfortunately not for HEVC) you see the difference between Magix and Voukoder bitrates and understand why I prefer Voukoder CRF for quality renders and not Magix VBR.

 

Here's the HEVC examples. Voukoder first, then MagixHEVC. The encoder should be reacting to the water in the fountain, Voukoder responds as it should, MagixHEVC doesn't, and it's worst frames are the I frames.... How is that even possible. Aren't they supposed to be the pristine frames which the compression depends on, Bad I frames = Bad P frames.

The worst part is this is that we know full well the dev's have known about this for 5+ years but thought it's good enough while pretending there was not a problem, they still haven't admitted to it. It also brought about this fallacy of how darn terrible hardware encoding is. NO! MagixAVC/HEVC hardware encoding is terrible, not applicable to the hardware technology, just a poor implementation.

Lukke wrote on 5/2/2023, 1:34 PM

I did some more tests today. I activated integrated Intel UHD Graphics 770 of my CPU. Here are the results:

GPU acceleration of video processing: Optimal - NVIDIA GeForce RTX 3070
RAW Processor To Use - Auto (OpenCL on RTX 3070)
Hardware Decoder To Use - Auto (QSV on UHD Graphic 770)

mainconcept - integrated GPU disabled in bios    1:40
mainconcept - integrated GPU ENABLED in bios    1:58

nvenc -       integrated GPU disabled in bios   1:40
nvenc -       integrated GPU ENABLED in bios     1:33

QSV Intel -   integrated GPU ENABLED in bios    1:28 - THE WINNER

 

RogerS wrote on 5/2/2023, 7:29 PM

Raw processor is irrelevant if you're not using raw video.
If it's HEVC try both legacy and the new decoder and see which one works best for a given piece of media.

These time differences between QSV and NVENC are pretty minor. You might look closely at the rendered result to ensure quality is acceptable to you and if not adjust bitrates and settings accordingly. The same VEGAS render settings in Mainconcept and NVENC or QSV won't yield the same quality file (Mainconcept will be better). Personally, for final renders where image quality matters I use x.264 through Voukoder. It's the slowest but also highest quality and most data efficient way to render h.264/AVC and makes good use of my 13th gen Intel CPU's cores.