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 core from vapoursynth. 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. Additionally it is important to keep in mind that all functions are CamelCase. Below is an example of a script that generates a blank clip:

#######################################################################################################################
import vapoursynth as vs
from vapoursynth import 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()
#######################################################################################################################


When using VapourSynth Editor and creating a blank script it will fill in the depreciated way of getting the core variable. That method will still work, but is not recommended. Below is an example of using the depreciated get_core method:

#######################################################################################################################
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()
#######################################################################################################################