Log in

View Full Version : Audio out of Sync when mux .avs and .mp3 with VirtualdubMod


ruanova
23rd January 2007, 09:13
Hi...

This is a ... long time ... question ... I know, but it's my problem now... :scared:

I want to translate de audio from a video file in spanish, and 4:3 (25.000 fps) another video file in HDTV (25.000 fps) and without audio.
First time, I sync the video (frame to frame) between files. The result is a .avs script with 'trim(x, x1) + trim(x2, x3) ...' etc
The video is really sync.
Now, I compress the audio stream from .avs file to MP3 using BePipe.exe
Finally, mux video HDTV with .mp3 audio using VirtualDubMod 1.5.10.2.
If play the video HDTV and .mp3 audio in VirtualDubMod before mux, they are sync .....
but after mux, if play the final HDTV.avi file ... it is OUT of SYNC ...

Any help, please .........

tebasuna51
23rd January 2007, 15:25
Put your avs file and say if the mp3 is VBR or CBR.

ruanova
23rd January 2007, 16:37
The mp3 is VBR but fail in VBR, CBR and PCM WAV.
This is the .avs (very simple...!)

video = DirectShowSource("C:\myVideo.avi", audio=false, fps=25, convertfps=true)
sonido = DirectShowSource("C:\myVideo.avi", video=false)

clip = AudioDub(video, sonido)

return clip.Trim(0, 2085) + clip.Trim(2085, 6079) + clip.Trim(6168, 22109) + clip.Trim(22164, 31248) + clip.Trim(31248, 34195) + clip.Trim(34282, 38013)

This also it fails:
clip = AVISource("C:\myVideo.avi")

return clip.Trim(0, 2085) + clip.Trim(2085, 6079) + clip.Trim(6168, 22109) + clip.Trim(22164, 31248) + clip.Trim(31248, 34195) + clip.Trim(34282, 38013)

I made this a lot of times with .d2v and .mpa files as source, and not problem ...

(Sorry by my english)

tebasuna51
24th January 2007, 03:50
Include NicAudio.dll (http://nic.dnsalias.com/NicAudio_alpha3.zip) at ...\Avisynth 2.5\Plugins folder, and try this method:

- First check if there are a old VirtualDub delay (leading zeroes) in audio track from spanish avi (with AviMuxGUI).

- Extract the mp3 (with AviMuxGUI or VirtualDubMod)

- Use a script like:
# Open only the audio with dedicated decoder
NicMPG123Source("C:\myAudio.mp3")

# If exist a delay
DelayAudio(float_seconds)

# Dub with BlankClip 25 fps
AudioDubEx(BlankClip(length=Int(25*AudioLengthF(last)/Audiorate(last)), width=32, height=32, pixel_type="RGB24", fps=25), last)

# Now trim with calculated values
Trim(0, 2085) + Trim(2085, 6079) + Trim(6168, 22109) + Trim(22164, 31248) + Trim(31248, 34195) + Trim(34282, 38013)

#KillVideo() #if you have AviSynth v2.5.7 or:
AudioDubEx(Tone(), last)

And encode with bepipe.

Good luck.

ruanova
24th January 2007, 11:17
Yes, yes, yes .... !

That's the way. Thanks. Now I know something else .....