How to get rid of lag?

matnheimer

New Member
Hello, I am trying to stream me gaming but I can't seem to get rid of the input lag. It's about 1/4th of a sec behind my inputs is there some setting I can change to fix that? or should I purchase a better capture card?
 

AaronD

Active Member
For digitally-processed video on a system that's doing other things too, 1/4-second latency is considered "pretty good". You'd be hard-pressed to get it much better than that. Of course it's hard to play a game like that, but for someone waving their arms behind a lectern, and displaying that on a screen behind them, it works.

The solution is to not use the stream to play the game. Play the game normally, directly, not through OBS, and just trust that OBS and everything else is working like it's supposed to. For a while, you might have someone else watch it to make sure that it's working, but you probably can't do both by yourself at the same time.

---

To get a little bit of understanding why it can't be instant, consider the frame rate. For a game, you're probably at 60fps. No point in going higher because nobody can see that fast. You're not reacting anymore at that point - you're anticipating.

Anyway, if you keep 60 samples per second, where each frame is a sample, and intentionally using the same terminology as audio, then you have 15 frames in 1/4-second. Half that for 30fps or 30Hz sample rate.

A lot of the processing that you might want to do, requires a full frame to work on because it involves neighboring pixels or moving pixels from one part of the frame to another (camera in the corner, for example), etc. Every frame buffer adds at least 1 frame of latency, and the sync step just to get all of those buffers in the first place, also adds about 1 frame by itself. So there's 2 frames already, as an absolute minimum.

Then because the same machine is doing other things too - it's playing a game, it's running the video controls, it's protecting itself from an potentially-idiot user (these things *are* sold to the general pubic, mind you), etc. - it might let several frames stack up while it does those other things, process that block all at once, and then let the output buffer play out at normal speed. However big those buffers are, adds that many frames of latency as well.

At such a low sample rate, it doesn't take very many samples worth of buffer to become noticeable. And if your system doesn't have a low-latency kernel, just the input and output buffers alone might be enough to notice already, without considering any of the processing at all.
 
Top