Avi: audio out of sync

Hello,

I tried to embed an subtitle into an avi using virtualdub. Why I did this? Normally I burn my 700mb avi’s with an subtitle .srt to an data cd, so I can watch them on my divx dvd player. But with one movie, I’m experiencing problems: When the first line from the subtitle comes, I also see the time when it has to appear and for how long. Literally copy paste from the srt I could say…

When I embedded the subtitle in the avi, the audio was out of sync. I tried:
Framerate: so that audio is in sync with video==>didn’t work
Interleaving: the audio changes, but I haven’t managed yet to sync it good.

Is there a usere-friendly program that I can use to make the video sync with the audio? I would sync the audio using a dialog in the movie to sync with. So I can set a point in the movie , and on that point, that second of audio has to be.

Plz help!

When you took your sound extraction was there any delay in the sound, if so you have to use a program called delaycut to fix the problem of it being out of sync, I just had the folder on my desktop with all my tools but now I can’t find it. I sure that is what is happening though…

How can I know? At the moment , I have only the avi file with subtitles included. So the audio isn’t a seperate file if you mean that?. But what I do see, is in virtualdub, with Interleaving I see the box enable video/audio interleaving, checked.
See: http://img55.imageshack.us/img55/921/virdub1ic1.jpg

But maybe the problem can be solved starting with the problem I experience when I have a avi and a srt file, that I burn to an cd? I find it weird, because I only have this problem with this movie. With other movie’s that I burn, the subtitle plays fine…

I see, so you didn’t rip the movie yourself down to the avi file…here’s a guide from another forum that basically gives the steps of creating what your burning to disk, if the audio file had delays in it the person who ripped it should have corrected the delay and your movie’s audio would have been in sync…

This ladies and gentlemen…is the ultimate
definitive guide…to DVD ripping and encoding to xvid
with the original ac3 DVD audio …enjoy and use wisely…

tools…all free and found on the web!!!

DVD decrypter
DGIndex
VFAPI reader
DelayCut 1.2.1.2
VdubMod
XviD and Ac3 codecs

Step 1 : Rip your DVD(vobs) to your Hard Drive…

Tools used DVD decrypter…

  1. put the dvd in the drive and start DVD decrypter
    make certain you are in IFO mode, not FILE mode.Change
    the mode by going to mode menu and selecting IFO…

  2. Now go to the Edit menu and select, select Main Movie PGC.it
    will cause DD to select the longest program chain which should be the
    main movie…but always check to be sure …make sure all the chapters are selected
    and select the big decrypt button in decrypter…it will take a few minutes to rip
    the files to the selected folder…


Step 2 : DgIndex your movie and get your audio

Tools Used DGIndex

  1. Load DGindex, which is going to perform 2 tasks it will index the vobs for
    frameserving as well as output your AC3 audio for remuxing later…go to open under the file menu in DGIndex and

select all your vobs and select open…

  1. a list should pop up with all your vobs on it make sure they are all present and
    in numerical order…once sure select OK…

  2. Now select preview from the file menu. The movie will start playing and DGIndex will open
    a window that will display information it is collecting…Let the preview run for at least 2 or 3 minutes…(at

least until you get familiar with this process )
DGIndex will interpret all widescreen movies as 16:9 which most of the time is
actually an incorrect aspect ratio…but that is fine…as you will see later…

  1. Now look at the Video Type box in the status window of DGIndex…normally in most
    DVDs the format is film…if it is not Film…my guide does not cover that…
    Go to the video drop-down choose Field Operation and then Force Film…this will force
    the output to be 23.976 frames per second which is correct for NTSC films…

  2. Now let’s set up to get our audio…go to the audio menu choose output method…and
    select demux tracks…when you save your project the audio track selected in Audio-Track number menu will saved to

an AC3 file…you can demux 1, all or none of the audio…In
most cases the English audio track is track 1…but if you are unsure…select all tracks and listen with a media

player later to figure out which is the one you want…

  1. Lastly for step 2 select file-save project…name it something useful…I like to use the name of the movie…once

done you can close DGIndex…

Step 3: Fixing any delays in your audio…

Tools used : Delaycut 1.2.1.2

  1. Examine the file name of the AC3 file or files that DGIndex dumped for you…if the filename shows anything other

than delay 0ms you need to fix it…and with delaycut 1.2.1.2 it is a very simple process…

  1. start up delaycut if for any reason it crashes you will need to get GfaWin32.ocx file and put in the same folder

as delaycut 1.2.1.2 files…Next to the source file box click the button with 3 dots…find your ac3 file and open

