Question / Help [solved] Understanding rendering lag / GPU influence / scene stuttering

Hi guys, I am trying to understand scene rendering in OBS.

As far as I know OBS uses the GPU to render scenes. What I don't understand is why I still have rendering lag (little, like 0.2-0.3%) even though my GPU "idles" at 20% shown by GPU-Z.
My average time to render frame is ~ 1.1ms. So I should be able to render like 1100 fps :) After upgrading my GPU from a 1030 to a 1050 Ti that time did not change at all, the only thing that changed is GPU-Z now showing only 10% usage. Narf.

Background: I play PS4 games and have a dedicated streaming PC where the scene rendering stutters and I have no idea why. It somehow relates to the complexity of scenes. If I open a new collection of scene and only grab a 1080p/60 media source average time to render is like 0.4ms and the preview is smooth. As soon as I add a few additional sources, like webcam, image, browser the stuttering starts.

Just to be clear: the problem is not related to encoding/streaming or even capturing game footage. The stuttering takes place during scene rendering, and I can use a 1080p/60 video file to reproduce it, don't even need to use the capture card. My PC is pretty "overpowered" for a dedicated streaming PC I guess, but I can't really pinpoint the bottleneck / root cause.

Video: https://www.youtube.com/watch?v=AGOoHBQ7Ak8
Streams: https://www.twitch.tv/icanplaystayshun/videos/all
Latest OBS log: https://obsproject.com/logs/IAvS1HvNIuT_EUby

AMD Ryzen 7 1700
Palit GeForce GTX 1050 Ti KalmX
Elgato HD60 Pro
MSI A320M GAMING PRO
HyperX Predator HX432C16PB3K2/8 DDR4 8GB Kit (2x4GB) 3200MHz CL16

Thanks!
Nick
 
No ideas anybody?

Don't make me abandon OBS, I love it too much. Just tried SLOBS (pretty much the same stutter) and XSplit. XSplit runs smoothly so far, but I would rather understand and fix the issue and stay with OBS.
 

c3r1c3

Member
Please post a log that shows your current hardware and from a session that exhibited the issue you described. Also please post a screenshot of GPU-z (in particular the "Graphics Card" tab).

Side note: SLOBS is a less efficient/more resource-intensive fork of OBS so it will tend to have the same issues (or worse) then OBS.
 
Hey c3, thanks for the reply. Sure, here are screenshots of GPU-Z while OBS is running and rendering the stuttering scene.

1.gif
2.gif
3.gif

I did not stream again since I exchanged the 1030 for the 1050 Ti as the stuttering is the same with both video cards. That's why my oldest log is the still 1030. Only difference was that the 1030 showed ~20% load, the 1050 Ti less then 10%.
 
I think it's the FPS being too high. You can go to "setting" then video. You can drop the FPS little by little and test it. 2 minutes each test. It worked for me. No more stuttering or skipping. And i have 2 instances of obs running recording 6 monitors. Bam! lol
 
I looked deeper into the issue. Here is what I found out. Grab popcorn.

TL:DR - scene rendering is influenced by (network) file IO

1. I checked my old recordings - the stuttering started August 22nd. My stream from August 20th was still good.
2. That is the time OBS 22 got released. I can't remember when I upgraded, but when OBS tells me to update I do so.

-> seems to be related to 22 - but wait... (spoiler: it's not)

3. I downloaded the last version of OBS 21, my scene collection was still stuttering, so I started over.
4. The 60fps test video I use in a fresh scene collection as a single source runs smoothly.
5. I removed one source after another from my scene, to check when the heavy hick-up might end.
6. After I removed everything but the "Media" source for the test video it still stuttered?! Well, I changed to another collection, then back to the now one source only collection, boom, smooth video. Seems you have to "reload" scene collections by switching them or restarting OBS, simply deleting sources doesn't do the trick.
7. After knowing that I stripped my sources and voilà - after I deleted my "Image" sources that loaded images from a NAS the heavy stutter was gone. Seems there is some sort of periodically file checking that, in case it lags, influences the rendering.

-> loading sources from a NAS is a bad idea!

8. I switched all my "Image" sources to load the files locally. (I have like maybe 5 images in my scenes ...)
9. it seems everything was running smoothly now
10. switched back to v22, applying the same changes
11. the heavy hick-up was gone (hooray!)
12. now it runs smoothly, yet every ~18sec the smooth 60fps scene rendering lags a tad bit (not resulting in render lag in the stats, but you can actually see it - gonna upload another video later)
13. deleting even the locally stored "Image" sources to get rid of pretty much all file IO did not change that behaviour
13. so even with local files it seems the file IO pokes the scene rendering every once in a while. If that is every 18 seconds I can live with that. For now :)

-> conclusion
1. file IO influences OBS scene rendering
2. network file IO makes things significantly worse. stick to local files

(One totally unrelated additional hint: my test video also sometimes got rendered "choppy" just by switching scenes looking like maybe 30fps. I could get rid if that behaviour by switching "Close file when inactive" to true at the "Media" source settings. Oof!)

Thanks to everyone who looked into this!! I will stay with OBS for now :)
Nick
 
Your're welcome. :)

One more note: the ~18sec stuttering I saw in the OBS preview window does not effect the recorded/streamed video - you can see that in my "solved" video, when I start laughing about the stuttering there's actually none visible - I only saw it in the preview. So, all good now!
 
Top