The Straight Dope

Go Back   Straight Dope Message Board > Main > General Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2004, 05:48 PM
the terminator the terminator is offline
Guest
 
Join Date: Jun 2003
Fixing audio/video sync of an AVI

In an AVI video file that I have captured, the sound is about one second ahead of the video, e.g. I hear the sound of a car door slamming about one second before it happens. The audio/video sync is fine for about the first 15 minutes, but I havent yet pinpointed the loss of sync. I really don't want to re-capture the video, because it is fine except for the audio. So, is there anyway I can restore the sync using a program like Virtual Dub or any other program? Or am I stuck having to capture all over again?
Reply With Quote
Advertisements  
  #2  
Old 01-03-2004, 07:31 PM
sailor sailor is offline
Guest
 
Join Date: Mar 2000
Audio tends to slowly drift out of sync when you capture. It was explained to me that the Audio card is using its own clock which will inevitable be at a slightly different frequency than the video. My captures result in the same effect. I believe it can be corrected with video processing software by extracting the audio and resampling but I have not bothered to do it mainly because I need to determine if it is fast or slow and by how much.

I also would be interested in simpler solutions.
Reply With Quote
  #3  
Old 01-03-2004, 08:21 PM
MMMason MMMason is offline
Guest
 
Join Date: Jul 2001
This link which i saw in www.divx.com should give you a starting point.

http://www.dvdrhelp.com/sync.htm

If you don't have those programs, there is a link near the bottom that shows more sync solutions.
Reply With Quote
  #4  
Old 01-03-2004, 08:21 PM
squeegee squeegee is offline
Guest
 
Join Date: Dec 2000
The sync problem may have happened when the file was captured. OTOH, the file may be fine, the sync is drifting as it's played back.

A quick way to tell which is the case: while the file is playing back, wait for the sync loss to become noticable. When that happens, pause/stop playback, and then restart it at the same point. If the playback is still out of sync, it's probably the file. If playback of the same segment is now in sync, the player you're using is drifting sync during playback.

If it's the file: there are various tools you can use to fix the audio to again be in sync with the video -- Premiere, Sound Forge, etc -- but I'm not aware of any free ones.
Reply With Quote
  #5  
Old 01-03-2004, 08:45 PM
the terminator the terminator is offline
Guest
 
Join Date: Jun 2003
I have Premiere. Do you know how to fix it with that?
Reply With Quote
  #6  
Old 01-03-2004, 08:58 PM
Ximenean Ximenean is offline
Guest
 
Join Date: Aug 2001
Quote:
Originally posted by sailor
Audio tends to slowly drift out of sync when you capture. It was explained to me that the Audio card is using its own clock which will inevitable be at a slightly different frequency than the video. My captures result in the same effect. I believe it can be corrected with video processing software by extracting the audio and resampling but I have not bothered to do it mainly because I need to determine if it is fast or slow and by how much.

I also would be interested in simpler solutions.
It's true that most audio/video sync or frame drop problems are caused by the difference between the sound card's clock (inevitably slightly inaccurate) and the implicit, extremely accurate, clock of the video signal. However, if you're not worried about adhering to the standard NTSC 29.97 fps frame rate (25 fps for European PAL), and you use a capture utility such as VirtualVCR which allows you to regard the sound card's clock as the master clock, you can capture hours of video in perfect sync, without dropping a single frame. You end up with a perfect AVI file that runs at a slightly non-standard frame rate, e.g 25.002 fps for PAL video when it should be 25.000, an imperceptible difference.
Reply With Quote
  #7  
Old 01-03-2004, 09:31 PM
squeegee squeegee is offline
Guest
 
Join Date: Dec 2000
Quote:
Originally posted by the terminator
I have Premiere. Do you know how to fix it with that?
Well, first you need to determine if you're dealing with a badly captured file, or bad playback. See my post above. If it's bad playback there's nothing to fix in the file. Try updating your audio drivers, I'm not sure what else to try.

(Question: is this file DV video? Something else?)

Next, determine if the sync loss is a slow drift or a sudden shift at some point in the file.

If it's a sudden shift, the fix is to insert silence or remove some audio to restore sync. Find the spot in the file where the audio time shift occurs, and find a sync point in the file that can be used for reference (such as that car door slamming you'd mentioned. Unlink the audio from the video (clip menu->unlink audio and video), then use the razor tool to slice out some audio or slice the track and move it to insert silence so that car-door-slam matches up with the video.

If the problem is a slow drift of sync, you need to unlink the audio from the video, then change the speed of the audio portion to match the video (clip->speed). This requires some experimentation. You can also you the time stretch tool to accompish this.
Reply With Quote
  #8  
Old 01-03-2004, 10:15 PM
the terminator the terminator is offline
Guest
 
