Subscribe to AfterDawn's weekly newsletter.
In this guide we will look at fixing problems with audio sync while playing back AVI files on your computer. Several problems with how the video and audio are contained in the AVI format can result in audio and video that don't match up correctly. This guide will help you to fix that problem with your files and enjoy your video how it should be.
Introduction & Requirements
|Software you must download and install|
|Media Player Classic|
|Optional: Media Player Classic is not a tool for fixing AVI sync problems, but it can be used to set audio delays during playback that can fix problems on-the-fly without modifying the AVI.. Download!|
|Optional: YAAI is used to place delay audio of AVI files in order to fix sync problems that stay the same throughout the entire video. Download!|
|AVI Frame Rate Adjust|
|Optional: This tool can be used to change the framerate of an AVI file. This fixes gradually worsening audio sync issues in AVI files. Download!|
The software listed above is used in this guide. You don't necessarily need to download them all, just the one that you require based on what kind of sync problem you have and how you need to deal with it. This guide will point you to the correct tool that you will need to fix your AVI file.
What kind of sync problems can be fixed?
Generally speaking, there are two different sync problems that you might encounter.
Scenario 1: Your AVI File is out of sync from the start to the finish, and the difference between the audio and video appears to be the same throughout the problem. (Download YAAI or Media Player Classic).
Scenario 2: Your AVI File is in sync when it starts or is just barely out of sync, but as the video progresses the difference between the video and audio just gets worse and worse (Download AVI Frame Rate Adjust).
Scenario 1 can be fixed by setting a simply audio delay. Basically, if you find that an event on screen happens about a second before you see it, then you can edit the AVI file to add a 1 second delay to the audio starting so that it will be in sync then. Scenario 1 can also be fixed without modifying the AVI file by using a delay setting in Media Player Classic.
Scenario 2 can be fixed in most cases by making very small changes to the video framerate. This is more complicated to fix and the results aren't always perfect throughout the entire video, but it works in the vast majority of cases.
Obviously we will start with Scenario 1, and before we look at using YAAI to set a permanent audio delay in an AVI file, let's look at an easier approach with media player classic.
Scenario 1 - Constant Sync Difference - MPC
Download Media Player Classic. It is a powerful media player for windows modeled after the traditional media player software that came with Windows - just with tons of new features and native format support. One thing it can also do is set an audio "time shift" that can play a usually out of sync AVI file perfectly.
Open your out of sync AVI file in Media Player Classic. Once you have your AVI playing, try to work out if the audio is before or behind the video. For example, do you hear somebody speak before the actors' mouth moves? If you, then you need to estimate the amount of time there is in the difference. Usually it is just a fraction of a second. Don't worry about estimating for a moment because it would be next to impossible to get it right on the first go anyway. Click Play (the menu) in Media Player Classic, and then move the point over Audio. From the sub-menu for Audio, click Options.
Set Audio Time Shift
You will now see the window on your screen that is shown in the screen shot above. Firstly, tick the box beside "Audio time shift (ms)". You can now enter a time delay in a number of milliseconds (one thousand of a second). If the audio plays before the video, then the audio needs to be delayed. 500 milliseconds is half a second, so if you set "500", then the audio will be delayed by half a second on playback from its original timing. If the audio comes too long after the video, then you need to set a negative delay. if you were to set "-500", then the audio would play half a second sooner than the video, compared to the original timing.
This is a little tedious on the first try, but set something like "500" or "-500" based on whether the audio players before or after the video, and click Apply, then click OK. Now press the play button on your video and after a few seconds the difference will be noticeable. You can go back to the Audio Options again and change the time shift as much as you want, until you get it right. Remember that when you set the audio delay, it will be saved to the Windows Registry, which means the delay will automatically be applied to any other video you play unless you turn it off. This means that you might mistake videos for being out of sync, so bare that in mind.
Hopefully this will help you to quickly resolve sync issues with AVI files without having to modify them in any way. For those who would prefer to modify a file with this permanent inconsistency between video and audio, download and run YAAI and read on.
Scenario 1 - Constant Sync Difference - YAAI
The very first thing you will be greeted with when you run YAAI is a file browser to load in your out-of-sync AVI file. As I did in the example above, locate the problematic AVI file on your HDDs, select it and click Open.
YAAI will immediately show information about the AVI file that can be helpful to users. Click the Sync Audio tab. Please note that when you do this, you AVI file will open in a small built-in media player. This will help you to gradually change the audio sync.
Set Audio Delay
You will notice that at the bottom of the Sync Audio tab you can delay audio or video. The idea is simple really..
If your audio comes before events in the video, you need to delay the audio (+1) on playback of the AVI file (move the slider right).
If your audio comes after events in the video, you need to delay the video (-1) on playback of the AVI file (move the slider left)
So basically, all you need to do is make changes to the audio or video delay by either clicking and dragging the slider or clicking the +1, +0,01, -1 or -0,01 buttons. When you want to test out the delay in the built-in video player, click Apply. This will give you an idea of whether you are making the sync better or worse. When you reach a point where the sync is just about right, you simply need to close YAAI like you would close any program.
When prompted to keep the changes, click Yes. This will make the delay you set in the program permanently present in the AVI file, and it should now be OK in any media player you can play it in.
Scenario 2 - Gradually Worsening Sync - Frame Adjust
A gradually worsening sync problem in an AVI file is often caused by a minor issue with the framerate (fps) of the video stream in an AVI file. If you can change the framerate slightly, you can resolve this problem. The minor difference in framerate will only become noticeable as the video progresses, as the audio and video go further out of sync by a fraction of a second, every second.
AVI Frame Rate Adjust v1.00 is a great program to deal with this problem because it is so easy to use. Please note that you will also need to play your AVI file in a media player (Windows Media Player, for example) to check changes you make for improvement. Open your problematic AVI file by clicking the Open button.
Adjust FPS to change video length
So here's the deal, if your video fps is slightly different than what it should be, then technically your video is slower or faster than your audio is. To determine this, open the AVI file in a media player and seek right to the end of the file. If it is a movie you will need to go to a time before the credits, to where you can estimate the delay in the video or audio (where you can actually see an event and determine whether you heard it before or after you saw it)
It is important to first determine whether the video is faster (video comes AFTER audio) or the video is slower (video comes BEFORE audio). You can determine this by watching people's lip movements and determining if the words are heard before or after they are said. Another way to do this is to rely on an event like a gun shot, explosion etc. Toward the end of the video file, where you need to determine this (not long before credits role for best results) the delay should be quite noticeable, and in cases may be seconds long.
Notice that in Avi Frame Rate Adjust, if you change the fps at all, then the "Length" value also changes. In the picture, my fps is 25.005, which means the video length is 23:57:833. If I increase the fps, then the video plays faster and hence it will be shorter. For example, changing 25.005 to 25.050 changes the length to 00:23:55:250, so the video file is now about 2 and a half seconds shorter in length than it used to be (technically it is not, it just plays faster with 25:050 fps).
So here's what you have to do. Determine the difference between the video and audio events. If the difference between seeing a gun shot (for example) on the video and hearing it is 2 seconds on the video near the end, then you need to change the framerate to make the 2 second difference. If the gun shot is on the video BEFORE the audio you need to DECREASE the fps and make the video longer by 2 seconds (make it play slower). If the gun shot is seen on the video AFTER it's heard on the audio, then you need to INCREASE the fps to make the video shorter by 2 seconds (make it play faster).
Only make small changes and keep your eye on the Length value until you have either increased or decreased the length of the video to around what you would guess is the difference. When you are done, click Save. Now open the AVI file again and go to the exact scene and check if it is better or worse.
It will not be spot on the first time you do it, that's almost a guarantee. You will need to adjust it again slightly in most cases to get it right. However, do take note that any improvement toward the end of the video will be a much bigger improvement at the beginning and the middle of the video, so having very slight audio sync problems at the end might not be such a bad thing if the other 90% of the video plays perfectly.
This can be tedious, but if you keep trying, you will most likely fix the gradual AVI sync problem to an acceptable level.
Hopefully the information in this article will have helped you to fix your AVI sync problems and help you to do so in the future. If you have any questions or problems, please visit our Discussion Forums for help.
Written by: James "Dela" Delahunty
Last updated: 14 March 2010
Last updated: 14 March 2010