VapourSynth 101‎ > ‎

Script Basics

VapourSynth is a way of processing videos similar to AviSynth, but it runs through Python as a module. Since this is how it functions, scripts must begin by importing vapoursynth as the variable vs and then the vapoursynth core is called by the function get_core(). After processing the video, the output is returned by the function set_output(). Unlike AviSynth, the video you are processing must be manually defined as a variable in the script. Below is an example of a script that generates a blank clip:

#######################################################################################################################
import vapoursynth as vs
core = vs.get_core()
video = core.std.BlankClip(width=640,height=480, format=vs.RGB24, length=500, fpsnum=2997, fpsden=125, color=[0, 0, 0])
video.set_output()
#######################################################################################################################


By default it functions are in CamelCase, however this can be disabled by using the accept_lowercase option in get_core, here is an example:

#######################################################################################################################
import vapoursynth as vs
core = vs.get_core(accept_lowercase=True)
video = core.std.blackclip(width=640,height=480, format=vs.RGB24, length=500, fpsnum=2997, fpsden=125, color=[0, 0, 0])
video.set_output()
#######################################################################################################################