Log in

View Full Version : Audio/Video out of sync


riverplate
17th November 2003, 19:52
Hi guys,
I'm trying to convert a VHS to DivX. These are the steps I took:

-I digitalize the 90 minute VHS to my HDD using my capture card (AV Master) which gives me several .AVI segments encoded with the card's MJPEG proprietary codec and PCM audio (22k/16/stereo).

-I play back the captured AVIs (several) and confirm they're all right (no sync problems)

-I load the segments into Virtual Dub v.1.5.9, and code video to DivX 5.05 and Audio to Lame MP3 (interleave: every 1 frame, preload 500ms )

Now I play the newly obtained .AVI file with Windows Media Player v.6.4. The result is a nice looking video, but with an audio completely out of sync. The strangest thing is that the audio doesn't seem to be off by a constant amount of time (what would be easy to solve), but instead it gets ahead or gets delayed arbitrarily, changing whenever I move the slide bar to watch another part of the movie.

Things I tried so far (and didn't solve my problem) are:

-In VDub interleave I set the preload audio to 0 (instead of 500 ms)
- " " " interleave factor to 10 frames (inst.of 1)
-In VDub video framerate set "change so A/V durations match"
-Made a huge .WAV out of my captured video and inserted it separately into VDub, so as to Encode audio from "WAV source" (the total amount of time of this WAV exactly matches that of the video's)

Any help will be highly appreciated,
Thanks folks,:angry: :confused:

riverplate
17th November 2003, 22:46
Ok, just in case any of you happen to have the same problem:
This solved the problem quoted above:

I dismissed the LAME codec, because it turned out that LAME was generating a VBR file (or at least VBR headers) in a file that was meant to be CBR since this is the way I configured the LAME codec to work [Control Panel --> Multimedia --> Devices --> Audio Codecs --> LAME]

So, this is what I did,

-Since the video coding was allright (despite the desynced audio), I chipped off the audio from it, by generating a "video only" .AVI file out of the desynced DivX .AVI. So now I have a DivX Movie without audio.
-I extracted a WAV file out of my original captures (MJPEG .AVIs)
-I right clicked both files --> properties to confirm (once again) that both are the same length
-I encoded the .WAV audio into a CBR .mp3 with an encoding program (not the LAME codec) in order to get a file "audio.mp3"
-I used Virtual Dub Mod to multiplex the video and the audio into a single .AVI file
-Voila!

mrkoffee76
19th March 2004, 05:48
I kinda have the same problem, but it happens with any mp3 codec i use from with-in vdub. i know that if i use a vbr mp3 then the sync will be off, but I set almost every setting to CBR i could find. also it seems to go out of sync about the same time for every avi I produce.

If I save the Wave in PCM format, then encode with Cool Edit 2 to mp3 then mux with nandub then the avi file plays fine.

If i save the Wave with the full processing set (all settings set to CBR), it saves the wav using the codec i select but as a .wav file. this what i want, right? I then mux the video and audio and still get a sync issue about 3 min into video

any ideas Guys?

riverplate
30th March 2004, 05:50
If I save the Wave in PCM format, then encode with Cool Edit 2 to mp3 then mux with nandub then the avi file plays fine.


It seems that using an external audio encoder is the only way to get along with this issue. I don't find this additional step to be too time consuming (compare it to the video encoding!) , so why not stick into this? After all, the purpose is to get the job done.

ukb007
14th April 2004, 02:33
MPEG-4 video and mp3 audio has a natural tendency to walk away from each other. There are only two solutions; both already broached in:

1. Extract audio into a .wav, and reencode with CBR. Remux.
2. Use an audio encoder that can process audio specifically for MPEG-4 .avi (e.g., BeSweet).

Regards.

JuanC
14th April 2004, 04:52
I use the lame mp3 acm codec inside Vdub/ vdubmod without problems. But for that (get cbr encoding from the lame acm codec) you need to untick the options "Smart Encode" and "Average Bitrate" in the settings of the lame mp3 acm codec. To get there:

In Control Panel double-click the "Sounds and Audio devices" applet;
Select the "Hardware" tag;
Double-click the "audio codecs" option;
Select the "Properties" tag;
Double-click on the "lame ACM MP3 codec"
click on the "settings" button