VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. I have an mjpeg file where the audio is out of sync with the video.
    At the beggining of the sequence the audio is in sync but as time
    progesses the sync becomes worse.

    I have used VirtualDub to create two files, one of just the audio and another of just the video.

    I want to use goldwaves' 'timewarp' function to stretch the audio to the correct size.

    Once that is done then I can use VirtualDub to recombine the audio and video into what should be a nice re-synchronised avi file.

    My questions are, how do I calculate how long (in minutes, seconds, ms) the wav file should be? I've tried GSpot to look at the duration of the clip but it seems to be the same duration (as shown by GoldWave) as the wav file. How can that be?

    Some info you might need:
    Wave PCM signed 16 bit, 44100 Hz, 1411 kbps, stereo
    File size in bytes: 256,385,428
    Duration 24:13.432

    AVI file:
    Rainbow Runner hardware compression
    00:24:13 (43,603 frames)
    352x240 (1.47:1) [=22:15]
    11726 kb/s
    30.000 fps
    4.627 bits/pixel

    Personally I think that the number of fps should have been 29.97.
    Do you know what I mean.. either the rate for the audio or the rate for the video is incorrect in the file or it's right in the file and the players (of which there are several) is calculating something wrong..

    Suggestions please.
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Check out my guide here,it has a section on sync fixing.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Step 3:Audio Sync Repair
    If you have problems with the audio going out of sync gradually then
    open virtualdub and load the avi and go to the end of the avi and go to
    audio/interleaving and use the audio skew correction(input a value) and
    adjust till the audio is back in sync(note*do not save with this adjustment)
    ,just note down the value you used to get it in sync and use an audio editor
    such as Goldwave or Soundforge and choose the stretch audio feature and use
    the value you got from the virtualdub adjustment to set the time difference .
    Is this what you mean?
    Can we discuss this?
    Quote Quote  
  4. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    What do you need to know exactly?
    I think,therefore i am a hamster.
    Quote Quote  
  5. I got a pretty good value of -2000ms.

    So does this mean that the audio needs to be made shorter then it is by two seconds?

    You see the thing that gets me is the math: (sorry the formating is wrong you may have to cut and past to make sence of this)

    number of bytes bytes per sample number of channels samples per channel Samples Per Second duration in seconds minutes seconds
    256,385,384 2 2 64,096,346 44,100 1,453.432 24 13.432
    1,453.433 24 13.433
    number of frames frames per second duration in seconds
    43,603 30 1,453.43 24 13.433


    The audio and video are identical in length.. So it seems to me that the real problem is the play back rates are not accurate... ON any of the systems I've tried this on. I think the players is using 29.97 as the video frame rate on playback. If this is the case.. Isn't there a simple way to edit the avi header and change the 30fps to 29.97fps?
    Quote Quote  
  6. Member
    Join Date
    Jun 2004
    Location
    Ferrara-Italia
    Search Comp PM
    in your file does the audio come before or after the video? If the latter you may be right in thinking that the video playback rate should actually be 29.97f/s.
    To change the framerate you can use avisynth, the function is assumefps (if I'm not mistaken, there are 3 framerate converters in avisynth). Using assumefps you will end up with the same number of frames in total (43603), but the total playing time will now be 24:14.888 (=43603/29.97). Try playing the old wav file with the new video file and see if they are in sync .
    Sorry, I had to go see about a girl
    Quote Quote  
  7. Thank you I will try this.
    Just so you know...
    Using the technique described in this thread, the audio file needed to be shortened by about 1.5 seconds... So I think that jives.

    My concern now is that of loss of video quality if I use a framerate converter. Is there anything to worry about?
    Quote Quote  
  8. Member
    Join Date
    Jun 2004
    Location
    Ferrara-Italia
    Search Comp PM
    Anytime!

    Well, converting from 30.00 to 29.97f/s will be useful only if you have to encode the file anyway. But you won't take a quality hit because of that, since all you're doing is slowing down (=displaying fewer frames/unit of time) the video stream. If you just want to sync the file without further re-encoding/processing then speeding up the audio is much faster and generally hassle-free.
    Sorry, I had to go see about a girl
    Quote Quote  



Similar Threads

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