Question / Help Audio gets out of sync

bioniclear

New Member
Greetings!
I have this problem with my audio getting out of sync with video. At first it's ok, but during longer recording/streaming sessions my audio gradually gets out of sync. It's not that bad if my microphone audio gets out of sync, but it's very annoying when the game's audio is delayed. I have tried lowering my settings and updating OBS Studio, nothing worked. I have this problem with all games, both modern and old.
I'm not sure, but I think it started happening when I switched from standart OBS to OBS Studio.

I'm attaching a log file:
https://gist.github.com/anonymous/e8e592b67d518fa50475ad0e8bea569c
The problem wasn't that severe during that session, but during the end of the recording audio is dalayed by around 0,5 secounds.

I've been looking for solution to this problem for a long time and nothing helped. If it wasn't for this audio problem, I'd use OBS for all of my recordings.

Thank you for your time!
 

MadVaper

New Member
I had a problem like this awhile back. What fixed it for me:

• Click on the gear icon next to Desktop Audio and/or Mic (Near the volume sliders)
• Click on Properties
• Check/Uncheck the box for Use Device Timestamps

Hope that helps.
 

bioniclear

New Member
Sorry for late reply, didn't have much time to test.

I think I messed with timestamps before, but still I tried turning them off and now my recordings are mostly okay. I recorded some 1,5 hour long videos and audio seems to be fine, but audio still gets out of sync with the game that had it the worst before, though the problem is not as severe anymore. But there's still something...

*EDIT* - Recorded some more, everything seems fine now. I guess problem fixed itself / turning timestamps off worked.
 
Last edited:
I fixed that problem by increasing process priority.
I increased it as high
If you use hardware encoder(NVENC,QuickSync,VCE), then performance hit is almost none
 

RodrigoPolo

New Member
I have the same problem, but I can't find the checkbox option for "Use Device Timestamps", I'm using OBS 22.0.3 for macOS, currently with macOS Mojave 10.14:

t01.png

t02.png

I did a 3 hour long Facebook stream, one hour into the stream and the audio started to jump or skip for less than a second, one hour and a half into the stream and the audio got almost 3 second delay, two hours into the stream and the audio went completely off, even with the OBS monitor option off, I stoped and quickly restarted the stream from OBS and all problems were fixed, and luckily the Facebook stream didn't stopped.

I used:
  1. A MacBook Pro (Retina, Mid 2012) with a 2.6GHz Intel Core i7 (4 cores 8 threads) 16GB of 160MHz DDR3 RAM and a NVIDIA GeForce GT 650M 1024MB video card.
  2. A 38Mbps (4.77MB/s upstream) internet connection.
  3. A Blackmagic Design UltraStudio Mini Recorder with SDI 1080p 29.97fps 4:2:2 video and audio input signal.
  4. OBS Settings:
    1. 1280x720 resolution for the canvas at 29.97fps.
    2. 1280x720 base resolution for the Blackmagic card at 29.97fps.
    3. x264 video codec at 3872Kbps with "veryfast" CPU priority and 1 second for keyframe interval (aka 30 GOP).
    4. AAC audio codec at 128Kbps.

t04.png

internet.png

What else could I do to prevent audio falling out of sync?
 

Vaesive

Member
@RodrigoPolo I'm having the exact same issue but I am on PC. Video and audio sync is fine for about an hour then it gets slightly off but gets worse over time. The video stays the same but the audio progressively gets faster and faster. I'm going to attempt to do some audio editting to try and rematch the video but doing this matching every 5-10 seconds at changing speeds for 2+ hours of video sounds like a nightmare.

Here's a stream for reference: https://www.twitch.tv/videos/398222291
Everything is fine up until ~ 1:31:00. Then skip to around 2:12:00 and you'll see how bad it starts getting.
 

Burgunbeerd

New Member
I'm having the same problem but I'm using multiple microphones. They're sync'd fine to begin with but after a while the delay between them is super noticeable (2 mics because 1 mic per person on stream sometimes a 3rd mic)
They're different mics but I didn't think it'd get so bad. Have tried everything I can think of including the above timestamp fix
 

Kevin Neufeld

New Member
I'm also having the exact same issue, also on a PC. Streaming to YouTube, after a while the audio starts drifting out of sync. If a viewer refreshes their browser the audio is back in sync again, but obviously only for the one viewer.
I'm using a AVerMedia Live Gamer PCIe card to consume an HDMI feed with audio. The card is performing the encoding.
It usually happens when there are a few dropped frames - the video frame rate drops but the audio does not.
 

Paul Daniels

New Member
Same problem (well, seems to be the same) on linux Ubuntu 19.04; i5-8400 machine 16GB RAM, 100/40Mbps line and I've tried streaming to YT from 4000kbps - 6000kbps; after about an hour the audio shift is problematic (500ms or more), sometimes gets as bad as 2~3 seconds.
Restarting OBS and reconnecting to the stream resyncs things but it'll drift out again still.

