Syntax and call forms
Use supported call form that best fits your script. Paired examples in same section are alternate syntax for same operation.
Generic filter calls
output = filter(source("input.mkv"), "resize", #{ width: 1280, height: 720 })
output = source("input.mkv").resize(#{ width: 1280, height: 720 })
Zero-input filters can also use the function form directly:
output = filter("blank_clip", #{ width: 1280, height: 720 })
Built-in std namespace
output = std.resize(source("input.mkv"), #{ width: 1280, height: 720 })
output = source("input.mkv").std.resize(#{ width: 1280, height: 720 })
Zero-input built-ins use the namespace form without a clip argument:
output = std.blank_clip(#{ width: 1280, height: 720 })
Third-party plugin namespace
output = plugin.acme.blur(source("input.mkv"), #{ radius: 2 })
output = source("input.mkv").plugin.acme.blur(#{ radius: 2 })
Multi-input filters
Use array input form when filter consumes more than one clip:
y = source("input.mkv").std.split_plane(#{ plane: 0 })
u = source("input.mkv").std.split_plane(#{ plane: 1 })
v = source("input.mkv").std.split_plane(#{ plane: 2 })
output = std.merge_planes([y, u, v], #{ format: "yuv420p8" })
Metadata property reads
Use prop(clip, key) to read a metadata property from frame 0, or
prop(clip, frame, key) to read a specific zero-based frame.
clip = source("input.mkv")
output = clip
if prop(clip, 0, "core:matrix") == "bt709" {
output = clip.std.convert_colorspace(#{ matrix: "bt2020_ncl" })
}
The method form is equivalent:
clip = source("input.mkv")
frame_number = clip.prop(10, "core:frame_number")
output = clip
None metadata values return none(). Use is_none(value) before comparing or passing
optional metadata into filters.
Top-level frame metadata reads
Use these accessors to read structural frame fields from frame 0, or pass a
zero-based frame number to inspect another frame. They are runtime-backed like
prop(...): the script host may index sources and render the requested frame
while evaluating the script.
clip = source("input.mkv")
width = clip.width()
height = clip.height()
format = clip.format()
family = clip.format_family()
subsampling = clip.chroma_subsampling()
bits = clip.bit_depth()
planes = clip.plane_count()
output = clip.std.resize(#{ width: width / 2, height: height / 2 })
Function forms are also supported:
clip = source("input.mkv")
width_10 = width(clip, 10)
format_10 = format(clip, 10)
output = clip
Accessors return these values:
width,height,bit_depth, andplane_countreturn integers.formatreturns PixelFlow’s canonical pixel format string, such asyuv420p10.format_familyreturnsgray,yuv, orplanar_rgb.chroma_subsamplingreturns4:4:4,4:2:2,4:2:0, ornone()for non-YUV formats.
Negative frame numbers are rejected. Frame numbers outside the rendered clip range fail during runtime resolution.