it…the next step is very simple…click the process button and it will quickly fix your file and save another one

with the same name except it will add fixed to the new file name…close delaycut now…also you can drag and drop

the ac3 file onto delaycut and it will do the same task…


Step 4 : Building the frame server with VFAPI reader

Tools used: VFAPI reader

  1. start VFAPI reader select add file and select the D2V project you just created…another
    screen will pop-up asking you where you would like to save the avi…select a place and a name
    …leave everything else alone…and select OK…

  2. Now just select convert and in a few secs you will have an AVI file that will serve the MPEG frame data from the

vob files ready for encoding and an AC3 audio track ready for muxing…close VFAPI reader…


Step 5: Removing letterboxing anf Fixing aspect ratio

Tools used: Vdubmod and Xvid 1.2 codec

  1. start vdubmod, go to file menu and select open video file,select the avi file that VFAPI reader just created…it

is important to remove letterboxing because it wastes bitrate and space needed to encode the movie itself…to do

this “cropping” go to the video menu
and select filters…click add and then select null transform filter and click OK…

  1. Now click the cropping button to adjust the cropping settings…scrub to a frame in the movie where the edges of

the video are well defined.Drag the tops and bottoms and or sides till they are even with the edges of the video

then use the Y1 Y2 and or X1 X2 boxes for pixel perfect control…make sure that the X and Y offset numbers are EVEN

numbers…please!
it is better to cut off a line of video than to encode a black bar…finally click OK…

  1. next click the add button in the filters window again and select resize filter…when you click ok you will see a

small box with some options…in a widescreen vid we want to keep the 720 and resize the height…in a full screen we

want to keep the 480 height and resize the width…here are some common aspect ratios…
2.35 : 1 = 720 x 306
1.85 : 1 = 720 x 390
1.78 : 1 = 720 x 404
4:3 1.33 : 1 = 640 x 480

type in your new width and height values…under filter mode I use Lanczos3 for highest quality…do not check the

interlaced box and especially DO NOT check the Expand Frame and letterbox image…select preview and check out the

work…if it looks good…close the preview menu and click OK on the resize options sceen to return to the filter

list…click OK again to close the filters list…

Step 6 : Setting up XviDs first pass

  1. We need to set up Vdubmod to run 2 projects in batch processing mode…the first job will be the first xvid

pass…go to video menu in vdub and select full processing mode…next in same menu select Compression…select xvid

mpeg-4 codec from the list on the left and click the configure button…

  1. now use the following settings…profile@Level Unrestricted
    encoding type 2 pass- 1st pass

                                                 more...this is where you name your pass file...name it what you 
    

want…just add a .pass at the end…

  1. If there are any zones defined in the zones box…select and apply the following settings to each one

         start frame#    0
                                rate control    weight 0.00
                             begin with keyframe   checked
                             greyscale encoding    unchecked (unless black and white vid)
                          Chroma Optimizer Enabled   checked
                             BVOP sensitivity      0
    
  2. Now click on the advanced options button…use teh following settings on the motion tab
    Motion Search Precision 6-Ultra High
    VHQ mode 4-wide search
    use chroma motion checked
    turbo unchecked
    frame drop ratio 0
    max I frame interval 240 if forced film
    cartoon mode unchecked unless doing anime

  3. the quantiztion tab should be set at 1 min value and 31 max value for all categories
    trellis quantization Unchecked

now click OK to close the advanced options window, then click OK to close the XviD config window…lastly press OK

to close the vid compression window…

  1. Go to the File menu and select Save As…make sure the file-type is audio-video interleave(*avi) and give it a

name…MOST IMPORTANTLY…check the box that says don’t run this job now, add it to job control so I can run it in

batch mode…click the save button…taht is it for the first pass…

Step 7: setting up XviDs second pass…

  1. do not close Vdub or reopen anything…just go back to video menu and select compression again…click

configure…you only need to change the following things leave everything else the same as it was… encoding type

  twopass- 2nd pass

for high quality video toggle the target bitrate size to target bitrate…type 1500 which will produce great quality

video…if you are aiming for a certain size…toggle the button to target size and click the calc button to open the

bitrate calculator…type in your target size(in kilobytes) and leave the subs box at 0 make sure the container

format is set to avi-open DML…type in your movies duration…if force film then select 23.976(film)
select ac3 as your audio and choose teh bitrate specified in the ac3’s filename…finally click ok to close the

bitrate calculator…remember only do those steps if you are aiming for a particular filesize…

  1. click OK to close the XviD options window and click OK to close the compression window…now we have to add our

AC3 audio…

  1. go to the streams menu and select Stream List…select add button and select your ac3 audio…after a few seconds

