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

trim

trim(
  input: Clip,
  #{
    start?: Int,
    end?: Int,
  }
)

Keeps one contiguous frame range from an input clip.

The input must be one fixed-format planar Gray, YUV, or planar RGB clip with a finite frame count. start and end must be non-negative, start must not exceed end, and end must not exceed the input frame count. start is inclusive and end is exclusive, so start == end is valid and produces an empty clip.

Examples

output = source("input.mkv").std.trim(#{ start: 100, end: 200 })

Input

One fixed-format planar Gray, YUV, or planar RGB clip with a finite frame count.

Output

A clip with the same format, resolution, frame rate, and per-frame metadata, containing frames from start up to but not including end.

Options

  • start (Int, default: 0) – Select the first source frame to keep.
  • end (Int, default: input frame count) – Select the exclusive end frame.