Video delay (lip sync) increases during streaming

gracion

New Member
I'm setting up a Facebook Live stream of a Zoom call, captured in OBS to include video playback and titles. It basically all works, I capture video from the Zoom window and input Zoom audio via Rogue Amoeba Loopback. Not surprisingly, I needed to add some delay to the audio for lip sync, about 250ms looks right (in Advanced Audio Properties).

However, after 10 minutes or so, I can see that the video is getting later compared to audio, and after 20 minutes it is about a second behind. Changing the delay (not that I'd do it in a live production) does not seem to have any affect until the stream has been stopped and started.

As a test, I played a looped timing test video in QuickTime Player and captured its window in OBS without streaming or recording. By video recording the screens, I measured the delay between the QuickTime Player window and the OBS display. This slowed down some (0.2 seconds over 10 minutes), then remained the same for the next 15 minutes. My measurement could be off by .05 but not more than that.

I'm on a 2019 32GB MacBook Pro that's only using 15-20% CPU and about 15% GPU, so I don't think it's lack of power or RAM.

Is there any way to prevent the video from falling behind over time?

Logs: local test: https://obsproject.com/logs/GWesdBaFfr9n7JXt
Facebook Live: https://obsproject.com/logs/jhTcCjAnP5EKCTMz

Thanks!
 

nottooloud

Member
I don't have any answer, but a few observations.

Your local test isn't producing the same delay as your stream, right? Create a test that does. Is Zoom the difference?

I'm certainly not an OBS guru, but I'd think you should be able to see in the log when OBS adds more delay. I see a couple 21ms bumps, but nothing adding up to a second. Puzzling.

Frame rate and sample rate clashes can cause changing latency. What frame rates are those videos you're loading? 29.97 and 30 fps, for instance, are not the same. Somewhere, somehow, the software has to realign things.

I've been able to resync sometimes, without stopping the stream, by disabling and re-enabling a camera, particularly if it was an RTSP feed camera. They tend to wander anyway.

This is one reason I bought vMix. All my wandering delay issues went away.
 

gracion

New Member
Thanks for the helpful suggestions nottooloud! I did more testing today by recording in a couple of configurations.

I noticed right away that *screen* capture seems to have less delay than *window* capture, and using screen capture, I did not experience any change in video delay like I saw yesterday (obviously OBS is on a separate screen). (Another factor was some ISP issues—certainly stream packets were lost and perhaps this was bad enough to influence OBS). It looks like I'll be fine. I'm very happy with lip sync today.

To answer your question about FPS: My testing did not include playing the video directly, but on a separate computer captured via camera and delivered by Zoom meeting, just as the live participants will be. So the video was 30FPS but OBS has no way of detecting that, it's just a moving image.

I've used WireCast, Tricaster, and for that matter, a Grass Valley 1600 (like the one seen for 1 second on the Death Star). OBS is impressive!
 

gracion

New Member
For the record, additional tests have all gone fine. I'm running 150ms audio delay on the zoom capture, but it feels instantaneous (comparing the zoom window itself and the output), I may not even need that much. Our program is on MLK Day if anybody wants to watch and see how my live stream from OBS goes (starts around 3PM Pacific): https://somlk.org
 
Top