07.08
This evening i sat down to watch an episode of my favorite anime only to find that for some reason the video and audio were out of sync. Upon further inspection i found that the video and audio were off by around 3 seconds. It appears that at the beginning of the file the video paused for 3 seconds because of an apparent glitch during the encoding process. (I’m not sure who encoded the video.) At first i thought “Hey, this will be easy. I’ll just import it into Adobe Premier and fix the problem.” The problem with this is that my video is encoded in XviD and for some strange reason Premier didn’t like the file. I’m sure it was probably user error but i got frustrated and began to search for other ways to remedy this problem. After searching for about an hour i finally got a few hints and was able to fix it on my own. With that thought i wanted to document it so that perhaps this quick post will help someone in the future.
The first thing i did was download a program called VirtualDub. This is a free video capturing and processing utility. Its open source and has been around for a while. I’ve used it many times in the past for random tasks. Its always been able to just about anything i throw at it. The program works the best with avi files. I’m sure it can work with other containers but the FAQ states that it was designed specifically for avi’s.
The first step is to open your video file in VirtualDub. (File > Open Video File) The file i was trying to open received an error about the audio stream having a non-zero start however it opened just fine after clicking OK.
Once you have the file open the second step is to determine how far off the audio is from the video. You also need to know if the audio is playing before the video or after the video. (I.E. the lips move then the audio plays… or the audio plays then the lips move) I found it easiest to find a scene with some dialog and watch it. I was able to determine the audio started before the video and that the audio was off by about 3 seconds.
Once you’ve figured this out the third step is to configure VirtualDub to offset the audio so that it plays correctly with the video. To do this you will need to set VirtualDub’s audio processing mode to Full Processing Mode (Audio > Full Processing Mode) and open the interleaving options. (Audio > Interleaving)
At the bottom of that box you will find a section titled “Audio Skew Correction.” This is where you will input your offset. The offset needs to be entered in Milliseconds. 1 second = 1000 milliseconds. Since the audio in my file was played 3 seconds to early i entered 3000. If your audio plays to late you will need to enter that as a negative number. (AKA -3000) When you have entered the proper offset, click OK and preview the file. (There is a play and stop button at the bottom. You can also click and scroll through the video using your mouse)
When you’ve finally corrected the audio problem and everything looks and sounds good, simply save the file as a new avi. (File > Save as AVI) The video will then be re-encoded and a new file with the correct audio and video will be created.
I hope this helps if you are having the same issues I had. VirtualDub can do a lot more than what i wrote about here. It can even correct small temporary errors in videos. (Such as the video and audio being out of sync for only a portion of the video rather than the whole video) Now that you know the basics everything else should be quite simple.












No Comment.
Add Your Comment