Log in

View Full Version : Audio desync, Xvid => DVD (strange problem)


OronMuffe
25th July 2005, 19:04
I've done extensive searches in this forum, but I can't find an answer. If someone has posted the same question before I apologize.

I have a 1CD XviD rip that I'm converting to DVD. The original Xvid is PAL and has VBR mp3 audio.

Now, I started doing the video using Avisynth and CCE. CCE (tried both v2.5 and 2.67) kept crashing during the first pass after the .vaf file creation. I then tried using DVD2SVCD (AVI2DVD mode), same thing happened. Same thing happened in QuEnc. Only when i set CCE to do a CBR encode did it complete the whole movie (this leaves me to believe there's bad frames somewhere, but scanning the video for errors in VirtualDub comes up with nothing).

Anyway, since its a XviD => DVD conversion, I was contempt to settle for CBR video.

Next came the audio. When i extracted the audio to WAV in VirtualDub, I noticed the audio length wasn't the same as the video. I went ahead and converted it to ac3 using BeSweet.

Original XviD running time: 1:47:44
Extracted audio running time: 1:43:02

The encoded video file was the same length as the original XviD.

I tried using DVDMaestro's "sync audio" option, but that came out just as bad as when muxing the ac3 with the m2v.

Then I thought it might be a question of audio delay in the original XviD. If this is the case how do I find out how much delay to add to get the audio right?

I did no framerate or PAL => NTSC conversion, and normally doing a DVD out of a XviD file presents no problems whatsoever.

Anyone have any ideas?

/OronMuffe

PINOBIRD
30th July 2005, 08:24
I have a same problem here.
There is a little program called Avinfo wich should easy solve the problem.
The bad news is I can't get this app. running under Windows XP.
Any suggestions are welcome.
Best regards PB

tebasuna51
30th July 2005, 12:46
Next came the audio. When i extracted the audio to WAV in VirtualDub, I noticed the audio length wasn't the same as the video. I went ahead and converted it to ac3 using BeSweet.

Original XviD running time: 1:47:44
Extracted audio running time: 1:43:02


If the original avi play ok (sync) then:

Try to open the video in VirtualDubMod, don't rewrite the header, go to Streams->Streams List->Demux, and save the mp3.

With BeSweet convert to wav. This wav must be synchronized with the video.
If not, there are a problem with the original. You can open it in a audio editor and increase/decrease the duration to fit the video.

PINOBIRD
31st July 2005, 07:39
Finally got Avinfo to work under XP.
I followed this guide: http://nickyguides.digital-digest.com/audio-synch.htm
And now the audiostream is perfect in sync.
Good luck PB

OronMuffe
1st August 2005, 11:55
Thanks tebasuna51 and PINOBIRD, I'll try those two method and report back.

I did try to add the missing time to the extracted wav using GoldWave, convert the fixed wav to ac3 using BeSweet and mux with the videostream (using MuxMan). Everything seemed OK when the video started, but then it went gradually out of synch. I also had problems playing it on the stand-alone DVD player, the video and audio would run for a second or so, then there was only a loud noise and video froze.

I can't help thinking there's corrupt frames somewhere (can the audio have something similar too?), since CCE and other video encoders kept crashing after the first pass.

tebasuna51
1st August 2005, 20:22
This is my method avi (Xvid, mp3) -> DVD with sync problems:

1) Open the video in VirtualDubMod, don't rewrite the header, go to Streams->Streams List->Demux, and save the mp3.

2) Disable the audio and save the video (25 fps) like video_only.avi

3) Convert the mp3 to wav with BeSweet.

4) Open the wav in Goldwave (CoolEdit, ...), resample and save if not 48 KHz. Don't close Goldwave.

5) Open video_only.avi with VirtualDub and Audio -> WAV audio... (or VDMod Streams->Streams List->Add... wav).

6) Play the beginning of the movie, if not sync calculate the delay (+ or -), close VirtualDub. In Goldwave insert a silence or cut at the beginning, save wav and return to 5)

7) Play the end of the movie, if not sync calculate the time to increase/decrease the wav, close VirtualDub. In Goldwave use Time Warp -> Algorithm Rate (for only 1 sec in 1:47:44) and increase/decrease the wav duration. After cut or insert silence at the end to fit exactly the time of video. Save the wav.

Now you don't need convert the audio or mux with the video. The video_only.avi and the new.wav can be used by TmpgEnc or any Authoring DVD program to make your DVD movie.

You can use mp2 instead ac3 for a stereo audio. The ac3enc (with BeSweet) is not recommended.

Of curse a compressed audio may have corrupts blocks. Each block in ac3 have a CRC, and if don't match the block is ignored for any soft. A wav file can't have corrupt data, can sound bad, but can't be ignored. Listen it in Goldwave.

Any encoder can crash for a wav (PCM 48 KHz) input file. May be the video, use Video -> Scan video stream for errors in VirtualDub.