Vintage Erotica Forums

Vintage Erotica Forums (http://vintage-erotica-forum.com/index.php)
-   Tutorials (http://vintage-erotica-forum.com/forumdisplay.php?f=27)
-   -   Fixing out of sync audio in AVI files (http://vintage-erotica-forum.com/showthread.php?t=176497)

Denaniel September 18th, 2011 06:50 PM

Fixing out of sync audio in AVI files
 
You downloaded a vid, but the audio and video are out of sync; i.e. the audio is either too early or too late.

Example: if you hear someone speaking, but you don't see their lips moving until a second or two after you hear the words, then the audio is early and needs to be delayed.

There are freeware apps that can time shift the audio for you without re-encoding, and normally it only takes a few minutes to fix. The app that I'm most familiar with is called VirtualDub.

Download VirtualDub here.

Play your vid in your favorite media player and try to find a scene with a short, sharp sound. Like a door or car door or kitchen cabinet slamming shut, something exploding, a dropped object hitting the floor, etc. Estimate the number of seconds the audio is early or late, and write down the runtime of that moment with the short, sharp sound.

Open the AVI file in VDub: File menu > Open video file...

Drag the little rectangle at the bottom of VDub from left to right and watch the frame number and elapsed time increase until you get to the runtime that you wrote down.

http://i205.photobucket.com/albums/b...-keyframes.jpg

In the example above, the runtime I'm looking for is two minutes (00:02:00).

Click on the button at the bottom with the little yellow key and a left arrow above it (circled in red above). This will take you back to the previous keyframe. (When you use VDub to save a clip, you must always begin the clip with a keyframe. Note the little "K" in brackets to indicate the key frame.)

Hit the Home key on your keyboard to mark this frame. (Or Edit menu > Set selection start.)

Now, click the right arrow button with yellow key a few times until you've advanced beyond the runtime of your short, sharp sound.

Hit the End key on your keyboard to mark this as the end frame of your clip. (Or Edit menu > Set selection end.)

http://i205.photobucket.com/albums/b...ipselected.jpg

Note the short section of timeline highlighted in blue (circled in red above). I made this clip longer than necessary to make it easier to see the highlighted section. For resynching audio, you only need ten seconds or less.

Go to the Video menu and select "Direct stream copy":

http://i205.photobucket.com/albums/b...streamcopy.jpg

Go to the Audiomenu and select "Interleaving":

http://i205.photobucket.com/albums/b...terleaving.jpg

Under "Audio skew correction", enter a number in the box next to "Delay audio track by..." If your audio is early, enter a positive number of milliseconds (1000 x seconds). If the audio is late, enter a negative number.

http://i205.photobucket.com/albums/b...audiotrack.jpg

In the example above, I entered 1500, because my audio was about a second and a half early (1000 x 1.5 seconds).

Click OK.

Go to the File menu and select "Save as AVI" (or hit F7).

Enter a Filename and click Save. (I usually add the number of milliseconds, e.g. "1500" to the filename, to help me remember the setting in case I have to alter it later.)

Open the new AVI clip in your media player and see if the audio is now in sync. If it's still off, estimate a new delay and go back to the Audio menu > Interleaving and change the number of milliseconds, then save a new clip with a new name. Continue until you get it right.

Now, reopen your AVI (File menu > Close video file or Ctrl-W, then Open video file or Ctrl-O), again go to Video menu > select Direct stream copy, then Audio menu > Interleaving and enter the final number of milliseconds that worked, back to File menu > Save as AVI (or F7), choose a new Filename and click Save.

Listen to your new vid and see if the sound is in sync throughout the movie. If it is, congratulations: you're done!


Fixing audio sync if delay increases/decreases during play

If the audio is in sync but gradually gets out of sync as the runtime increases, or if the audio is early at the beginning and late at the end, or vice versa, then you still have a chance of fixing it using VDub.

With your vid opened in VDub, and Video set to Direct stream copy, go to Video menu and select Frame Rate...

http://i205.photobucket.com/albums/b...eframerate.jpg

Under Source rate adjustment, the default is "No change (current: xxx fps)".

Note the number of fps (frames per second).

Click the radio button "Change frame rate to (fps)" and enter a number in the box that is 0.01 higher or lower than the current fps. In the example above, the current fps is 29.970, and I entered 29.960, which is 0.01 less.

In this example, my new vid will have slightly slower video, so if the audio is gradually running later as the runtime increases, my new vid will compensate for that with slower video. If your audio gradually gets earlier, then increase the fps instead of decreasing it.

Save a clip from the beginning, middle and end of your vid and see if the audio is back in sync. If not, adjust the frame rate accordingly and try again.

If you already delayed the audio as described in the first part above, and you can't get the movie back in sync, then you may have to start over with the original vid and adjust the framerate before adding a delay to the entire vid. Experiment and see what works.

Good luck!

ameliorator2 October 8th, 2012 09:51 PM

YAAI
 
Wow that was an incredibly helpful and comprehensive post from Denaniel. thanks very much indeed. I've played around with VD in the past, despite many proclaiming how un-user friendly it may be.

Along those lines I wanted to make a very gentle suggestion of another application (hopefully I'm ok to post this here), called YAAI (Yet Another Avi Info), the version I use is v2.0.3.488. A google search should find it without issue. It has a tab for "Sync Audio" that works fairly well on some of the badly time synced examples I've run through. Anyway, thought it might be an alternative to those who might be VD-Averse!

alover686 March 29th, 2013 03:42 AM

Easy to Use Freeware Fix to Audio/Video Sync Problems
 
Was wondering whether you experienced audio/video sync problems with a movie that got progressively worse as the file played?

I use Media Player Classic on a Windows7 laptop to play video files. File starts in sync but at the end is severely out of sync. (OOS)

Solution: Use freeware program avifrate110 to correct problem.
Super easy to use!!!

D/L it here: http://inmatrix.hoyty.com/mirror/avifrate110.zip
McAfee site Advisor OKed this site.

To Use: D/L, Extract to folder of your choice, open avifrate.exe, browse to the folder of the AVI file that has a progressive OOS problem.

In the case of Like A Virgin (1985).avi, uploaded by blu123 on 02/09/13, I changed the framerate from 29.97 to 29.953, hit apply, then reopened movie file, skipping forward several times to the end of the movie to test the results. I had to change the framerate several times to zero in on the final success. In this case the change was -0.017.

Hope you find this useful!

alover

Aubrey October 16th, 2013 03:31 PM

This doesn't change the file, but I've only recently discovered that you can change the synch by hitting the J and K keys while the video is playing - one moving the sound forward, the other back. It could be useful for a quick guide on how much you need to synch the video if you want to do it permanently later on.

hos October 19th, 2013 07:12 PM

Quote:

Originally Posted by Aubrey (Post 2678015)
This doesn't change the file, but I've only recently discovered that you can change the synch by hitting the J and K keys while the video is playing - one moving the sound forward, the other back. It could be useful for a quick guide on how much you need to synch the video if you want to do it permanently later on.

you should tell that it's an option of the VLC player. ;)

deepsepia December 1st, 2015 10:52 PM

One trick with this is to transcode using Handbrake. I find for some reason that old FLVs in particular are prone to audio that drifts, particular when you advance through a video.

Transcoding to a more modern container seems to fix that problem.


All times are GMT. The time now is 11:52 PM.



vBulletin Optimisation provided by vB Optimise v2.6.1 (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.