Question / Help NVENC Performance hit

Kashiro

New Member
Recently I've been experiencing some weird situations when using NVENC encoding. For some reason OBS' implementation of the NVENC encoder seems not as efficient as Shadowplay or Xsplit anymore (it used to work just fine). I only noticed this a couple of days ago and I'm fairly certain that it wasn't like this before, or at least not to this degree.

Some info about my streaming setup:

Desktop: i5 2500k @ 4.5ghz and a GTX 970
OBS settings: NVENC - 30k bitrate - 720p60fps
Streaming rig: i5 2400 @ 3.3ghz

I don't have a capture card so I've been using the nginx setup which allows you to do a 2 system setup without the need of a capture card. Using NVENC on my desktop to stream at a high bitrate to the streaming rig which then does x264 at a decent enough bitrate for twitch. This has always worked fine and it still does. The performance hit however that I'm seeing as of late is something I honestly can't wrap my head around. Let me give you an example.

In most games I'm seeing about a 15-20 fps decrease when I start streaming using NVENC. This is only when the game I'm running is already maxing out the GPU itself (99-100% usage). In cases where the game is more CPU bound the performance hit is less noticeable when using NVENC, about a 2-3 fps decrease, which is what I'm used to seeing.

I play FFXIV which is an mmo. A good scenario would be for me to stand around in one of the major cities with lots of players around. These type of scenes are generally very CPU intensive. I'd see 100% CPU usage and about 50% GPU usage with OBS turned off. When I start streaming in this case there is only a 2-3 fps decrease, but for some reason the GPU usage jumps from 50% to 65%. Is it normal that OBS+NVENC straight up consumes 15% of the GPU's capacity when turned on?

In GPU intensive scenarios X264 actually gives me better performance compared to NVENC, which I feel like shouldn't be the case.
 
Last edited:
NVENC/Shadowplay just uses some of the GPU's resources for encoding, instead of the CPU. It absolutely will increase GPU load, and this is fully expected. You don't get video encoding for free. Doesn't work that way. It'll be the same on Shadowplay or XSplit, as they both use the same encoding method. As OBS hasn't updated for a while now, I'd expect it'd be much more likely something increasing load in your game; possibly due to a forgotten settings tweak, or a new patch, if this has only started in the last week or four.

Regardless of video encoder in use, OBS uses the GPU for scaling and compositing the scene prior to encoding. This is normally a very minor additional load, but if you are already stressing your GPU to its limits, it may be noticeable; especially if you are ALSO dumping the heavy workload of real-time video encoding onto the GPU as well.

Really, it sounds either like time to upgrade your video card (less likely given the hardware involved), or time to invest in a capture card and offload OBS to the encoding machine entirely.
May also look into swapping over to QSV for your LAN-hop, if your i5+motherboard is capable and you aren't using the IGP for anything else.
 
Thanks for taking the time to reply.

The thing is though that with the NVENC implementation in Shadowplay and Xsplit the performance impact is hardly noticeable. I tested this in the same scenarios as I did with OBS. It's really only OBS that has such a big impact on performance. With Shadowplay and Xsplit we're talking about the 2-3 fps loss that we can expect, but for some reason with OBS it's more along the lines of 15-20 fps. I am aware of the fact that using NVENC will always cost some performance. Why is it though that Shadowplay and Xsplit are much more efficient than OBS. Hell, they're even more efficient at higher resolutions and bitrates.

The weird thing is that I'm seeing this across many games now. I've found these two threads that appear to be about the same problem.

https://obsproject.com/forum/thread...wer-than-shadowplay-and-more-intensive.24135/
https://obsproject.com/forum/threads/nvenc-giving-terrible-performance-vs-shadowplay.11448/

The problem might have started occurring a while ago. I haven't really streamed recently so I have no solid indication of when it started happening.

Sadly I'm still rocking a P67 chipset motherboard, so I can't use QSV.
 
NVENC/Shadowplay just uses some of the GPU's resources for encoding, instead of the CPU. It absolutely will increase GPU load, and this is fully expected. You don't get video encoding for free. Doesn't work that way. It'll be the same on Shadowplay or XSplit, as they both use the same encoding method. As OBS hasn't updated for a while now, I'd expect it'd be much more likely something increasing load in your game; possibly due to a forgotten settings tweak, or a new patch, if this has only started in the last week or four.

Regardless of video encoder in use, OBS uses the GPU for scaling and compositing the scene prior to encoding. This is normally a very minor additional load, but if you are already stressing your GPU to its limits, it may be noticeable; especially if you are ALSO dumping the heavy workload of real-time video encoding onto the GPU as well.

Really, it sounds either like time to upgrade your video card (less likely given the hardware involved), or time to invest in a capture card and offload OBS to the encoding machine entirely.
May also look into swapping over to QSV for your LAN-hop, if your i5+motherboard is capable and you aren't using the IGP for anything else.

The video encoding with NVENC is done on a seperate chip, so it should not increase the load on your GPU in a significant way.
The compositing done on the GPU should increase the load a lot more then the encoding.
 
NVENC does use the GPU a bit as far as OBS' implementation, because it is not at a driver level. When 99% GPU is achieved in some games (especially below 60fps), I cannot use NVENC (single card). In this case, vsync can help.

That being said, 30k bitrate might be too much. I would suggest using about 10,000 bitrate or so for what you have suggested. Maybe 12,000, but you won't need much more than that especially if using "high quality" for NVENC. It should be more than sufficient quality and will take some load off of your CPU and GPU.

