Wednesday, February 18, 2004
Fixing Audio Drift
While most things seem to be working well at the moment, I do seem to have a slight audio drift on longer captured segments (prior post). According to the log file generated by VirtualVCR (my settings):
Capture file is 50m38s, 91025 frames, zero dropped (according to VDub, Video is 50m 37.20s and audio is 50m 37.11s) Video rate is 29.969246 Audio rate is 44103.361847 AV Diff is -0.000101
Well, besides the fact that I'm capturing at 44.1kHz instead of DVD standard 48kHz (whoops!), the 44103Hz and AVDiff of -0.000100 is pretty standard for every capture I've done recently. So it's predictable. Video rate is always 29.969 which is also close to spec.
Now, the easy fix is to try stretching the audio in Cool Edit 2000 from 3037.11s to 3037.20s. End-result would be to push the audio later in the action (e.g. if a gun flash appears after the sound for the gun flash, now it should be synced up).
On this particular clip, audio trails the video bit a tiny bit (better at the start of the 50 minute clip, worse towards the end). So stretching is actually the wrong thing (even though the audio is shorter then the video). I need to reduce the audio rate by 0.207s (3037.119 * 44100/44103 = 3036.912) if my calculation is correct.
An alternative calculation is to also take into account the video rate not being exactly 29.970. So 3037.119 * 44100/44103 * 29.970/29.969246 = 3036.989 or -0.130s. That might actually be pretty darn close (I'm betting that the neg 0.207s correction is going to be too much).
Oh, and when you go to interleave the video back in using VirtualDub... make sure that "Audio, Full Processing" is turned on to make sure that it uses the WAV source instead of the source audio from the AVI. (At least, I think this bit is required.)
Another (possible) tip: In order to test, you should create a new AVI with the new audio track mux'd back in. In order to save space, try using the fast-n-dirty "2:1 reduction" filter (not the high quality one). That should only take 1/4 of the space of the original AVI and might help if your test is disk-constrained rather then CPU constrained. On my Athlon 2600+ with 5400rpm 160Gb ATA/100 drive, it's neck-and-neck whether it's better to do it as straight-copy or to reduce it 2:1.
Even easier method using VirtualDub to check sync:
1) export your WAV, change the length, save back as WAV 2) open up your AVI in VirtualDub 3) change Audio to "Full Processing", select "WAV..." as the source, pick your WAV file 4) queue up to a good checking spot, click the "play input" button
That skips the need to re-mux the audio in order to do a quick check. You'll probably still want to do a close examination once you re-mux what you think is your final guess.
posted by Wuphon's at
2:08 PM
|
|