Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

stack_horizontal

stack_horizontal(
  input: [Clip, Clip, ...]
)

Stacks two or more clips horizontally in input order. The first clip is placed at the left, and each later clip is placed to the right of the previous input.

Use array input form: std.stack_horizontal([left, right]). Every input clip must use fixed format, fixed resolution, finite frame count, and constant frame rate. All inputs must have identical format, height, frame count, and frame rate.

For subsampled formats, each horizontal stack boundary must align to chroma plane divisors. For example, when stacking yuv420p8, every input except the last must have an even width.

Frame properties on each output frame are copied from the first input clip for the requested frame number.

Examples

left = source("left.mkv")
right = source("right.mkv")
output = std.stack_horizontal([left, right])
a = source("camera-a.mkv")
b = source("camera-b.mkv")
c = source("camera-c.mkv")
output = std.stack_horizontal([a, b, c])

Input

Two or more fixed-format planar Gray, YUV, or planar RGB clips with matching height, format, finite frame count, and matching constant frame rate, passed in array form.

Output

A clip with the same format, frame count, and frame rate. The output height matches the inputs, the output width is the sum of input widths, and per-frame metadata comes from the first input.

stack_vertical

stack_vertical(
  input: [Clip, Clip, ...]
)

Stacks two or more clips vertically in input order. The first clip is placed at the top, and each later clip is placed below the previous input.

Use array input form: std.stack_vertical([top, bottom]). Every input clip must use fixed format, fixed resolution, finite frame count, and constant frame rate. All inputs must have identical format, width, frame count, and frame rate.

For subsampled formats, each vertical stack boundary must align to chroma plane divisors. For example, when stacking yuv420p8, every input except the last must have an even height.

Frame properties on each output frame are copied from the first input clip for the requested frame number.

Examples

top = source("top.mkv")
bottom = source("bottom.mkv")
output = std.stack_vertical([top, bottom])
header = source("header.mkv")
main = source("main.mkv")
footer = source("footer.mkv")
output = std.stack_vertical([header, main, footer])

Input

Two or more fixed-format planar Gray, YUV, or planar RGB clips with matching width, format, finite frame count, and matching constant frame rate, passed in array form.

Output

A clip with the same format, frame count, and frame rate. The output width matches the inputs, the output height is the sum of input heights, and per-frame metadata comes from the first input.