Log in

View Full Version : EnsureVBRMP3Sync usage


myriaxis
11th June 2004, 22:37
Hi,

I'm new to Avisynth usage, so please forgive me for asking basic questions.

I have an .AVI file which has VBR MP3 audio. To make a long story short, I want to extract audio and video to convert the .AVI to DVD format (MPEG-2 and AC3 streams). Because I'm having an audio/video sync issue, I've been suggested to use EnsureVBRMP3Sync to preprocess the .AVI file. I haven't used Avisynth with anything else but CCE. I've created the .avs file:

AVISource("path\clip.avi")
EnsureVBRMP3Sync()
Trim(0,0)

Now, what should I use to preprocess the file? VirtualDub, NanDub, something else?

Boulder
12th June 2004, 08:15
As I said in that CCE thread, open the script in VirtualDub and save the audio stream as WAV. Then process the video in CCE with your original script, the one that you posted there. Convert the audio to MP2 or AC3 with any suitable program.

myriaxis
13th June 2004, 19:43
Thanks Boulder,

I created the avs script

AVISource("path\clip.avi")
EnsureVBRMP3Sync()
Trim(0,0)

and opened it within VirtualDub. I selected Source Audio, Full Processing Mode. Then I chose Save WAV. I ran AC3Machine to convert the audio stream in AC3.

The resulting audio stream is about 1 second in advance to the video stream when playing the DVD. I get the same result when opening the clip directly in VirtualDub (i.e. without the avs script).

Is there some other setup parameters that I'm missing?

Boulder
13th June 2004, 20:43
Try this script:

video=AVISource("path\clip.avi",false)
audio=WAVSource("path\track.wav")
audiodub(video,audio)

In the video line,load the original video clip and in the audio line, load the extracted WAV track. Open the script in VirtualDub and report what VirtualDub shows for framerate for both video and audio.

By the way, is the desync constant?

myriaxis
13th June 2004, 21:57
I tried the script.

From the AVI file information, I get:
video: frame size = 512x384
fps = 23.976 (41708 microseconds)
length = 130658 frames (1:30:49.53)
decompressor = VivX Pro 5.1.1 Codec
# key frames = 130658
key frame sizes = 294912/294912/294912 (37629504K)
delta frame sizes = no delta frames
datarate = 56566 kbps (0.01% overhead)
audio: sampling rate = 48000 Hz
channels = 2 (stereo)
sample precision = 16-bit
compression = PCM (uncompressed)
layout = 66 chunks (0.00s preload)
length = 261577579 samples (1:30:49.53)
frame sizes = 8008/8008/8008 (517K)
data rate = 1536 kbps (0.30% overhead)

The desync seems constant. I added just enough silence at the beginning of the wav file, using cool edit pro, to resync audio and video. This fix seems to be OK for the entire range of the video.