Question / Help Lag when OBS is open, even when not streaming

Robert M

New Member
Noticed that when playing a game it runs at a smooth 144 as it should, but the moment OBS opens fps starts to fluctuate, dropping as low as 60. I noticed that it especially did it if I had OBS maximized on my second monitor, so I minimized it but it still continues to drop frames. It does it both when streaming and when the game is open as well. Once OBS is closed, everything goes back to normal, occasionally needing to be restarted but it'll go back to the normal fps. CPU load never goes above 50%, and GPU load isn't a problem either as I run games on medium settings to get higher fps. The game I've been playing is Overwatch, and I realize it's a cpu intensive game, so I tried NVENC and I still get the same issue. Seems to be a consistent 40 fps drop as soon as OBS is open, and it continues to go down the longer I have it open. I've tried multiple things, like reinstalling graphics drivers, reinstalling OBS, changing capture methods from Game Capture to Monitor Capture, and I haven't found anything that works. Log is attached to this post, and any help would be appreciated.
 

Attachments

  • 2017-09-07 19-36-31.txt
    19.6 KB · Views: 531

Robert M

New Member
Unfortunately that's not really an option, as lowering my fps to 60 introduces a lot of input lag, and trying to change muscle memory from how I've been playing since I purchased the game to get used to the different mouse movement isn't worth it just to stream using OBS. I was just hoping there was something wrong like I had something enabled that was causing the huge fps drops. I streamed using Nvidia's Share feature in GeForce Experience and there was never any lag. But even when using Nvenc in OBS, the lag is severe, so I know it's not my system, it's just OBS itself, because I'm using the same settings as Shadowplay to stream, but the performance difference is night and day. All the other steps you mentioned I have done previously, and there is no sign of high cpu/gpu temps, or usage so I can't tell what the issue is.
 

Robert M

New Member
If you read the log you'd know that I used x264 initially when streaming, and still faced huge fps drops. OBS is eating away at some resources that are causing the game to run badly, and it's not CPU/GPU related as both weren't close to being fully utilized. I don't know if it's a software compatibility issue, like Overwatch just doesn't like OBS. All I know is that OBS itself, not the encoding, causes issues in game, because whether I'm streaming, or just have OBS opened and minimized, my game performance is cut in half, and steadily decreases until I just stop streaming.
 

Robert M

New Member
first link I posted gives you complete solution. you can use it or dont try to stream/record
I did all except lower my in game fps to 60, which I don't think should be necessary since Shadowplay is able to stream with my fps at 300, so I'm not sure what OBS is doing that's causing my fps to fluctuate. It's not an encoder issue, it's something with the program itself.
 

Harold

Active Member
which I don't think should be necessary since Shadowplay is able to stream with my fps at 300
shadowplay cheats. It uses functions in the nvidia card that aren't available to other programs. You can't use shadowplay as a comparison.
 

Robert M

New Member
shadowplay cheats. It uses functions in the nvidia card that aren't available to other programs. You can't use shadowplay as a comparison.
How am I able to get OBS to run similar to Shadowplay then. I can use x264, CPU usage isn't an issue, as with the game, OBS, discord, and web browser open to monitor chat and stream health, the cpu and ram usage never go above 50%. But just having OBS open causes the game to run slow, and if I don't have OBS minimized, the game feels like it's running at 30 fps, even though the FPS shows it running above 100 ish. It get's super choppy, and almost like OBS is hogging usage to show it's preview. Unfortunately disabling preview doesn't fix the problem, and I still have yet to find something that works.
 

Robert M

New Member
have you found a solution yet?
Yes, you need to make sure all instances of Shadowplay are off when recording on OBS. I'm not sure on the accuracy of this but from what it looked like, when Shadowplay is running, and you try recording using another program, one program prioritizes the NVENC encoder. The result is the other falling back to using the 3d engine to record, causing the gpu to throttle, and underperform until your game is essentially unplayable. The minute Shadowplay is off, everything worked fine, with a small hit to the GPU which is normal because of OBS compositing on the GPU. Make sure it is not recording (Instant Replay and Recording are Off), and also Highlights are shut off if you play Fortnite or PUBG, because even if Instant Replay is shut off, Highlights will still save.
 

BK-Morpheus

