View Full Version : Stumped By AudioDub problem in my script
SkilledAbbot
19th June 2006, 08:12
Hello Doom world,
I coming out of the shadows because recently one of my scripts that have always worked suddenly stopped.
====== Here's the profile ======
I'm using one of the new Alpha ver., 2.7, I think it is.
Im encoding DV caps [Canopus] to MP4 using 3GPP Converter[standard pc mp4 preset]
====== The problem======
I've always used audiodub at the top of my script, followed by color conversion, and filters without any problems. Until now. Now my scripts either will not dub the audio, or run the filters. Its funny because It worked yesterday, but not today.
Scripts [simplified]
====== No Audio, but Deinterlaces Problem =======
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
AudioDub(a,v)
ConvertToYuY2(v)
Crop(8,0,-8,0)
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
TDeint(Mode=0,Order=0,Field=0,Denoise=True,Sharp=False)
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
SimpleResize(640,480)
====== Audio, but No Deinterlacing Problem =======
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
#<--- moved audioDub...
ConvertToYuY2(v)
Crop(8,0,-8,0)
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
TDeint(Mode=0,Order=0,Field=0,Denoise=True,Sharp=False)
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
SimpleResize(640,480)
AudioDub(a,v) #<--- ...and put it at the end
====== What I've Done.======
I've googled, Checked Avisynth Documentation, and searched this forum [avisynth usage]. Most of the stuff I read on avisynth is way over my head. (when I use avisynth, I'm like a kid playing with a loaded gun, but its fun and Im always learning). However I didnt find any thing similar to the problem.
====== Last Note ======
If I move the audiodub before after the color conversion, but before deinterlace filter, avisynth throws an error saying the filter needs YV12 or YUY2 colorspacing.
Thank you in advance for shedding some light onto this for me.
AVIL
19th June 2006, 08:28
HI,
Syntax of audiobub:
AudioDub(video_clip, audio_clip)
As you want output completely proccesed video, you must insert it at end of script. Then you can try this:
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
ConvertToYuY2(v)
Crop(8,0,-8,0)
TDeint(Mode=0,Order=0,Field=0,Denoise=True,Sharp=False)
SimpleResize(640,480)
AudioDub(a)
Good luck
Boulder
19th June 2006, 08:45
====== No Audio, but Deinterlaces Problem =======
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
AudioDub(a,v)
ConvertToYuY2()
Crop(8,0,-8,0)
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
TDeint(Mode=0,Order=0,Field=0,Denoise=True,Sharp=False)
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
SimpleResize(640,480)
====== Audio, but No Deinterlacing Problem =======
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
AudioDub(v,a)
ConvertToYuY2()
Crop(8,0,-8,0)
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
TDeint(Mode=0,Order=0,Field=0,Denoise=True,Sharp=False)
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
SimpleResize(640,480)
SkilledAbbot
19th June 2006, 08:54
Thank you very much AviL and Boulder! That was very fast and much appreciated. All examples worked. 3gp runs a bit faster with the audio last. Thanks again.
SkilledAbbot
19th June 2006, 09:19
One more thing, and then I'll leave you guys alone and go back to my hole.
Boulder I think I had that variable stuck in color conversion
because avisynth was red texting me with
"Invalid Arguments to ConvertToYUY2()"
Of course its not doing it now though :)
I noticed that when I use AVIL's version I need that (v), but when I use your version, I don't! And thats all I need to know :)
Here is the script I've been using for 4 years, since I downloaded DVD2SVCD so long ago! Its probably horrendous and out of conformity and spec. But I like adding stuff to it, taking stuff out of it, rearranging it. It's gotten long over the years. But thats my smoking gun and study guide :devil: .
Again thank you! :thanks:
=== The ABBOTS GUN ==
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
AudioDub(a,v)
ConvertToYuY2()
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\GuavaComb.dll")
#GuavaComb(Mode = "NTSC", Recall = 75, MaxVariation = 25, Activation = 90)
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\PeachSmoother.dll")
SeparateFields().peachsmoother().weave()
ConvertToYV12()
# -- Cleaning --
Crop(8,0,-8,0)
# -- Deinterlacing --
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
#TDeint(Mode=0,Order=0,Field=0,Hints=True,Sharp=False)
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\DGBOB.dll")
DGBob(order=0,mode=0)
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TomsMoComp.dll")
#TomsMoComp(0,5,1)
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\Decomb.dll")
#FieldDeinterlace()
#AssumeFieldBased()
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\smoothdeinterlacer.dll")
#smoothdeinterlace()
# -- Cleaning --
#Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\deen.dll")
#Deen()
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\undot.dll")
undot()
# -- Other Cleaning --
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\FluxSmooth.dll")
#fluxsmoothST(2,2)
# -- ReSIZE --
#Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
#SimpleResize(640,480)
# -- Sharpening --
#Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\RemoveGrainSSE2.dll")
#Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\MT_MaskTools.dll")
#Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\WarpSharp.dll")
#Import("C:\DVD2SVCD\Avisynth2.5 Plugins\LimitedSharpenFaster.avsi")
#LimitedSharpenFaster()
#Trim(,)
Boulder
19th June 2006, 10:53
You don't need the variable in the ConverttoYUY2 line because AudioDub returns a video clip. This video stream is automatically given to the following Avisynth lines unless you enter some other clip variable (that is, want to input some other video stream) as a parameter. That's why you sometimes see the clip variable being written as "last". I think all functions have the default clip variable set as "last", at least this is the case with the Avisynth internal stuff.
In short:
ConverttoYUY2() is the same as ConverttoYUY2(last) in your case.
AVIL
19th June 2006, 11:56
Hi again,
Boulder has explained very well how implicit clip last is used in avisynth. My two pence is explain why when setting audiodub as last sentence, speed is enhanced. When a clip has audio, all the filters must take care of it. This is time consuming. In your case avisource with audio=false provide a clip without audio. Then all the intermediate filters saves a few microsecons in processing it. However, if script has multiple sources or the source is trimmed, care must be taken with audio/video sync.
Boulder
19th June 2006, 17:53
Since I process audio and video in separate applications, I end up extracting the audio track as WAV first via VDub. Then I disable all the audio stuff from the script and use that second script for video processing.
SkilledAbbot
4th July 2006, 01:10
Since I process audio and video in separate applications, I end up extracting the audio track as WAV first via VDub. Then I disable all the audio stuff from the script and use that second script for video processing.
Thank you very much Avil and Boulder!
Boulder I usually do the same thing, but recently Ive been doing stuff for my PSP and using 3GPP converter which seems to like to have an audio present.
Thank you again, I am very happy!:thanks:
MrTroy
4th July 2006, 21:50
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
AudioDub(a,v)
The arguments are in the wrong order. You need AudioDub(v,a), not AudioDub(a,v).
But I'm sure you already knew that, or else nothing from the above examples would've worked.
squid_80
5th July 2006, 10:35
Actually Audiodub doesn't particularly care about order. It will try and take video from the first arg and audio from the second, but if that doesn't work it will try the other way round.
SkilledAbbot
5th July 2006, 12:15
Funny, I've been using that for a while, with it reversed, and didn't have any problems. Recently Ive been using it AVRIL style, and decided to flip it back and see what happened. It still worked, but I noticed it was deinterlacing. But the audio and video were there!
Here is what Im using now for DVD to PSP via 3GP converter:
================================-
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\DGDecode.dll")
# ----DVD----
#v=mpeg2source("__src__")
#a=WavSource("__src__")
# ----CAPTURES----
v=AVISource("D:\1.avi",audio=false)
a=WavSource("D:\1.wav")
#ConvertToYuY2()
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\GuavaComb.dll")
#GuavaComb(Mode = "NTSC", Recall = 75, MaxVariation = 25, Activation = 90)
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\PeachSmoother.dll")
#SeparateFields().peachsmoother().weave()
ConvertToYV12(V)
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\deen.dll")
Deen()
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\undot.dll")
undot()
# ----DEINTERLACING----
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TDeint.dll")
TDeint(Mode=0,Order=0,Field=1,Type=3,mtnmode=3)
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\DGBOB.dll")
#DGBob(mode=0)
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\TomsMoComp.dll")
#TomsMoComp(0,5,1)
#AssumeFieldBased()
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\Decomb.dll")
#FieldDeinterlace()
#AssumeFieldBased()
#LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\smoothdeinterlacer.dll")
#smoothdeinterlace()
LoadPlugin("C:\DVD2SVCD\Avisynth2.5 Plugins\FluxSmooth.dll")
fluxsmoothST(2,2)
#Crop(8,0,-8,0)
#Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\simpleResize.dll")
#SimpleResize(640,480)
#ColorYUV(levels="PC->TV")
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\RemoveGrainSSE2.dll")
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\MT_MaskTools.dll")
Loadplugin("C:\DVD2SVCD\Avisynth2.5 Plugins\WarpSharp.dll")
Import("C:\DVD2SVCD\Avisynth2.5 Plugins\LimitedSharpenFaster.avsi")
#LimitedSharpenFaster(dest_x=640, dest_y=480,strength=15,special=True)
LimitedSharpenFaster(strength=15,special=True)
AudioDub(a)
#DelayAudio(-0.11)
====================================
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.