PDA

View Full Version : making own functions


Wilbert
18th January 2002, 11:12
I noticed yesterday that you can make your own functions in avi-script. Being almost completely ignorant about it I hope someone can explain it. I took an example from videotools.net:
_____
You can define and call your own functions in AVS scripts, like
this:

function NTSC2PAL(clip c) {
# Fairly good NTSC->PAL conversion. Would be better with Smart Bob. :-)
Assert(c.height == 480, "NTSC2PAL: input clip must have 480 scan lines")
Bob(c, height=576)
ChangeFPS(50)
SeparateFields().SelectEvery(4,0,3)
return Weave()
}

AVISource("ntsc.avi").NTSC2PAL()
_____

With some effort I can figure it out what this all means, but my question is: in what editor/language do you make this, where do you save it and how do you name this file???

Thx,

Wilbert

neuron2
19th January 2002, 09:20
>>With some effort I can figure it out what this all means, but my question is: in what editor/language do you make this, where do you save it and how do you name this file???<<

You can use any text editor. The language is Avisynth scripting language. You can save it anywhere. You name it *.avs just like any other Avisynth script. Then you can open the file with (say) VirtualDub and if Avisynth is installed, it will run the script and serve frames to VirtualDub automatically.