Bug Report Audio/Video out of sync

woenx

New Member
I tried OBS Studio to capture a V4l2 stream, so can I record some VHS tapes in digital form.

I have been able to configure OBS studio properly, and I can capture the stream, the sound, crop the image, set my preferred resolution, and the codec I want to use. So far, so good.

The problem is that there is a delay between the audio and the video (around a second, maybe). The delay appears both when you are watching the stream through the OBS interface, and after recording that stream. It is not a problem of the capture device (a cheap Digitnow! USB 2.0 Audio / Video Converter), because capturing videos through other software like VLC, qv4l2, GTK UVB video viewer, or webcamoid, works just fine, with the audio being perfectly sync'd.

I also tried to add a sync offset in the advanced audio properties, which didn't seem to do anything (even if I used ridiculous values, like 10000ms, the delay was exactly the same). I also tried to add a "Video delay" filter to the capture device, but that did not help either. I even tried reinstalling the software again after deleting any configurations, but even in a clean install the issue is still present.

I am using OBS Studio 24.0.6 in Ubuntu 18.04 LTS, installed through the snap store.

Does anyone have an idea what could be happening? Thanks in advance
 

woenx

New Member
Ok, I have been trying to find out at what point the audio and video became out of sync (the video is generally delayed). At first I thought it had to do with changing the resolution of the canvas or the output, since, from a fresh start, the audio and video seemed to be well synchronized, but after changing the resolution, there was a delay again.

Then I realized that restarting OBS studio, with the last used resolution, the problem was gone. Until I changed the resolution again. Weird.

After much experimenting, I realized that I was stopping the VHS player, rewinding and playing the same section again (where one person was talking, so it was easier to see if the video was in sync). You can also rewind without stopping the video, but it's a bit slower (because the picture is still shown on the screen). I noticed that, after stopping and playing the video, the delay was there. Even if I didn't change the resolution. However, If I just rewinded and played the video, without hitting the stop button, there wasn't any synchronization problem.

So the next step was to rule out if the problem was coming from my capture device. I opened VLC and used it to view the stream from that capture device. I could stop, rewind and play it, without any synchronization problem. So it's definitely not a hardware problem.

So, OBS studio shows a delay in the image after the tape is stopped and played at some point after starting OBS studio. If the tape is currently stopped, then you start OBS studio, and then you hit play, there is no problem. When there is a delay, restarting OBS studio solves it, as long as you don't stop and play the video during the same session.

By the way, I captured a log file, but I don't think you'll see anything relevant, because of what I just said: https://obsproject.com/logs/Butr5CDO_md23r0x
 

woenx

New Member
Ok, thanks to the kind people of the discord channel, someone suggested to disable buffering in the v4l2 capture, and it did the trick! Now the audio and video is no longer desynchronized when the tape is stopped and played again!
 

Gordon.b2

New Member
I have done a fresh install of Linux Mint and install OBS flatpak version 24. 0.3 modified (64-bit) there seems to be a delay between the video and sound.

The sound is in front of the video when played back, when recording a video game or even using the webcam.

When I plug the other SSD in to the same machine replacing the original SSD with MX Linux installed OBS version 0.0.1 (64-bit) this works perfectly ok.

so it's not the hardware that's involved it's got to be something between flat pack version and the Repo installed version.

I do not want to do an update to the version 0.0.1 (64-bit) on my MX drive because there is a possibility that we may run into the same problem as reported below

The operating system on both SSD are up-to-date at this present time.
 

MissingPerson

New Member
Necroing this.

I have the same issue with now with my audio desync getting progressively worse. Disabling buffering did not do the trick. The audio also sounds like it's playing slower than the actual audio that would output from my monitor.

For the record, I have to use PulseAudio Input Source to get the audio at all. On Linux Mint 19.3
 

SubbrSchwob

New Member
Same here. I use Jack audio. OS is Kubuntu / kx Studio 18.04. I can adjust the latency in the audio settings of OBS. However, when I restart OBS or my computer, I'm often 300 to 500ms off again. It's not deterministic and thus useless.

I use 25.0.2, which is said to be broken, but on 26.0.2 V4L2 does not work for me with OBS, so it is even more broken. I filed a bug.

People say the solution is to use a OS X.

Hence I'm looking for an alternative that can successfully capture video from V4L2 devices and ALSA or JACK audio and stream them via RTMP. Audio latency is OK, this can be compensated for, but compensation is useless when I need to fetch the clapperboard on every start of OBS. Recently I had to restart 2 min before broadcast, the next 60min where out of sync, no more time left for the clapperboard and recording and listening and adjusting.
 
Top