3 USB cameras ( C922, C920, and a Microscope camera ), one audio source active ( Samson wireless USB microphone )
 

Neto DG

New Member
Sorry for late reply, didn't have much time to test.

I think I messed with timestamps before, but still I tried turning them off and now my recordings are mostly okay. I recorded some 1,5 hour long videos and audio seems to be fine, but audio still gets out of sync with the game that had it the worst before, though the problem is not as severe anymore. But there's still something...

*EDIT* - Recorded some more, everything seems fine now. I guess problem fixed itself / turning timestamps off worked.

Are you a Mac or a PC user?
 

JesperBon

New Member
I am having the same problem. I use elgato cam link on a PC. I livestream icehockey matches and the lenght of the stream is aprox 2 hours. In the end of the match the audio is around 5 seconds delayed.
 

SampleX

New Member
Anyone find any solutions to this?

I'm having weird problems using OBS for a church. They're wanting to get closer and closer to livestreaming meetings during Covid isolation and looking to routinely stream once Covid is over since the investment has now been made. So far we've produced straight videos for posting on Vimeo and I've set up very basic scenes with still graphic elements which I can fade in and out manually with custom fades for beginning and end titles and in-video caption/on-screen branding (wish there was a way to automate a timeline of these scenes using custom frames so I don't have to sit over the entire recording handling everything manually)...

Anyway, we have elgato CamLink4k's waiting to connect three cameras when we go 'full live', but in the meanwhile we're recording segments on a 4k Panasonic VX980 in 1080p/50 with sound provided direct to camera via Rode WirelessGo. The video we're getting is great and the sound levels very nice.

The first video we produced didn't seem to create any problems. It was recorded in AVCHD and brought into an Alienware 17r4 by merging the files in Lehmann Video Tool straight from the memory card before being trimmed in Avidemux and recoded to MP4 in Handbrake. We then dropped it into the OBS project (wouldn't it be nice to be able to have multiple independent projects saved and opened and closed on demand, multiple formats of different types of segments etc?) as a media source set to begin playing when loaded in it's scene and once running we use and fade between multiple scenes all running the same media source but with various overlay graphic elements, giving the illusion of the elements themselves fading in and out on top of the video.

The end result was really a good demonstration of what we wanted to produce and of course even if we were livestreaming we'd want a high quality 'show' for archive or on-demand at Vimeo. I didn't notice any considerable issues as I sat over the project, and the recorded output went straight on Vimeo, quality settings that were set by default gave us a 2Gig video file out of just about 58 minutes of material. I noticed while playing back the video from Vimeo over very fast broadband but on mobile devices and computers of varying quality that throughout the soundtrack there were very noticeable loud pops quite frequently which were not present in the source video.

I put the issue down to some weird injection of artifacts in the multiple edits and transcodes of the source AVCHD, and decided this week to record the two sessions required direct to MP4 !080p/50 in the Camera so as to remove the additional handling of the files in editors and demuxers and so on.

So I brought the MP4 directly into OBS and dropped it right into the scene as before.

Though nothing has changed in the system, I noticed this time from the outset that the 'preview' of the content, the 'live monitor' if you will, was suffering from many of these periodic pops and also 'dropping frames' or skipping visually at the same time. I had about five attempts, each one producing similar but not identical results and eventually concluded that I could no longer keep aborting efforts after ten minutes, but had to lay down the full hour regardless of the issues, because people were waiting for the 'episode' on Easter Sunday.

So I ran out a full length version and most of it ran fine other than the pops and frame stutters until it got to about halfway or two thirds and then the audio became really out of sync with the video, off by a good second and a bit by the end of the video. So I had four more goes at it, constantly tweaking settings and closing and reopening the app.

I'll add at this point that streaming was obviously not enabled and I was just capturing to the video recording. The only thing that made any difference to the amount and severity of frame drops was when I switched the laptop from a very ropey wifi connection to a weak wireless router to a wired connection to the gigabit network with fibre broadband (fast) and bound OBS to the laptop's ethernet adapter. I understand this making a difference in streaming due to the adaptive throttling the app may be anticipating from the crappy wifi signal?

Yet still, each and every time, no matter the settings, the live monitor preview of the 'show' was popping and framedropping and going badly out of sync, and I was literally - at 1am - tearing my hair out about being unable to produce consistent results in OBS, when on a hunch I thought I'd run all the videos OBS had output through a media player (VLC) and I'll be damned, but the recorded videos are in sync all the way throughout. Still got subtle pops and frame drops or skips encoded into them, more apparent on some devices than others,, but no sync drift whatsoever...

'Stream' monitor is nasty... but video recordings are so very much better.

Anyone with any ideas why, or how to bring the two back in line with each other? Where am I going wrong?
 

Narcogen

Active Member
This should be its own thread. This thread is already 3 years old and the only similarity between your problem and theirs is coincidental.