The problem isn't NVENC itself but rather how OBS is able to use it, and because of its game capture code and the lack of driver-level implementation etc it can hit some games or mess with your GPU. Also, it also depends on the way that OBS is capturing the game. Sometimes the capture method is a problem. Like Dark Souls 2 (DX9 version) is VERY hating of capture types. I usually have to window or monitor capture it. Even using recording software like playclaw will drop it way down to the 40s in FPS for me. Game capture is not always best capture ;)
 
The video encoding with NVENC is done on a seperate chip, so it should not increase the load on your GPU in a significant way.
The compositing done on the GPU should increase the load a lot more then the encoding.

I'm not using any extra sources other than my game capture, audio and microphone. So no overlay/webcam or anything of the likes.

NVENC does use the GPU a bit as far as OBS' implementation, because it is not at a driver level. When 99% GPU is achieved in some games (especially below 60fps), I cannot use NVENC (single card). In this case, vsync can help.

That being said, 30k bitrate might be too much. I would suggest using about 10,000 bitrate or so for what you have suggested. Maybe 12,000, but you won't need much more than that especially if using "high quality" for NVENC. It should be more than sufficient quality and will take some load off of your CPU and GPU.

The problem isn't NVENC itself but rather how OBS is able to use it, and because of its game capture code and the lack of driver-level implementation etc it can hit some games or mess with your GPU. Also, it also depends on the way that OBS is capturing the game. Sometimes the capture method is a problem. Like Dark Souls 2 (DX9 version) is VERY hating of capture types. I usually have to window or monitor capture it. Even using recording software like playclaw will drop it way down to the 40s in FPS for me. Game capture is not always best capture ;)

Thank you for the tips, but sadly I had already tinkered around with these things and they didn't soften the performance hit at all. I tried lowering the bitrate and framerate, changing capture method and NVENC preset, but it doesn't seem to have any effect.

Don't get me wrong though, I still prefer NVENC over X264 even with this performance hit, and I will continue to use it for streaming purposes. I just find it odd that OBS' implementation of it comes with such a performance hit compared to other solutions. Sadly Shadowplay is very limited in options and I've never really liked Xsplit (besides the fact that you have to pay for it).

How big is the chance that the NVENC implementation in OBS will be improved upon so that it's more along the lines of Shadowplay/Xsplit?
 
0 chance, since OBS1 is dead development-wise. All development is focused on OBS multiplatform and it doesn't have NVENC yet (unless you use advanced ffmpeg output with a ffmpeg version built with nvenc support).
Mayb OBS multiplatform won't even have it's own NVENC implementation, but will just use ffmpeg's NVENC implementation.
 
0 chance, since OBS1 is dead development-wise. All development is focused on OBS multiplatform and it doesn't have NVENC yet (unless you use advanced ffmpeg output with a ffmpeg version built with nvenc support).
Mayb OBS multiplatform won't even have it's own NVENC implementation, but will just use ffmpeg's NVENC implementation.

If I were to grab the multiplatform version and mess around with ffmpeg, would I possibly see better results?
 
Do you hit 99% GPU load without hitting 60fps? If so, vsync would not save you.

No, in that situation it was 99% GPU load at about 120 fps. I think I understand what your idea is, but I'm fairly certain that it wouldn't change anything. Either I turn on vsync, capping my game at 60 fps which would mean that the GPU isn't fully stressed, leaving enough head room for OBS to do it's thing, or I leave vsync off which would result in 99% GPU usage but at much higher framerates of which a portion would be cut off because of OBS. I personally dislike vsync so I'd rather not use it. Correct me if I'm wrong though!
 
Is this already available in the current latest version for Windows?

The only thing that comes close to what you're saying is the Recording tab under Output > Advanced > Recording. I don't see anything similar under streaming.

I'm probably misunderstanding what you're saying. Would this allow me to use ffmpeg as encoder in the same way as I'm using NVENC capturing with the regular version of OBS right now, or does this simply add an extra step where x264 is still required?
 
Last edited:
And I'm guessing it's not as simple as finding a ffmpeg build that's compiled with nvenc support and then just sticking it in there. Is it even possible to replace the ffmpeg version that comes with obs-mp right now?
 
I can't find any bin files of ffmpeg. The only things related to ffmpeg I can find are a plugin folder called obs-ffmpeg which only holds the text localization files, and a dll file called obs-ffmpeg.dll. I think I'll wait until there's more documentation available, unless someone here is able to tell me if it's possible and how.

Thanks for all the help so far.
 
No, in that situation it was 99% GPU load at about 120 fps. I think I understand what your idea is, but I'm fairly certain that it wouldn't change anything. Either I turn on vsync, capping my game at 60 fps which would mean that the GPU isn't fully stressed, leaving enough head room for OBS to do it's thing, or I leave vsync off which would result in 99% GPU usage but at much higher framerates of which a portion would be cut off because of OBS. I personally dislike vsync so I'd rather not use it. Correct me if I'm wrong though!
Yeah. If you don't have a 120Hz screen, you should try vsyncing when streaming. The downside to SLI is that OBS has problems with it, but the upside is that you're almost never at 99% scaling on each card, so NVENC via 3rd party software-level encoders works much better.
 
Yeah. If you don't have a 120Hz screen, you should try vsyncing when streaming. The downside to SLI is that OBS has problems with it, but the upside is that you're almost never at 99% scaling on each card, so NVENC via 3rd party software-level encoders works much better.

I still don't see the benefit in streaming with vsync on. In 99% of the cases I'm staying over 60fps anyway while streaming so why cap it?

Your point about SLI is a good one though. I do plan on adding a second 970 sometime soon so that should work out well.
 
Back
Top