View Full Version : Help AudioDub and Animate Cancel Out
WalterK
20th May 2006, 01:25
Ok heres the Script I'm using, I'm trying to combine a video and audio stream plus use the Animate argument in avisynth to slowly fade into color.
Unfortunately depending on where I place the Animate argument i either end up with the fade to color working and AudioDub ignored or Animate ignored while AudioDub works.
Heres the Script
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mpasource.dll")
v=DirectShowSource("E:\Projects\BeachRun.wmv")
a=MPASource( "E:\Projects\Chariots Of Fire.mp3", normalize = false).BufferAudio()
animate(250, 450, "Tweak", v, 0.0, 0.0, v, 0.0, 1.0)
AudioDub(v,a)
FadeIO2(10)
This one results in AudioDub but no fade to color.
Any Ideas?
neuron2
20th May 2006, 01:44
LoadPlugin("mpasource.dll")
v=DirectShowSource("BeachRun.wmv")
a=MPASource("Chariots Of Fire.mp3", normalize = false).BufferAudio()
vid=animate(250, 450, "Tweak", v, 0.0, 0.0, v, 0.0, 1.0)
AudioDub(vid,a)
FadeIO2(10)
WalterK
20th May 2006, 02:54
Ah I see thanks a lot neuron stil have a lot to learn its like doing CSS where you have to tag your variables.
neuron2
20th May 2006, 03:14
Yeah, it's that 'implicit last' that gets people. In the early days, (the legendary) Ben RG had to patiently explain it to me:
----- Ben RG writes -----
Here are the rules:
1. The statements in a script (or function) are evaluated one by one. If
the value of a particular statement happens to be a clip, then it's assigned
implicitly to the special variable "last", so that it's still available on
the next line.
2. If a filter expects a clip as its first argument, and you haven't
supplied that clip, then it's taken from the "last" variable.
3. The return value of a script (or a function) is the value of its final
line, unless you have an explicit "return".
The intent behind these rules was to make the most common case (linear
processing of a single clip) easier to write, by eliminating the need to
worry about variables. For example, your script above could be:
Import("vdfilters.avs")
AVISource("example.avi")
ComplementParity
ConvertToRGB
VD_SmartDeinterlace("field", "luma", true, false, false, 20)
The "Import" line doesn't return a clip, so its return value isn't saved.
The "AVISource" line produces a clip which goes into "last" (by rule 1).
The next two lines get their source clip from "last" (rule 2) and put their
result back in "last" (rule 1). The final line gets its source from "last"
and its result is the script return value (rule 3).
I write scripts of this sort all the time, so I do find the "implicit last"
to be useful. But when the implicit and explicit syntaxes are mixed, you
get weird-looking and nonintuitive scripts.
Maybe what I should do to fix this is eliminate rule (3) [sic?]. Then you would
have to write:
Import("vdfilters.avs")
AVISource("example.avi")
last.ComplementParity
last.ConvertToRGB
last.VD_SmartDeinterlace("field", "luma", true, false, false, 20)
It's a little clearer. If I eliminated all three rules, you would have to
write
Import("vdfilters.avs")
clip = AVISource("example.avi")
clip = clip.ComplementParity
clip = clip.ConvertToRGB
return clip.VD_SmartDeinterlace("field", "luma", true, false, false, 20)
That's even clearer, but I don't like being that verbose. Maybe the
language would be better off that way, though. Of course, there would still
be shorter ways:
Import("vdfilters.avs")
return AVISource("example.avi").ComplementParity.ConvertToRGB
\ .VD_SmartDeinterlace("field", "luma", true, false, false, 20)
Not that bad, really.
stickboy
20th May 2006, 07:25
Ah I see thanks a lot neuron stil have a lot to learn its like doing CSS where you have to tag your variables.You don't have to.
Animate(...)
AudioDub(a)Also would work.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.