(wouldn't it be nice to be able to have multiple independent projects saved and opened and closed on demand, multiple formats of different types of segments etc?)

This is what scene collections are.

So I brought the MP4 directly into OBS and dropped it right into the scene as before.

You dropped a 2GB video into OBS.... why?

OBS isn't a player or a video editor. There's no good reason to record such a long and large file and then load it into OBS. OBS for compositing, switching, livestreaming and recording.

It's quite easy to record a file so heavy that Windows' default player chokes on it and stutters and pops. If VLC plays it, the file is OK.

If your audience can't play it, then you're streaming at too high a bitrate.
 

SampleX

New Member
You dropped a 2GB video into OBS.... why?

Seemed like a logical way to use an OBS Config which was designed for livestreaming a programme involving a live captured HDMI source, to produce the intended programme which could be recorded, except using a pre-recorded file rather than the live HDMI capture.

Was that not logical?

OBS isn't a player or a video editor.

Indeed, and I'm not quite sure where I conveyed the impression that I thought it was a player OR a video editor.

There's no good reason to record such a long and large file and then load it into OBS.

There's an excellent reason to do it. The reason is that instead of live-streaming HDMI captured video streams you are instead broadcasting pre-recorded video, which can have a number of very credible uses for regular content producers releasing content in scheduled streamed events which may be curtailed by illness, technical difficulties, or problematic travel schedules for which pre-recorded content may be an apt substitution.

In this case the inability of the principal subject of the programme being unable to be in the recording facilities at the time the programme was put together was substituted by a video recording made to the length of the intended segment offsite, and then brought into OBS in the form of the resulting MP4 file.

Without a prior indication of OBS being incapable in some way of handling video files it was clearly designed to import and make use of, and no indication of a recording length limit or some other issue, why would I NOT think it was a logical methodology?

OBS for compositing, switching, livestreaming and recording.

Compositing... yes.

Switching... yes.

Livestreaming... well... that part would appear to be merely one of two options offered by the software and merely a technical opportunity at that when critically...

RECORDING... is the 'primary' function, surely - the programme is either streamed, or stored in real time (like a virtual recording head), or indeed both, but either way the function is essentially the same as recording. One path stores data in archive, the other forgets it as soon as the current frame becomes past tense. Volatile or non-volatile data, as it were.

Why would that seem to be an illogical expectation?

Does it not seem reasonable that a system which is designed to produce this kind of content AND record it as well as livestreaming it might be expected to be able to do both with synchronicity? Why would I expect the livestream display - or to be properly correct about it, the 'live monitor' of the recorded content - to go seconds out of sync with the recorded stream itself?

It's quite easy to record a file so heavy that Windows' default player chokes on it and stutters and pops. If VLC plays it, the file is OK.

Curiously enough, the file was not 'so heavy' that Windows default player chokes on it and stutters and pops. Only OBS is stuttering and popping. VLC plays the file just as well also, and indeed I've tried to produce this content using the video file loaded directly as a media file, and also as a VLC playlist. Same result. Recording is nearly perfect. Livestream 'preview' is stuttering and popping and frame dropping and slipping way out of A/V sync. Yet producing a recorded file that isn't desynchronising at all.]

If your audience can't play it, then you're streaming at too high a bitrate.

The audience love the file, thank you. It goes straight from the OBS recording into Handbrake to make it a bit skinnier, and then right on to Vimeo. Streams a charm.

Still doesn't explain why OBS is dropping frames and desynchronising AV which is what I'm trying to beg advice to work out, since I wouldn't like to be three quarters into a livestream using this same programme format, and find that it starts doing it with an hour long HDMI capture, like it did with the pre-captured MP4 file.

Logic tells me that playing back a one hour MP4 file of pre-recorded content as a source in OBS should be less intensive than capturing it in real time simultaneously with all the OBS broadcast function and composite recording, no?
 

hfuller

New Member
I am grappling with the audio sync problem too. I am testing a different configuration: disable the audio source that is a part of the video source, and instead, add it as an audio source in the OBS preferences (e.g., add it as Mic/Aux 3, and mix with that). Maybe give that a try.

Logic tells me that playing back a one hour MP4 file of pre-recorded content as a source in OBS should be less intensive than capturing it in real time simultaneously with all the OBS broadcast function and composite recording, no?

Not really. I recommend configuring VLC to use a separate playback window, then do a Window Capture on the VLC playback window. This will allow you to more closely replicate your live setup, you will just replace one of your camera captures with the VLC window capture. This has worked well for me for the past 5-6 years.
 

Tomdabomb9

New Member
I'm having the same problem with the Ultrastudio Mini Recorder connected through Thunderbold and Focusrite Scarlett connected through USB on a Mac 8gb. My videos are only 10-15 minutes long but still by the end the audio is way off! Any solution would be very much appreciated.
 
Top