Expand description
rff-filter — frame filters, the libavfilter equivalent.
A FilterChain is the engine’s -vf graph: an ordered list of filters
that each transform a raw VideoFrame into another. Built from an
FFmpeg-style spec string (scale=320:240,crop=100:100:0:0) and applied
between decode and encode in the transcode loop.
Filters operate on 8-bit planar YUV (4:2:0 / 4:2:2 / 4:4:4) for now;
other layouts return Error::Unsupported. Each filter is a 1-in/1-out
transform.
Structs§
- Audio
Filter Chain - An ordered
-afchain plus the resample target it requests, if any. - Filter
Chain - An ordered chain of filters (the
-vfgraph). - Filter
Complex - A
-filter_complexgraph. For now it models the most-used multi-input operation: overlay — compositing a second input over the first (logo / watermark / picture-in-picture). The labels ([0:v][1:v]...) are parsed but the wiring is fixed: input 0 is the base, input 1 the overlay.
Traits§
- Filter
- One frame transform. Implementors map a video frame to a new video frame.
Functions§
- overlay
- Composite
overonto a copy ofbaseat(x, y), both 8-bit planar YUV of the same format. Overlay pixels replace the base (YUV carries no alpha); the overlay is clipped to the base bounds and(x, y)snaps down to the chroma grid so the planes stay aligned. - trim_
audio_ frame - Sample-accurate trim: keep the intersection of this frame with
[start, end). The frame’s start timetmust be known. Public because the engine’s-ss/-twindow uses the same slice for audio — an audio “frame” can be arbitrarily large (a WAV decodes as one), so keep/drop at frame granularity would cut wildly wrong.