Log in

View Full Version : Sync a/v after avs+vdub/mod+xvid


OlafMarzocchi
11th February 2007, 11:22
I captured a video from an old Video 2000 tape with Vdub (huffyuv 720x576, audio 22kHz/16bit), then I created with MeGui this avs script:

DirectShowSource("S:\v2000-1.avi",fps=25,audio=true)
FieldDeinterlace(full=false)
crop( 20, 14, -4, -16)
Convolution3D("vhsbq") # Heavy Noise
BicubicResize(512,384,0,0.5) # Bicubic (Neutral)

I then opened it with VDub 1.6.17, cut the ads (wow! ads from the 80's), set up xvid 1.1.2 with Q=3.5, adaptive, qpel, 2bvop, motion search 6/vhq 4 and saved as avi. Audio is compressed to mp3 VBR 80kbps with the LAME encoder (I installed the dll found on rarewares). Interleaving is done with standard settings: preload 500ms, interleave every 1 frame, no resync.


When I open the final AVI with VLC or MplayerClassic I hear the audio out of sync, a lot. About 3 seconds in the first part and even more in the end of the video (90'). I tried to resync the audio with MPlayer Classic, but it just doesn't work, so I cannot tell you how much.

Did I do something wrong? VDubMod has the same problem.

I ask you because each encoding is 11 hours... (P4 1800 128kb cache). I cannot make too many tries.


As side question: with motion search 6/1 I get 5fps from the whole huffyuv decoding+avs+xvid+lame chain. Most of the time is probably spent decoding the huffyuv source+avs script, since switching to motion search 6/4 brings down to only 3fps.
How much an AthlonX2 4000 would deliver? will I be able to obtain more than realtime? or, as alternative, will I be able to do a xvid Q=1+some deinterlace during the first acquisition, instead of huffyuv?

Thank you very much.

setarip_old
11th February 2007, 16:56
Hi!

1) Is the original capture in synch? If not, you should probably re-capture, using 44,100Hz or 48,000Hz PCM (.WAV) audio.

2) Is it in synch after you apply your script, but before cutting out the ads?

3) Try using CBR .MP3 instead of VBR

4) Set BOTH "Video"(VirtualDub,
VirtualDubMod and NanDub) and "Audio"
(VirtualDub and NanDub - VirtualDubMOD>"Streams>"Stream
list") to "Direct Stream Copy".

A) If the difference between audio and video is constant
throughout the video:

From the "Audio" dropdown menu, select "Interleaving" (For
VirtualDubMOD, rightclick on the listed audiostream and then
select "Interleaving")

Under "Audio skew correction", set an appropriate number of
milliseconds (positive or negative) in the box labelled "Delay
audio track by"

Save with a new filename

B) If the difference increases as the movie plays:

From under the "Video" dropdown menu, select "Framerate" -
and select "Change so video and audio durations match"

Save with a new filename

OlafMarzocchi
11th February 2007, 18:07
Ok, I will try. In the meanwhile, I discovered that the capture file is in sync, but, when I try to play the avs script opened in VDub, the audio is already out of sync. This time is not a VBR problem :-)

Maybe the best way to solve this problem is to use only VDub, from the start to the end of the processing chain. I only have to find the equivalent of "fieldDeinterlace" and a good denoise filter for VDub.

Terranigma
11th February 2007, 21:54
Or you could try using a cbr audio. vdub dislikes vbr audio.

An alternative method I would suggest, is that you download vdubmod, select the video/audio streams, go to preferences and enable "Priss Rocks!". Then do a "direct stream copy" of both streams. :devil:

OlafMarzocchi
11th February 2007, 23:30
I solved the problem. I cut the ads again from the original huffyuv video, I saved the audio as wav, compressed it to 80kbps VBR with megui, and muxed it with megui.
Now it is ok.
Next time I will probably do the same thing, but from the beginning.

I'd like to avoid using CBR because the bitrate is low, so I want the bits to be used where they are needed.

Anyway, I think I will move the complete editing step to VDub: I will use Smart deinterlacer and I'm reading now the forums to look for a good denoiser. Convolution3D worked very well with avisynth, unfortunately it doesn't work with VDub. And there are too many denoisers for vdub :-(((

setarip_old
11th February 2007, 23:53
I saved the audio as wavThis is likely what resolved things for you. Glad to hear my suggestion worked ;>}

Terranigma
12th February 2007, 01:20
Convolution3D worked very well with avisynth, unfortunately it doesn't work with VDub. And there are too many denoisers for vdub :-(((

You can preprocess using Convolution3D in Avisynth, and then frameserve it in Virtualdub. I would'nt understand why it would'nt work in virtualdub that way. Serving Vdub .avs files.

By The way, you should check out mvtools denoising filters. They're much better imo, but also much slower. :p

squid_80
12th February 2007, 03:51
Only use DirectShowSource to open .avi files when AVISource doesn't work. AVISource is a lot more predictable/reliable.

OlafMarzocchi
12th February 2007, 12:06
You can preprocess using Convolution3D in Avisynth, and then frameserve it in Virtualdub. I would'nt understand why it would'nt work in virtualdub that way. Serving Vdub .avs files.

Last time, the script I posted in the first post made the audio out of sync. Maybe it depends on FieldDeinterlace? I will try with the next video.

Terranigma
12th February 2007, 16:19
You should try what squid_80 suggested. I never had an out of sync video no matter how many filters I applied in my chain. Maybe it has something to do with the "fps=25" line, or using directshowsource instead of AVISource.

OlafMarzocchi
13th February 2007, 10:25
Thank you, I always used DirectShow because it's what megui uses and I started doing encodes with megui, not much time ago :-) I will try AVISource too, but I think I found a simpler and faster solution, even more configurable: virtualdub + ffvdub filter doing all the postprocessing.
The denoise3d shipped with ffvdub is quite good anyway, and it has three configurable parameters. Moreover, I found the encoding process faster than using avisynth serving frames to vdub.

At the time being only one problem is still there: the vbr sync. setarip_old was right: when I muxed the avi and the vbr file (I used the DivxAVI muxer megui ships, is it ok?) I obtained an AVI that plays perfectly in VLC, but has some sync problems with my divx player (strange indeed). I already encoded another two videos with the new processing chain and I used mp3 cbr for them. Doesn't matter the bits, 80 kbps are anyway a lot for a 22 kHz mono stream taken from video2000 tapes ;-)

The downside is that I have to use an external software to do the compression, since the lame acm plugin (dowloaded from rarewares, version 3.98) shows CBR settings only from 32kHz and up. I used megui as interface to compress the audio streams, any bitrate is ok with the command line mp3 encoder it uses.