Audio to video sync time constantly changing

I noticed that the sync of sound and images on my stream always go out of sync. I have a mic that constantly goes out of sync with my lip movement and the video feed from my AverMedia capture card goes out of sync with the video (game) audio. My setup is a gaming PC connected to a streaming PC which is running OBS.

My tests have shown that the same thing happens with very short (10-15 second) videos recorded using OBS. I even created a special sync video to make sure that I am not imagining it. Here's how I did my tests and what the results where.

1. Used my sound sync video to work out that I needed a 200ms Sync Offset for my audio in to match my AverMedia video.
2. Used my sound sync video again which confirmed a 0ms difference between the audio and video (I used PremierPro to check this, image below)
in-sync-200ms.jpg

3. Restarted the streaming PC and OBS.
4. Tested again and found that the offset was now out by 150ms (350ms in total as the Sync Offset was still set to 200ms).
200ms-now-out-150ms.jpg

5. Waited a few minutes and tested again.
6. The sound was now out of sync by 430ms (630ms in total)
200ms-now-out-430ms.jpg


I have tested this using the Device Timestamp on and off. The Mic and Webcam have similar issues although the delay difference is not as large. Please can someone help? I need a stable delay so that I can set the correct sync offset.

Thanks
 
Audio comes via audio out on gaming PC to a MIC in on streaming PC. Log file attached.
 

Attachments

  • 2020-10-22 12-04-38.txt
    36.9 KB · Views: 32
Right, I am just trying something. I notice audio buffering the in the log files and had a look at the capture card settings in OBS. I have found a "use custom audio device" option that I hadn't noticed before. I will try removing my separate audio source in my scene and adding it here, as the custom audio source. I am hoping that by doing this OBS will know to keep the two sources in sync. and them it is just a matter of finding the correct (and consistent) sync offset.

I will let you all know if it works. It sounds obvious now that I have found this option, otherwise, how would OBS know what audio to keep in sync with which Video Capture Device? Fingers crossed (and everything else) that this works. At least I now have an awesome audio sync tool that I created for my testing! :)
 
No. This does not help. I can get the audio very precisely align and then is goes out of sync again, by a lot. My MIC is now more than 2s out of sync with the webcam video and OBS will not let me adjust that high. Something is very broken.
 
Looks like OBS has an issue. My MIC seems to be -360ms out from my webcam. If I adjust the audio by -360ms then the sound goes way out (seconds). If I set the offset sync back to zero the sound is permanently several seconds out.
 
I just created a basic scene in a new profile. The scene contains my capture card with the audio from the gaming machine. There is nothing else in the profile or scene. I tested this using a live stream and got the sound and audio synced perfectly to 0ms on my 3rd attempt. I then tries it again without touching anything other then starting stream in OBS and the audio is now exactly 1 second out of sync. My test streams were all for around 20 seconds.
 
I just tried disabling Window's "High Precision Event Timer" as suggested in this post and rebooted. That didn't help. The synced audio went out by 70ms on the first test and 110ms on the second test.
 

bcoyle

Member
I know that there is a constant offset between a camera video and an external mike. The Video is always delayed. But this sounds accumulative. The only thing I can think of is that the audio record rate is off somehow and that it maybe 44k instead of 48. I also found out from doing videos in the past that good cameras have the audio frame locked to the video so that you get a true 44khz,48hz audio and maybe a low cost camera has the audio record rate a little off. 47.98 vs 48khz. A good way to test this is to do a video with a clap test at the start and one at the end. In premier pro line up the first clap and audio and then see where the 2nd clap audio is. Just an idea LOL. Good luck.
 

bcoyle

Member
Just wayched a youtube tutorial on atem-mini. In it, the presenter said that he always runs the external audio into the camera and uses that. Keeps everything in sync Never uses a mic capture.
 
I know that there is a constant offset between a camera video and an external mike. The Video is always delayed. But this sounds accumulative. The only thing I can think of is that the audio record rate is off somehow and that it maybe 44k instead of 48. I also found out from doing videos in the past that good cameras have the audio frame locked to the video so that you get a true 44khz,48hz audio and maybe a low cost camera has the audio record rate a little off. 47.98 vs 48khz. A good way to test this is to do a video with a clap test at the start and one at the end. In premier pro line up the first clap and audio and then see where the 2nd clap audio is. Just an idea LOL. Good luck.
Thanks for the suggestions bcoyle. The MIC audio is coming through a studio quality RODE mic not the web camera. That is set to a sample rate of 48hz (OBS is also set to 48Hz) so I don't think it is slowly de-syncing. I have also created an app which is much more precise than clapping and I can get the sync to a perfect 0ms. However, if I record a video again or stream again on the same settings it can go out of sync immediately. This is not a progressive problem that occurs over time, it can be immediate. I looks like something is varying the delay that either the video input takes to reach OBS or the Audio takes to reach OBS.
 
Just wayched a youtube tutorial on atem-mini. In it, the presenter said that he always runs the external audio into the camera and uses that. Keeps everything in sync Never uses a mic capture.
Thanks for letting me know. Unfortunately I can't run audio in to my HD webcam. This is also affecting audio from my gaming machine as well as audio from my mic so even if I could plug my mic in to the camera the gaming audio would still be out of sync.
 

bcoyle

Member
You could run your gaming audio into the video capture card so that the gaming pc video and audio are synced. Then in obs, use the audio delay setting to sync your mic to the web cam. This would get you pc gaming video and pc gaiming audio in sync. The delay you put in the focusrite would then match you webcam. If the delay between webcam/audio and pc gaming/audio is slightly different then who cards, no one would notice. I don't do gaming so am just guessing again. Sorry if I'm not an expert on this. I also use fast encoding in the obs ap and use windows task manager to set obs.exe to high priority like you. It does help with dropped frames. Again, LOL, seriously good luck. I do a lot of editing on premier pro and love it. Also trying to set up a 24/7 automated tv station.
 

bcoyle

Member
I would also just work on the web cam and studio mike first. Get that working and worry about the gaming computer after get the web cam fixed.
 
You could run your gaming audio into the video capture card so that the gaming pc video and audio are synced. Then in obs, use the audio delay setting to sync your mic to the web cam. This would get you pc gaming video and pc gaiming audio in sync. The delay you put in the focusrite would then match you webcam. If the delay between webcam/audio and pc gaming/audio is slightly different then who cards, no one would notice. I don't do gaming so am just guessing again. Sorry if I'm not an expert on this. I also use fast encoding in the obs ap and use windows task manager to set obs.exe to high priority like you. It does help with dropped frames. Again, LOL, seriously good luck. I do a lot of editing on premier pro and love it. Also trying to set up a 24/7 automated tv station.
Thanks. Unfortunately the audio out of the gaming capture card has occasional crackles and random white noise which is why I don't feed the audio through that. I also play shooter games, and when the gun fire is out by 300-500ms it's very noticeable. Eg. You fire the gun once and then 1/2 second later you hear the gun fire. That's how I noticed the issue as the delay is so bad.
 

bcoyle

Member
Thanks. Unfortunately the audio out of the gaming capture card has occasional crackles and random white noise which is why I don't feed the audio through that. I also play shooter games, and when the gun fire is out by 300-500ms it's very noticeable. Eg. You fire the gun once and then 1/2 second later you hear the gun fire. That's how I noticed the issue as the delay is so bad.
Gotta go to the bank, talk to you later.
 
Top