Question / Help Laggy video in OBS due to rendering lag

Snebbik

New Member
So I have an issue in a few games, Total War/Monster Hunter World, with getting a stable stream.

I have tried changing between direct3D11 and openGL, and between x264 and NVENC h. 264 with no real difference. The two .txt files are running it with drect3d11 in NVENC h.264 and x264 while playing MHW.
 

Attachments

  • Speccy64_2018-11-04_03-04-28.png
    Speccy64_2018-11-04_03-04-28.png
    49.5 KB · Views: 410
  • obs64_2018-11-04_03-07-02.png
    obs64_2018-11-04_03-07-02.png
    59.4 KB · Views: 404
  • obs64_2018-11-04_03-07-17.png
    obs64_2018-11-04_03-07-17.png
    66 KB · Views: 309
  • obs64_2018-11-04_03-07-29.png
    obs64_2018-11-04_03-07-29.png
    62.1 KB · Views: 279
  • obs64_2018-11-04_03-07-37.png
    obs64_2018-11-04_03-07-37.png
    43.9 KB · Views: 261
  • obs64_2018-11-04_03-07-48.png
    obs64_2018-11-04_03-07-48.png
    63.1 KB · Views: 244
  • 2018-11-04 03-55-19.txt
    8 KB · Views: 34
  • 2018-11-04 04-00-05.txt
    8.2 KB · Views: 15

Narcogen

Active Member
None of those changes will affect rendering lag. Rendering lag means your GPU is overloaded before frames even reach the encoder; so changing encoders or encoder settings won't change it. Since you're already scaling down to 720p and are shooting for 30fps, I would wonder if you have an fps limiter on your game; OBS needs the GPU to render frames before encoding, and the overload message means that it can't get access, presumably because other applications are already saturating it, at least part of the time.

03:56:48.080: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 313 (13.5%)
 

Snebbik

New Member
I see. So I have two 980 ti's, and MHW doesnt use SLI from what I can tell, as looking at my GPU usage during play time my first GPU hits %100 even though I am getting a smooth 60 FPS the whole time, and the second GPU is showing like 5% utilization.

I tried setting MHW down from highest to medium, and it still was hitting 100% with the second GPU showing 5% and I was getting 60 FPS ingame still.

I had to set it to low settings to get the rendering lag to be low, but it was still occuring sometimes, and the GPU was hitting 60% on the first one and 5% on the second still.

I also have had MHW set, and confirmed it was set to 60 FPS during all these tests.


Is there a way to force OBS to use the second GPU to do the rendering?
 

Narcogen

Active Member
No, and if you could, it would not help; the performance hit from getting the frames off one card, onto the PCI bus, and onto the 2nd card takes away any advantage you get. The best way to split the load between game and recording/streaming is with a 2nd PC and a capture card or OBS/NDI or similar, not a 2nd GPU within the same PC.

As an example, look at the situation on laptops that already have dual GPUs; since the integrated usually is in charge of the display, you can't do monitor capture unless OBS is running on that GPU. If you force OBS to open on the GPU that isn't running the game, OBS wouldn't be able to capture the game-- again, because there isn't bandwidth to that.
 

Snebbik

New Member
That's a shame. Would having Shadowplay turned on possibly make OBS stutter? On a whim I decided to try using it to stream and record, which it was already turned on because I use it for FPS counter sometimes, and I am getting lag and stutter free streams and recordings in games I normally cant get a good stream out of with OBS.
 

Narcogen

Active Member
I don't think so? Shadowplay would use up an NVENC instance, so depending on your card, you might not be able to use that and OBS and the NVENC encoder. But I'm not sure just having it open would cause that. If it was recording while running OBS, that might, because I'm presuming then you'd have it, and the game, and OBS all competing to get frames off the card and onto the PCI bus.
 

Snebbik

New Member
I didn't have it recording or streaming until after I gave up on OBS. Just curious how that doesn't cause lag or stuttering but using OBS does. Oh well guess I'll just have to use that from now on even though I like OBS's customization better. Thanks for the help.
 
I'm finding a very similar scenario. Having a PC with SLI, NVIDIA Shadowplay seems to be best stutter-free option. But I really love all the customization options with sources, scenes, etc. from OBS Studio... so I'm stucked.

From what I've tested, in my PC's the best (or "least bad") OBS Studio streaming settings are x264, faster preset, game capture scaled to 1080 with 1080 canvas and 1080 output (I play games at 4K resolution so I have to downscale that image to fit Twitch limits) and SLI capture mode enabled. But even with that settings, I'm facing a 7.3% of lagged frames due to rendering lag/stalls and 2.1% of skipped frames due to encoding lag... if I don't tune down my game's graphic setings.

Similar numbers if I change x264 to NVENC, 9.4 of lagged frames due to rendering lag/stalls (no skipped frames due to encoding lag), but less quality image in the video.

All this is making mi consider a capture card...
 

BK-Morpheus

Active Member
Besides other rendering issues on multi GPU systems, I would also check for PCIe lanes.
Grabbing frames from the frame buffer increases the PCIe load a lot. Having a second GPU installed often results in PCIe speed drop from 16 lanes to 8 lanes (at least on most mainstream CPU/mainboard combos).
So just from splitting the PCIe bandwidth in half, by using two GPUs, the chances of rendering lag problems will increase.
 
I'm a long term multi-gpu fan, using them since last 12 years. And I would never recomend using a multi-GPU if there is an option of a single GPU that can be as powerfull as the multi-GPU option (i.e., 1080Ti vs SLI 1070). But sometimes you need more that what a single GPU can give (multi-monitor ultra-wide resolutions, 4K HDR with all graphic setings maxed and over 60 FPS, etc.)... and then you have no other option than SLI to reach that power. And if that's the case, nobody should never use a CPU neither a motherboard that can not provide 32 PCIe lanes to both GPUs if he's looking for real in-game (or benchmark) performance scalation.

In my PC, I have 2 GPUs connected at PCIe 3.0 x16 speed (confirmed by GPU-Z) in the correct PCIe 3.0 slots of an Asus RVE, using 32 of the total 40 PCIe Lanes of my CPU (5930K).

And my problem right now seems to be reducing the GPU load to try to avoid that 7.3% of lagged frames due to rendering lag/stalls. But I was looking for the best OBS configuration to use with SLI, and if it NVIDIA Shadowplay were more customizable (with overlays, web browser sources, etc.)... I would totally discard OBS Studio.
 

Narcogen

Active Member
The reason why OBS performs poorly with SLI is because of those things. The reason why ShadowPlay runs acceptably with SLI is because it does not do those things. OBS needs to render those frames because it may have to composite them, and it renders whether it needs to composite or not. Shadowplay doesn't do arbitrary overlays, and if it did, it would almost certainly perform more similarly to OBS in an SLI configuration because of the need to composite those overlays before rendering the frame.
 
Top