LuaSynth is a LuaJIT 2.0 binding for VapourSynth. It is currently a hacked together mess which was mostly created in a single sitting with very little thought, and will probably change a lot in the future if it continues to be developed.
- Install LuaJIT
- Install Lua Lanes
- Install VapourSynth
- Copy the VapourSynth dynamic library to somewhere in LuaJIT's module search path
- Copy LuaSynth to somewhere in LuaJIT's module search path
A basic script:
-- Import the LuaSynth module
local vs = require "luasynth"
-- Load FFMS2, using named parameters
vs.std.LoadPlugin{path="ffms2.dylib"}
-- Open a video file, this time using positional arguments
-- Note that named and positional arguments currently cannot be mixed
clip = vs.ffms2.Source("file.mkv")
-- Grab just the first 100 frames of the clip
-- Note that because this is Lua, everything is 1-indexed
trimmed = vs.std.Trim(clip, 1, 100)
-- Alternatively, with AVS-style chaining
-- This currently only supports positional arguments
-- If there are multiple functions with the same name in different
-- namespaces, which one will be picked is undefined
trimmed = clip:Trim(1, 100)
-- Write the clip to stdout as y4m
clip:output(io.stdout, true)
Then, to encode the script, run:
luajit file.lua | x264 --demuxer y4m -o out.mkv -
- Add a way to register lua functions as VS functions
- Integrate with VS for the avifile magic
- Packaging and installation
- Probably a bunch of other little things