it should show up in the streams window…select OK to close the window…

  1. Go back to the File menu and select Save As…type in the same name as before make sure the jobs box is still

checked…click save to close the window…

  1. now go to file menu and select job control…or press f4…both jobs should be listed there now, click the start

button and vdubmod will begin the long and arduous process of encoding your video…after it is done…you will have

a super high quality video with ac3 audio…

share it with us!!!..

Ok, but the original avi file doesn’t have that delay. The delay began when I added the subtitle via a filter in virtualdub. Maybe I set a wrong setting? Maybe someone could say what settings I should use just to add the subtitle iinto the avi without changing anything else?

Maybe that will get ya in the right direction…

ReSync AVI Audio & Video

Problems
I’m going to start this off with covering reasons for audio/video sync problems. There are a few things to check before going on to the fixes below.

Badframes
You can check to see if there are bad frames in your AVI with a little program called DivFix. Simply start DivFix/Load the movie/Start. If there are corrupted frames, this can cause the audio/video to be out of sync. You can also use VirtualDub to accomplish the task: load the AVI, then go to Video/Scan Video Stream For Errors, but it takes much longer than using DivFix. The fix is to cut out the bad frames along with the corresponding audio.

Movie Split At Non-Keyframe
If the ripper has split the movie at a part that is not a keyframe, this can cause the audio/video to be out of sync, usually in the CD2. The fix is to but off the last part of CD1 at the last keyframe, and cut off the first part of CD2 at the first keyframe.

Index Corrupted, Missing Or Truncated
You can find this out by using GSpotand looking on the lefthand side in the “Container” box. If it says “File Length Correct”, you’re OK. If it says anything else, the index is bad. The fix is to reinterleave the AVI with VirtualDub by simply saving the movie using “Direct Stream Copy” on Video/Audio.

RESYNC
You can use any of these programs to accomplish the task of Resync since you are doing all of this using “Direct Stream Copy”. Direct Stream Copy simply copies the original video/audio while rewriting the Index. It doesn’t reencode video/audio (that would be Full Processing Mode).

**NOTE
ONLY use Nandub if your AVI video is DivX3. Nandub doesn’t do DivX4 and above or XviD. Use one of the other programs if that’s the case.

Using VirtualDub
1- Start VirtualDub
2- File/Open Video File/choose the movie
3- Audio/Interleaving/Set the value that you want in the “Audio Skew Correction” box (see **NOTE below)
4- Video/ Set to “Direct Stream Copy”.
5- Audio is set to “Direct Stream Copy” by default, so nothing to do here.
6- File/Save AVI as (give it a name)

Using VirtualDub AC3
1- Start VirtualDub AC3
2- File/Open Video File/choose the movie
3- Audio/Interleaving/Set the value that you want in the “Audio Skew Correction” box (see **NOTE below)
4- Video is set to “Direct Stream Copy” by default so nothing to do here.
5- Audio is set to “Direct Stream Copy” by default, so nothing to do here.
6- File/Save AVI as (give it a name)

Using NanDub
1- Start NanDub
2- File/Open Video File/choose the movie
3- Audio/Interleaving/Set the value that you want in the “Audio Skew Correction” box (see **NOTE below)
4- Video/Check "Direct Stream Copy"
5- Audio is set to “Direct Stream Copy” by default, so nothing to do here.
6- File/Save AVI As (give it a name)

Using VirtualDubMod
1- Start VirtualDubMod
2- File/Open Video File/choose the movie
3- Streams/Stream List/Right Click on the Audio Stream/Interleaving/Set the value that you want in the “Audio Skew Correction” box (see **NOTE below)
4- Video/Check "Direct Stream Copy"
5- Audio is set to “Direct Stream Copy” by default, so nothing to do here.
6- File/Save AVI As (give it a name)

**NOTE
Follow these steps until you get the correct value. Start out using + or - 100ms steps until you get close. It’s a trial and error event, so have patience.

In order to set the interleave, you have to find out whether the audio is before or after the video. After you know that, use + numbers (example: +100) if the audio is before the video, and - numbers (-100) if the audio is after the video.

  • = Positive
  • = Negative

I’ve been doing that the whole afternoon already :stuck_out_tongue:

lol well I hope you get it fixed, it is frustrating…

phhh I give up, the quality of the video sucks too. I think I’ll burn this one with convertxtodvd to an dvd, hopefully the subtitle is in it then…

i have a problem like that except when i try to burn avi to a dvd the audio goes completly out of sync i beg you is there anyone who can help

It can be solved by using an legal and official source…

What is the original source?