VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. Hi,
    I have been converting .avi to .mpg for about 6 months with no problems. However i have recently come across a couple of .avi which have perfect audio sync when i play them on the pc, but when i convert them to .mpg the are about 1 sec out of sync.
    I have not come across this before???
    I am using VirtualDub and TMPGEnc using the 'usual' methods describod on vcdhelp.

    Any help would be appreciated.

    Thanks,
    Quote Quote  
  2. What avi's do you convert (compression, ntsc or pal and so on) with sync problems?
    Quote Quote  
  3. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    The problem is probably due to corruption in either the Video, or the Audio portion of your avi. During the conversion process, these corrupt frames are dropped, and the audio looses sync because of it. You can stretch/shrink the audio to match the length of your video, and then encode to your final audio format. There are a few audio editors that will do this for you. Someone should be able to suggest a good one for you.

    To verify, just open the video, and audio streams seperately in Media Player. The total time is probably different.
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  4. Hi,

    Buffist: the .avi giving me trouble is a xvid 23.976fps

    DJRumpy: The total time for both is the same?

    Still confused, thanks for your replys tho
    Quote Quote  
  5. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    The only time I've had that happen, was when the audio was out of sync in the original AVI. What method did you use to extract the audio from the AVI, or did you just import the avi directly into TMPGenc?
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  6. The audio is in perfect sync in the original .avi
    I have tried the .avi directly into TMPGEnc - ends up out of sync. I have tried a direct stream copy from VirtualDub and used avi to wav program to do the same but after encoding all i get is beeps and interference. Also i have tried using Full processing mode and converting to 44.1Khz in VirtualDub but still get an out of sync .mpg after encoding????

    Thanks for any suggestions.
    Quote Quote  
  7. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    Have you scanned the AVI in VirtualDub for errors? I'm guessing the audio is corrupt. When you convert it (extract it), the corruption causes loss of audio sync. There isn't much you can do to fix it, other than trying to arificially change the length of your audio to fix the audio sync. You can try extracting the audio 'as is', using VirtualDub, and the Direct Stream Copy option, and then convert it using BeSweet, but if the error is already there, there's not much you can do to get around it.

    Try increasing, or decreasing the length of your audio by a second. depending on where the lost frames are, it may, or may not be a workable option.
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  8. To DJRumpy:
    Can you tell me how it could happen that the avi is in full sync (with audio corrupts inside) and there's an out-of-sync when I split the video and audio and encode once more?
    To 3 Jab Sam:
    Did you try frameserving via VDub to TmpgEnc?
    Quote Quote  
  9. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    Because the audio is locked to the video in your AVI. When you seperate them into seperate audio and video streams (this happens during re-encoding, or editing), the corruption causes gaps in either your audio, or video. These gaps cause you to loose sync. The same thing happens to people when capturing video. If they drop a video frame, the audio will go out of sync a small bit for each video frame dropped.

    The capture software can be told to drop the same frame of audio for each video frame that was dropped, in doing so, keeping everything in sync. Unfortunately, you have no such option. You will either have to try a few repair utilities (check the TOOLS section), or change the length of your audio to try to make it 'fit' the video. It will actually be the wrong size (it's length won't be the same as your video) after stretching/shrinking, since your saying they are exactly the same length now, but it won't cause any problems by doing this, and may help you to re-sync your audio.

    If it helps you to visualize, look at it this way:


    AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK (video stream)
    AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK (audio stream)

    Assume the DDD portion of your audio is corrupt.

    During playback, the AVI audio and video are locked together, so if a piece of the audio is corrupt, it simply plays a blank (inaudible) spot, or they sometimes chirp (loud irritating squack/scratch noise), but they stay in sync.

    When you re-encode though, and part of the audio stream is corrupt. Your output would look like this:

    AAA BBB CCC DDD EEE FFF GGG HHH III JJJ KKK (video stream)
    AAA BBB CCC EEE FFF GGG HHH III JJJ KKK (audio stream)

    The strange thing about yours though, it the fact that your saying your audio, and video stream are exactly the same length. What did you do to determine the video stream, and audio stream length? Also, when you check for audio sync in your original file, did you look at the end of the movie?

    Extract your audio using virtualdub, and the Full Processing audio mode. Open the WAV in Windows Media Player. Grab the slider, and look at the total time. As soon as you click on the slider, it the total time is not displayed, it should appear. Do the same for the source AVI itself.
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  10. Buffist - I just tried frameserving and got the same result. Tx anyway.

    DJRumpy - OK, i did what you suggested and my video was 1:28:19 and my audio was 1:28:18 , a 1 sec difference over the whole movie. What shall i do now?

    Thanks
    Quote Quote  
  11. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    One of your streams had corruption. You will need to stretch, or shrink your audio length to fit your video stream. I can't recall the name of the software that can do this (GoldWave?). I'm fairly certain that was the program. I'm sure there are others that will do this as well.

    www.goldwave.com
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  12. Member
    Join Date
    Feb 2003
    Location
    Land of Oz
    Search Comp PM
    I have had the same problem (ironically with Star Wars AVI, DJ). The AVI kept sync, but the re-encoded file lost it.

    I had the benefit (?) of having enough corruption to detect approximately where in the movie the audio sync would go. It turns out it happened in more than 1 spot. Up to the first spot, the MPG audio was in sync, but after that spot ... out. So stretching the audio was not a great option in my case because the problem was in specific spots and not evenly spread.

    My solution was to use VirtualDUB to split the AVI into bits, starting each section just AFTER a corruption (at next I-frame). Then re-encode each section and joining the MPG again afterwards (using TMPGenc for re-encode and joining). It was a bit of work, but it did work.
    Quote Quote  
  13. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    nerdboy, you can use AVISynth to do the same thing, but without chopping your movie into bits. I use the same method to cut commercials out of my captures. You can parse through an entire 2 hour clip in about 10 minutes.

    Open your source AVI in VirtualDub. Move the slider to the point where your corruption starts/ends. Note the frame number. Create an AVISynth script. Using the TRIM command, you simply skip right over the bad frames, without having to save 15 different AVI's. It would look something like this:

    input=AVISource("c:\myfolder\mymovie.avi")
    clip1=Trim(input,0,10479) # our first bad spot is a frame 10480
    clip2=Trim(input,10484,25282) # our second bad frame is at 25283
    clip3=Trim(input,25284,0) # a zero here means 'to the end'
    clip1 ++ clip2 ++ clip3

    Using this method, you don't have to wait for an I frame. You can splice down to the frame level. It also saves you the time wated saving and resplicing each avi section.
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  14. Why are audio sync problems so common in general, not just as a result of conversions? I see a lot around here about how to correct the problem, but not why it's so common, and most importantly, how to prevent it in the first place.

    I'd say most times I see this problem, from various VCD's and SVCD's that people post, it's from a cap or a rip, not an AVI to MPG conversion. Perhaps other things you're doing on your PC at the time of encoding can influence it? Whatever it is, it's something a lot of people are doing.
    Quote Quote  
  15. Member ZippyP.'s Avatar
    Join Date
    Nov 2002
    Location
    Lotus Land
    Search Comp PM
    Originally Posted by DJRumpy
    One of your streams had corruption. You will need to stretch, or shrink your audio length to fit your video stream. I can't recall the name of the software that can do this (GoldWave?). I'm fairly certain that was the program. I'm sure there are others that will do this as well.

    www.goldwave.com
    And the function in Goldwave is called "Time Warp."
    "Art is making something out of nothing and selling it." - Frank Zappa
    Quote Quote  
  16. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    Thanks Zippy. I was hoping someone would confirm. I've never used it, but I've heard it could be done in goldwav.

    rseiler, most of the corruption comes from xth generation copys of a video. They get burned to CD-R/DVDR..media is bad...finger prints..burned at too high a speed, mastering errors from the Studio. Any number of things can introduce corruption in the stream.
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  17. I do it in Goldwave all the time. It is the "time warp" function indeed. It has always fixed the problem for me.

    BTW, I have discussed this with other people and they seem to think that this problem often comes from analog captures because the clock in the sound card is operating independently of the video card clock. So it is not always a bad frame problem.
    Quote Quote  
  18. Member DJRumpy's Avatar
    Join Date
    Sep 2002
    Location
    Dallas, Texas
    Search Comp PM
    I hadn't though of that. I wonder if the 'sync audio to video' option in VirtualDub would eliminate the problem if it was a clock issue?
    Impossible to see the future is. The Dark Side clouds everything...
    Quote Quote  
  19. DJRumpy,

    I am crossing the boundaries of my ignorance, but I believe that is exactly how VirtualDub addresses the problem. For WDM capture cards (what I used to have), VirtualVCR and IuVCR do something similar and pretty effective. Neither of them is able to fix the problem 100% though.

    Other tools that can do "Time Warp" are CoolEdit and SoundForge. I believe that Goldwave gives you the most granular control for time stretching and it just so happens to be a bit cheaper. All three tools are pretty good for removing audio noise as well if you are a sound purist (which I am not
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!