Join Date: Jun 2003
I have determined that the loss of audio sync is from a bad capture. To answer your question, it is an AVI that I captured from a VHS tape. I'm pretty sure that it is a very gradual drift of sync because the sync is worse near the end of the video than where I noticed it earlier. I'll try your suggestions for Premiere.
Reply With Quote
  #9  
Old 01-03-2004, 10:32 PM
the terminator the terminator is offline
Guest
 
Join Date: Jun 2003
When I alter the speed of the audio, even by just one percentage point, it results in a drastic change in audio sync. Is there something i'm not doing right here?
Reply With Quote
  #10  
Old 01-04-2004, 01:02 AM
squeegee squeegee is offline
Guest
 
Join Date: Dec 2000
No, you're on the right track. A 1% audio shift over, say, 30 minutes would shift the end of the audio clip by ~.6 seconds, which is a very noticable shift. If I'm not mistaken, the Premiere speed dialog accepts decimal entries (e.g. "100.1"), so you may need to try fractional speed changes.
Reply With Quote
  #11  
Old 01-04-2004, 09:22 AM
sailor sailor is offline
Guest
 
Join Date: Mar 2000
>> A 1% audio shift over, say, 30 minutes would shift the end of the audio clip by ~.6 seconds,

If I am not mistaken a 1% shift over 30 mins would be 0.3 mins = 18 seconds which is huge. A 1/1000 shift would be 1.8 seconds which is still huge. A 1/10,000 would be 0.18 seconds which is still quite unacceptable. A 1/100,000 would be 18 ms which is noticeable but at least you can follow what's going on. A 1/1,000,000 is the least to be considered acceptably good.

That is over 30 mins. Over 2 hrs you need an order of magnitude higher.
Reply With Quote
  #12  
Old 01-04-2004, 10:08 AM
the terminator the terminator is offline
Guest
 
Join Date: Jun 2003
I tried inputting decimal values and it won't let me enter a decimal point.
Reply With Quote
  #13  
Old 01-04-2004, 02:59 PM
the terminator the terminator is offline
Guest
 
Join Date: Jun 2003
Well, i've pretty much given up on fixing the file and I am just going to capture again. Does anyone have any suggestions on how to not lose audio sync, other than the suggestion involving PAL capture?
Reply With Quote
  #14  
Old 01-04-2004, 03:19 PM
sailor sailor is offline
Guest
 
Join Date: Mar 2000
I would either (a) capture video and audio separately or (b) separate them once captured and then (c) process the audio separately until it matches the video and then combine them again. This is not complicated using Gordian Knot and associated crap.

Just now I extracted the sound of an AVI to a separate file using Besweet and using COOL Edit I stretched by 1/10,000 and saved it again. No problem there. If you need an audio file stretched just email it to me and tell me by how much.

if I had a couple of nice markers at beginning and end (like clapboards) it would be a piece of cake to resync movies. The problem is that you have to keep guessing and trying. I do it with subtitles all the time and it is easier but still a hassle.
Reply With Quote
  #15  
Old 01-04-2004, 03:22 PM
sailor sailor is offline
Guest
 
Join Date: Mar 2000
if you capture again with the same system you will get the same result. Same causes leading to same effects and all that.

Just extract the audio using Besweet and we can stretch it to whatever you need.

Unless you can extract it in a different manner which will preserve the sync.
Reply With Quote
  #16  
Old 01-04-2004, 08:44 PM
squeegee squeegee is offline
Guest
 
Join Date: Dec 2000
Quote:
Originally posted by sailor
If I am not mistaken a 1% shift over 30 mins would be 0.3 mins = 18 seconds which is huge. A 1/1000 shift would be 1.8 seconds which is still huge. A 1/10,000 would be 0.18 seconds which is still quite unacceptable. A 1/100,000 would be 18 ms which is noticeable but at least you can follow what's going on. A 1/1,000,000 is the least to be considered acceptably good.
<bangs head on desk>Gak. Note to self: check math before posting.

Thanks sailor.
Reply With Quote
  #17  
Old 01-04-2004, 08:46 PM
squeegee squeegee is offline
Guest
 
Join Date: Dec 2000
Quote:
Originally posted by the terminator
I tried inputting decimal values and it won't let me enter a decimal point.
Hmmm, the current version of Premiere ("Pro") let's you enter a decimal. I'll see if I can find a workaround if you tell me what version you're using.
Reply With Quote
  #18  
Old 01-04-2004, 08:49 PM
squeegee squeegee is offline
Guest
 
Join Date: Dec 2000
Or what sailor said would work -- extract the audio and then stretch it using a separate audio program. Then reintegrate using that app or Premiere or whatever. It's a piece of cake if you have an obvious sync point, such as a clapboard or someone clapping, a slamming car door, whatever.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2013 Sun-Times Media, LLC.