Question / Help Audio/Video not in synch and cumulative lead increases over time

wa2flq

New Member
I have a FLV recording I made in which the audio leads the video and increases over time, growing to tens of seconds over the 2 hour duration The audio sounds fine otherwise, not obviously speed accelerated.

When I look at the Mediainfo and Log reports of the recording, the only thing that jumps out at me is the the video and audio frame rates differ. I don't know I managed to do this. The camera was a PTZOptics 20SDI-G2 and the audio was fed directly into the camera. I was also using the camera (not OBS) to stream on Facebook Live and the audio was in synch. I'm pretty new to this, but the audio is apparently recovered at a different rate than the video and that lead accumulates over time.

Any suggestions on how to repair the recording and also how to prevent this synch problem next time.

Thanks in advance.
 

Attachments

  • Video Medainfo Report 17Nov2018.txt
    2.3 KB · Views: 11
  • 2018-11-17 09-33-34.txt
    11.7 KB · Views: 10

Narcogen

Active Member
Do you have OBS set for the same audio sampling rate as the default on the camera? Because a mismatch without pitch shifting or other artifacts might account for gradual desync.
 

wa2flq

New Member
Thanks! I had the camera encoder set to 48000 and OBS set to 44100 Hz.

Given the mistake, is there any way to fix the video. I've been looking at the various postings about resampling to fix this gradual desyncing.
Will ffmpeg, sox or some other utility allow for this?
 

wa2flq

New Member
I managed to sort it out using ffmpeg and the following command:

ffmpeg -i Orig_Video.mp4 -filter:a "atempo=.99497" -vcodec copy Fixed_Video.mp4

The total drift in the 2+ hour video was only about 39 seconds or so. The I don't quite follow how the ~8% mismatch in encoder sample rates yielded such a minor drift ~.005%. Instead, it seems closer to the % of dropped frames I had during this recording session, or perhaps it comes from another source (NTSC 29.97 vs 30FPS ?)???

I will go back and do a test to see if the drift is gone when the encoders are all set to the same setting.

Thanks again for the assist.
 
Top