First post,
I've got a Divx file however the audio is out of sync by about 3 or 4 seconds. Could someone please tell me if I can correct this problem, and with what tools, methods, etc.
Thanks a lot
+ Reply to Thread
Results 1 to 2 of 2
-
-
You can scroll down to the actual page where this text came from to see the illustrations:
http://www.doom9.org/index.html?/virtualdub_procedures.htm
Manual Synching
When you're experiencing asynch movies here's what you can do. You may want to take a look at the alternative method, which should be a bit easier but needs additional programs.
Step 1: Selecting the range
First of all select Video - Frame Range. The following window will appear
Here you can select the length of your movie. So for instance if you need to find the correct Source displacement (read below) you can select the length to a couple 1000 frames instead of encoding the whole movie and then find out that your settings were wrong. Also make sure you select a fast audio compression codec (DivX audio or uncompressed PCM since mp3 will take too long for testing).
Step 2: Source displacement
Let's talk a bit about Interleaving: Press CTRL-I to see this dialog. If the video was asynch from the very beginning (otherwise go directly to step 3)you need to find the correct Source displacement. If the video is before avi (say you see James Bond move his lips but you hear "My name is Bond, James Bond" later) that means that you have to move the audio to the "left" - or apply a negative Source displacement. If the audio is before video you need a positive value. This is a real trial and error operation - I can't give you any specific hints. Just one thing: Sometime setting Interleave audio every 500ms instead of every frame helps. If you think you found the right value go to step 3.
Before I forget: It's possible that adding source displacement already gets rid of your synch problems. In that case there's no need to follow these instructions any further.
Step3: Changing the framerate
Press CTRL - R to display Framerate options.
In Video frame rate control you can change the speed of your video (audio speed is unchanged). Since your movie is gradually getting asynch (you followed step 1 and 2 I hope) we need to speed up/down the video so that it matches the audio speed. If the video is faster than the audio (a scene is happening on screen before you hear the corresponding sound) you have to decrease the framerate by manually setting a lower framerate (or increase the framerate if the audio is faster than video). Now this is a dangerous operation and I suggest you change the framerate only in very small steps (like 0.002 or so fps). Once again using a fast audio codec is greatly helping since mp3 compression takes a long time. If you can't get the movie synch changing the framerate you're screwed. But till now I've always been able to synch a movie using only source displacement and I don't believe there's any unsynchable movies.
Of course after that you need to save your avi again. Make sure you have both video and audio set to Direct Stream Copy.
Alternative way - this program can be got in the download section.
Select your avi by clicking on the folder icon. Then enter the desired framerate in the uppermost text field, or select a framerate from the dropdown list. Then press apply.
Alternative Method
This method was suggested by JD_80 in the FlaskMpeg group in Delphi.
First of all you need to get this little program, and a wave editor. Many times such an editor is already included in the software that came with your soundcard, if not I suggest you get CoolEdit or a similar software. Since there's lots of different tools to do this operation I can't supply any pictures on wave editors since it would only help a small percentage of you.
Then you will need to find to spots in the video where you can 'see' audio. Using VirtualDub find points such as doors shutting, scene changes that don't fade, or any other sudden audio changes. One spot should be as close to the beginning as possible and the other should be as close to the end as possible. Note the times in the video of these spots. We'll call these V1 and V2.
Use buttons 1 to go forward/backward frame by frame in VirtualDub, and buttons 2 to move around by keyframes. You can see the exact position in the movie in the left corner at the bottom. The numbers in brackets represent the current position in the movie, for instance 0:02:21.236 means 0 hours, 2 minutes, 21 seconds and 236 milliseconds. Make sure that you got the positions right, the more exact they are, the more exact will the synch be in the end.
Now start up a wave editor, load the wav file and find the corresponding spots. These will be called A1 and A2. Also note the total audio length, called Ae. Finally go back to VirtualDub and seek to the end of the video. Note the time here, let's call it Ve (for end).
ALL OF THESE NUMBERS SHOULD BE CONVERTED TO SECONDS!
ex. 15042.847
Once you have all these numbers, start up a command prompt, launch Synch.exe and enter the values you've calculated above separated by a space. Add as much silence to your wav as the tool tells you or cut the audio when told to do so. Use your wave editor to get this done.
Finally, after the audio is saved, follow the instructions for VirtualDub with one exception: After everything has been set up, press Control-R and select "Change so video and audio durations match".
Even though this may sound complicated, once you do it once it is really easy and always perfect synch (unless you make imprecise measurements on the audio or video)."Today is only yesterdays tomorrow"
Similar Threads
-
audio sync problem, how to work out progressive audio sync delay
By jolt321 in forum Newbie / General discussionsReplies: 13Last Post: 10th Apr 2012, 21:09 -
MiniDV Video & Audio Problem - Corrupted, Detiriorated, Missing Audio
By 4truce in forum Capturing and VCRReplies: 14Last Post: 4th Aug 2011, 06:36 -
RipBot264 Audio Problem (no audio)
By fefalas in forum Video ConversionReplies: 9Last Post: 8th Apr 2011, 10:39 -
Help With Audio Problem please!
By heidilynn08 in forum AudioReplies: 3Last Post: 16th Dec 2010, 11:08 -
audio problem
By harariman in forum AudioReplies: 10Last Post: 7th Jan 2009, 21:31