Audio sync drift when recording

Audio6

New Member
Hi all,

I am a long time OBS user and well aware of CPU/performance issues of video encoding. The first pinned post from 2015 is on these issues.

Recently I started to do recording (not streaming) with OBS to save time on post processing video and audio files from separate sources, but I failed to get a consistant audio sync in my recordings. The issue is a variable delay that cannot be fixed by any sync offset value. The offset is all over the place, I measure it in a video editor, correct it and in the next recording it is off again by some other value.

My setup:
Video: DSRL - HDMI capture card - 25 fps 1080p (no rescaling), MKV with NVENC H.264 on a RTX 3050 with a Comet Lake i5 CPU (Windows 10)
I used differend encoder settings, but that had no stable effect on my issue.
I do not use a custom audio device, but record audio from a separate source.

Audio: USB microphone mapped to audiotrack 1, OBS and system audio set to 48kHz

I assume that this setup has way enough power for a FullHD recording, but assuming is not knowing. Can someone please confirm from own experience that using OBS for recording FullHD video with separate USB audio indeed works with a sync error below 10ms? If yes, what hardware are you using?
 

Audio6

New Member
After a lot of frustration and several hours of wasted time for testing I quit and tried again some days later.
I configured my setup from scratch and I cannot say what exactly fixed the problem, but now the recording sync is ok.

My settings:
HDMI capture YUY2, 25 FPS, FullHD
Output Recording Encoder: NVENC H.264 with FFmpeg AAC (default was coreaudio AAC)
CQP CQ Level 15
Preset P6, high quality, two passes (QR), Profile high, rest on default
Streaming Encoder as above but with a CBR setting (probably not relevant for the recording case)
Audio settings: 160 bps (default), General: 48kHz stereo
Audio source advanced properties: 170ms offset mono (it is a USB-Headset) mapped to track 1
 

AaronD

Active Member
My setup:
Video: DSRL - HDMI capture card...
...I do not use a custom audio device, but record audio from a separate source.

Audio: USB microphone mapped to audiotrack 1, OBS and system audio set to 48kHz
It's not a cheap, no-name, USB capture card, is it?

I used to have 4 of those on one of my rigs. They were always out of sync *with each other* by random amounts and different directions every time.

Plus, I found out that they were not actually USB3 as advertised, but they actually had a USB2 chip behind a genuine (and well hyped) USB3 *connector*. You can't get HD video through USB2 without squashing it first, *in the card*, before it even gets to the PC at all, and so the quality wasn't so good either. I didn't notice that for a while because I was focused on making the rest of the rig work.

A 4-input PCIe card fixed both issues. Good picture, and constant latency.
 
This is yet another one of the myriad problems I encountered when I recently started making videos.

If your solution is the same as mine, it's to uncheck "Use Device Timestamps" for your audio source. I think it's unchecked by default for new audio sources you add (but you may have checked it manually, like me) and checked by default for Desktop Audio (I later unchecked mine, but I don't think it mattered).

Since I'm not an expert, I'll end the explanation here and let you search around on this forum for other posts that explain what "Use Device Timestamps" does in more detail.
 

Audio6

New Member
Yes, I use a "genuine" USB3 capture card (from Razer) and I do not have any issues with video stream delays or degraded quality due to compression. I also have an Elgato Camlink that works without issues. I configured a correction of about -3ms for the audio coming via the camera to be perfectly in sync, but my HDMI audio has always been stable and never drifted.

I also do not use the device timestamp feature as it is not really documented what the prerequisites are. The audio capture devices must support providing reliable timestamps. However, not all devices or drivers may offer precise timestamps, and in some cases, the timestamps could be inaccurate or introduce more issues. Thank's for pointing out that this caused even more troubles in your case.
 
Top