View Single Post
Old 27th December 2017, 23:07   #1  |  Link
Stephen R. Savage
Registered User
 
Stephen R. Savage's Avatar
 
Join Date: Nov 2009
Posts: 327
How to run Avisynth scripts within VapourSynth

README:
Quote:
Embed 32-bit Avisynth 2.6 or Avisynth+ environment within 64-bit VapourSynth.

Code:
avsw.Eval(string script, clip[] "clips", string[] "clip_names", string "avisynth", string "slave", string "slave_log")
script - Avisynth script fragment
clips - VapourSynth clips ("nodes") to inject into Avisynth environment
clip_names - Avisynth variable name corresponding to injected clip
avisynth - Path to Avisynth DLL. The default uses the process DLL search path.
slave - Path to avshost_native.exe slave procecss. The plugin path is searched by default.
slave_log - Log file for slave process.

The function returns the result of the Avisynth script, which may be an integer, float, string, or clip. If the result is a clip, the name of the return value is "clip", otherwise it is "result".
Example:
Code:
import vapoursynth as vs

core = vs.get_core()

red = core.std.BlankClip(color=[255, 0, 0])
green = core.std.BlankClip(color=[0, 255, 0])
# Before executing the Avisynth script, "r" and "g" are set to the bound clips.
c = core.avsw.Eval("Merge(r, g)", clips=[red, green], clip_names=["r", "g"])
c.set_output()
Link.

Last edited by Stephen R. Savage; 13th January 2018 at 18:48.
Stephen R. Savage is offline   Reply With Quote