Active Member
I did all except lower my in game fps to 60, which I don't think should be necessary since Shadowplay is able to stream with my fps at 300, so I'm not sure what OBS is doing that's causing my fps to fluctuate. It's not an encoder issue, it's something with the program itself.
Shadowplay is working completely different. It can access the framebuffer directly with minimal delay and even before there was any communication between the GPU and the Mainboard/PCI-e.
After that, the Nvidia encoder chip can compress the frames into a videostream, using NVencoder.

OBS and every non-Nvidia tool can only use the NVencoder, but not the low level framebuffer access of shadowplay.

If you want smooth streaming you might need to limit ingame fps (which you should anyway for constant/smooth framerates).
If you need more than 60fps, that's fine, just limit the fps at 120 or 144 then.
But you need to make sure, that neither your GPU, nor your CPU will run into any bottleneck...so you should use hardware, that will allow to run the game with more than 144fps even demanding situations while still not using more than 90% GPU load (and if possible, less than 90% CPU load on every core...it might still be a bottleneck, if one core is running at 95-100% while three cores are running at only 20% load).

If this is not possible, you need a second computer with a capture card, just for streaming.
 

Robert M

New Member
Shadowplay is working completely different. It can access the framebuffer directly with minimal delay and even before there was any communication between the GPU and the Mainboard/PCI-e.
After that, the Nvidia encoder chip can compress the frames into a videostream, using NVencoder.

OBS and every non-Nvidia tool can only use the NVencoder, but not the low level framebuffer access of shadowplay.

If you want smooth streaming you might need to limit ingame fps (which you should anyway for constant/smooth framerates).
If you need more than 60fps, that's fine, just limit the fps at 120 or 144 then.
But you need to make sure, that neither your GPU, nor your CPU will run into any bottleneck...so you should use hardware, that will allow to run the game with more than 144fps even demanding situations while still not using more than 90% GPU load (and if possible, less than 90% CPU load on every core...it might still be a bottleneck, if one core is running at 95-100% while three cores are running at only 20% load).

If this is not possible, you need a second computer with a capture card, just for streaming.
From what I understood when looking through this issue, NVENC is limited on 1 single encoding task at once. It might be a GPU specific issue but that's what ended up happening for me at least. I limited my fps and lowered settings to where there was I think 70% GPU load and only 40% cpu load when running the game at 165 fps. OBS uses about 10% of my gpu to composite but that wasn't the issue. The issue was where OBS would use the 3d engine to encode instead of the dedicated encoder. I'm not sure exactly why it was doing that but it went away the minute I disabled shadowplay so I assume it was shadowplay utilizing the encoder. Any other input on it would be appreciated.
 

BK-Morpheus

Active Member
Yep, having different tools accessing the framebuffer is always a potential for such a problem.
Windows Game DVR, Shadowplay, Shadowplay Overlay, Fraps Overlay, Afterburner/Rivatuner Overlay, Steam Overlay...all those tools can interfere with capture software like OBS.

Back in the days, where I installed Geforce Experience, I noticed, that Shadowplay seems too keep some kind of frame access or service running, even if I set Shadowplay to fully manual control and have overlays disabled.
 

Goggit

New Member
Noticed that when playing a game it runs at a smooth 144 as it should, but the moment OBS opens fps starts to fluctuate, dropping as low as 60. I noticed that it especially did it if I had OBS maximized on my second monitor, so I minimized it but it still continues to drop frames. It does it both when streaming and when the game is open as well. Once OBS is closed, everything goes back to normal, occasionally needing to be restarted but it'll go back to the normal fps. CPU load never goes above 50%, and GPU load isn't a problem either as I run games on medium settings to get higher fps. The game I've been playing is Overwatch, and I realize it's a cpu intensive game, so I tried NVENC and I still get the same issue. Seems to be a consistent 40 fps drop as soon as OBS is open, and it continues to go down the longer I have it open. I've tried multiple things, like reinstalling graphics drivers, reinstalling OBS, changing capture methods from Game Capture to Monitor Capture, and I haven't found anything that works. Log is attached to this post, and any help would be appreciated.

All I did was search game mode and turn it off. Game mode takes all of the processing power of your cpu and gpu and focuses it on games, so there is no power for obs. Turning it off gives obs some processing power and that SHOULD fix it. It worked for me
 
Top