pub struct VideoLayer {Show 17 fields
pub source: PathBuf,
pub proxy: Option<ProxySource>,
pub input_format: Option<String>,
pub x: AnimatedValue<f64>,
pub y: AnimatedValue<f64>,
pub scale_x: AnimatedValue<f64>,
pub scale_y: AnimatedValue<f64>,
pub rotation: AnimatedValue<f64>,
pub opacity: AnimatedValue<f64>,
pub z_order: u32,
pub time_offset: Duration,
pub in_point: Option<Duration>,
pub out_point: Option<Duration>,
pub in_transition: Option<ClipTransition>,
pub blend_mode: BlendMode,
pub composite_op: CompositeOp,
pub effects: Vec<FilterStep>,
}Expand description
A single video layer in a MultiTrackComposer composition.
Layers are composited in ascending z_order, with
0 rendered first (bottom of the stack).
The x, y, scale_x, scale_y, rotation, and opacity fields accept
either a constant (AnimatedValue::Static) or a time-varying keyframe
track (AnimatedValue::Track). The initial filter graph is built from
the value at Duration::ZERO; per-frame updates are added in issue #363.
Fields§
§source: PathBufSource media file path, or a lavfi filtergraph string when
input_format is Some("lavfi").
proxy: Option<ProxySource>Optional low-resolution proxy to decode from instead of source.
When Some, frames are decoded from the proxy and scaled up to the
original source resolution before trim/effects/compositing, so the
output is identical in size to a non-proxy render. Ignored when
input_format is Some("lavfi").
input_format: Option<String>Optional FFmpeg input format name passed to the movie filter.
When Some("lavfi"), source is interpreted as a filtergraph string
(e.g. "color=s=1920x1080:c=black@0.0,drawtext=text='Title'") and opened
via FFmpeg’s lavfi virtual demuxer. When None (the default), source
is opened as an ordinary media file.
x: AnimatedValue<f64>X offset on the canvas in pixels (top-left origin).
y: AnimatedValue<f64>Y offset on the canvas in pixels.
scale_x: AnimatedValue<f64>Horizontal scale factor applied to the source frame (1.0 = original width).
scale_y: AnimatedValue<f64>Vertical scale factor applied to the source frame (1.0 = original height).
rotation: AnimatedValue<f64>Clockwise rotation in degrees (0.0 = no rotation).
opacity: AnimatedValue<f64>Opacity (0.0 = fully transparent, 1.0 = fully opaque).
z_order: u32Compositing order (0 = bottom layer; higher values render on top).
time_offset: DurationStart offset on the output timeline (Duration::ZERO = at the beginning).
in_point: Option<Duration>Optional trim start within the source file.
out_point: Option<Duration>Optional trim end within the source file.
in_transition: Option<ClipTransition>Transition applied at the start of this layer (from the preceding layer on the same z-order).
None = hard cut. Set by MultiTrackComposer::join_with_dissolve.
blend_mode: BlendModeHow this layer blends with the layer(s) below it.
BlendMode::Normal uses the FFmpeg overlay filter (standard alpha-over composite).
All other modes use the FFmpeg blend filter with the corresponding all_mode.
Defaults to BlendMode::Normal.
Colour blend only — applies when composite_op is
CompositeOp::Over. For a non-Over composite op the layer is composited
by the Porter-Duff operator and blend_mode is not additionally applied.
composite_op: CompositeOpPorter-Duff alpha-compositing operator for placing this layer over the
canvas. Defaults to CompositeOp::Over (standard alpha-over).
Over keeps the existing blend_mode compositing
(overlay / blend all_mode). Under/In/Out/Atop/Xor composite the
layer via the corresponding Porter-Duff construction (the colour
blend_mode is not applied in that case).
For a non-Over op, opacity uses its initial value
only — animated opacity is not tracked per-frame on these paths (the
blend all_opacity / overlay alpha is set once at build time).
effects: Vec<FilterStep>Per-layer video filter steps applied to this layer’s decoded stream before compositing.
Applied in order after trim/setpts/scale/rotate/opacity and before the overlay node.
Typical use: FilterStep::Eq { brightness, contrast, saturation } for per-clip color
correction. An empty Vec (the default) is a no-op.
Trait Implementations§
Source§impl Clone for VideoLayer
impl Clone for VideoLayer
Source§fn clone(&self) -> VideoLayer
fn clone(&self) -> VideoLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more