Skip to main content

FilterStep

Enum FilterStep 

Source
#[non_exhaustive]
pub enum FilterStep {
Show 101 variants Format { pix_fmts: Vec<PixelFormat>, color_spaces: Vec<ColorSpace>, color_ranges: Vec<ColorRange>, }, SetParams { color_space: Option<ColorSpace>, color_range: Option<ColorRange>, color_primaries: Option<ColorPrimaries>, color_trc: Option<ColorTransfer>, }, Trim { start: Option<f64>, end: Option<f64>, }, ResetPts, OffsetPts { seconds: f64, }, Scale { width: u32, height: u32, algorithm: ScaleAlgorithm, }, Crop { x: u32, y: u32, width: u32, height: u32, }, Overlay { x: i32, y: i32, }, FadeIn { start: f64, duration: f64, }, FadeOut { start: f64, duration: f64, }, AFadeIn { start: f64, duration: f64, }, AFadeOut { start: f64, duration: f64, }, FadeInWhite { start: f64, duration: f64, }, FadeOutWhite { start: f64, duration: f64, }, Rotate { angle_degrees: f64, fill_color: String, }, ToneMap(ToneMap), Volume(f64), Amix(usize), ParametricEq { bands: Vec<EqBand>, }, Lut3d { path: String, }, Eq { brightness: f32, contrast: f32, saturation: f32, temperature: f32, tint: f32, }, EqAnimated { brightness: AnimatedValue<f64>, contrast: AnimatedValue<f64>, saturation: AnimatedValue<f64>, gamma: AnimatedValue<f64>, temperature: AnimatedValue<f64>, tint: AnimatedValue<f64>, }, ColorBalanceAnimated { lift: AnimatedValue<(f64, f64, f64)>, gamma: AnimatedValue<(f64, f64, f64)>, gain: AnimatedValue<(f64, f64, f64)>, }, Curves { master: Vec<(f32, f32)>, r: Vec<(f32, f32)>, g: Vec<(f32, f32)>, b: Vec<(f32, f32)>, }, WhiteBalance { temperature_k: u32, tint: f32, }, Hue { degrees: f32, }, Gamma { r: f32, g: f32, b: f32, }, ThreeWayCC { lift: Rgb, gamma: Rgb, gain: Rgb, }, ThreeWayCCAnimated { lift: [AnimatedValue<f64>; 3], gamma: [AnimatedValue<f64>; 3], gain: [AnimatedValue<f64>; 3], }, Vignette { angle: f32, x0: f32, y0: f32, }, VignetteAnimated { amount: AnimatedValue<f64>, x0: f32, y0: f32, }, Hsl { hue: f32, saturation: f32, lightness: f32, }, HslAnimated { hue: AnimatedValue<f64>, saturation: AnimatedValue<f64>, lightness: AnimatedValue<f64>, }, HFlip, VFlip, Reverse, AReverse, Pad { width: u32, height: u32, x: i32, y: i32, color: String, }, FitToAspect { width: u32, height: u32, color: String, }, FillToAspect { width: u32, height: u32, }, GBlur { sigma: f32, }, CropAnimated { x: AnimatedValue<f64>, y: AnimatedValue<f64>, width: AnimatedValue<f64>, height: AnimatedValue<f64>, }, GBlurAnimated { sigma: AnimatedValue<f64>, }, ScaleAnimated { width: AnimatedValue<f64>, height: AnimatedValue<f64>, algorithm: ScaleAlgorithm, }, RotateAnimated { angle: AnimatedValue<f64>, fill_color: String, }, Unsharp { luma_strength: f32, chroma_strength: f32, }, UnsharpAnimated { luma_strength: AnimatedValue<f64>, chroma_strength: AnimatedValue<f64>, }, Hqdn3d { luma_spatial: f32, chroma_spatial: f32, luma_tmp: f32, chroma_tmp: f32, }, Nlmeans { strength: f32, }, Yadif { mode: YadifMode, }, XFade { transition: XfadeTransition, duration: f64, offset: f64, }, DrawText { opts: DrawTextOptions, }, SubtitlesSrt { path: String, force_style: Option<String>, }, SubtitlesAss { path: String, }, Speed { factor: f64, }, LoudnessNormalize { target_lufs: f32, true_peak_db: f32, lra: f32, }, NormalizePeak { target_db: f32, }, ANoiseGate { threshold_db: f32, attack_ms: f32, release_ms: f32, }, ACompressor { threshold_db: f32, ratio: f32, attack_ms: f32, release_ms: f32, makeup_db: f32, }, StereoToMono, ChannelMap { mapping: String, }, AudioDelay { ms: f64, }, ATrim { start: Option<f64>, end: Option<f64>, }, AResetPts, ConcatVideo { n: u32, }, ConcatAudio { n: u32, }, FreezeFrame { pts: f64, duration: f64, }, Ticker { text: String, y: String, speed_px_per_sec: f32, font_size: u32, font_color: String, }, OverlayImage { path: String, x: String, y: String, opacity: f32, width: Option<String>, height: Option<String>, }, Blend { top: Box<FilterGraphBuilder>, mode: BlendMode, opacity: f32, alpha: AlphaMode, }, Composite { op: CompositeOp, top: Box<FilterGraphBuilder>, opacity: f32, alpha: AlphaMode, }, ChromaKey { color: String, similarity: f32, blend: f32, }, ChromaKeyAnimated { color: String, similarity: AnimatedValue<f64>, blend: AnimatedValue<f64>, }, ColorKey { color: String, similarity: f32, blend: f32, }, SpillSuppress { key_color: String, strength: f32, }, AlphaMatte { matte: Box<FilterGraphBuilder>, }, LumaKey { threshold: f32, tolerance: f32, softness: f32, invert: bool, }, RectMask { x: u32, y: u32, width: u32, height: u32, invert: bool, }, RectMaskAnimated { x: AnimatedValue<f64>, y: AnimatedValue<f64>, width: AnimatedValue<f64>, height: AnimatedValue<f64>, invert: bool, }, LumaMask { invert: bool, }, FeatherMask { radius: u32, }, MotionBlur { shutter_angle_degrees: f32, sub_frames: u8, }, MotionBlurAnimated { shutter_angle: AnimatedValue<f64>, sub_frames: u8, }, LensCorrection { k1: f32, k2: f32, }, FilmGrain { luma_strength: f32, chroma_strength: f32, }, FilmGrainAnimated { luma_strength: AnimatedValue<f64>, chroma_strength: AnimatedValue<f64>, }, ScaleMultiplier { factor: f32, }, ChromaticAberration { rh: i32, bh: i32, }, Glow { threshold: f32, radius: f32, intensity: f32, }, GlowAnimated { threshold: AnimatedValue<f64>, radius: AnimatedValue<f64>, intensity: AnimatedValue<f64>, }, ReverbIr { ir_path: String, wet: f32, dry: f32, pre_delay_ms: u32, }, ReverbEcho { in_gain: f32, out_gain: f32, delays: Vec<f32>, decays: Vec<f32>, }, PitchShift { semitones: f32, algo: PitchAlgo, }, TimeStretch { factor: f32, algo: PitchAlgo, }, SpeedChange { factor: f64, }, NoiseReduce { noise_type_flag: String, nr_level: f32, }, NoiseReduceProfile { profile_duration_secs: f32, nr_level: f32, }, Duck { threshold_linear: f32, ratio: f32, attack_ms: f32, release_ms: f32, }, PolygonMatte { vertices: Vec<(f32, f32)>, invert: bool, }, Raw { filter: String, args: String, }, ParseDesc { desc: String, },
}
Expand description

A single step in a filter chain.

Used by crate::FilterGraphBuilder to build pipeline filter graphs, and by crate::AudioTrack::effects to attach per-track effects in a multi-track mix.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Format

Convert video to a suitable pixel format from the given options.

Fields

§pix_fmts: Vec<PixelFormat>
§color_spaces: Vec<ColorSpace>
§color_ranges: Vec<ColorRange>
§

SetParams

Tag the stream’s colour metadata via the setparams filter.

Each field is emitted only when Some and its FfmpegToken is Some (e.g. Unknown → skipped), so an all-None step yields empty args. This is the consumer for ColorPrimaries / ColorTransfer, whose tokens the format filter has no option for.

Fields

§color_space: Option<ColorSpace>
§color_range: Option<ColorRange>
§color_primaries: Option<ColorPrimaries>
§

Trim

Trim: keep only frames in [start, end) seconds. Either bound may be None for an open range (start=None keeps from 0; end=None keeps to end-of-stream).

Fields

§start: Option<f64>
§

ResetPts

Reset timestamps to start at zero (setpts=PTS-STARTPTS). Typically follows a Trim so a placed clip’s timeline offset is applied from zero.

§

OffsetPts

Shift every frame’s presentation timestamp forward by seconds (setpts=PTS+{seconds}/TB). Places a layer later on the output timeline.

Fields

§seconds: f64
§

Scale

Scale to a new resolution using the given resampling algorithm.

Fields

§width: u32
§height: u32
§algorithm: ScaleAlgorithm
§

Crop

Crop a rectangular region.

Fields

§width: u32
§height: u32
§

Overlay

Overlay a second stream at position (x, y).

Fields

§

FadeIn

Fade-in from black starting at start seconds, over duration seconds.

Fields

§start: f64
§duration: f64
§

FadeOut

Fade-out to black starting at start seconds, over duration seconds.

Fields

§start: f64
§duration: f64
§

AFadeIn

Audio fade-in from silence starting at start seconds, over duration seconds.

Fields

§start: f64
§duration: f64
§

AFadeOut

Audio fade-out to silence starting at start seconds, over duration seconds.

Fields

§start: f64
§duration: f64
§

FadeInWhite

Fade-in from white starting at start seconds, over duration seconds.

Fields

§start: f64
§duration: f64
§

FadeOutWhite

Fade-out to white starting at start seconds, over duration seconds.

Fields

§start: f64
§duration: f64
§

Rotate

Rotate clockwise by angle_degrees, filling exposed areas with fill_color.

Fields

§angle_degrees: f64
§fill_color: String
§

ToneMap(ToneMap)

HDR-to-SDR tone mapping.

§

Volume(f64)

Adjust audio volume (in dB; negative = quieter).

§

Amix(usize)

Mix n audio inputs together (additive: the inputs are summed, not averaged, via normalize=0).

§

ParametricEq

Multi-band parametric equalizer (low-shelf, high-shelf, or peak bands).

Each band maps to its own FFmpeg filter node chained in sequence. The bands vec must not be empty.

Fields

§bands: Vec<EqBand>
§

Lut3d

Apply a 3D LUT from a .cube or .3dl file.

Fields

§path: String
§

Eq

Brightness/contrast/saturation adjustment via FFmpeg eq filter.

temperature/tint are carried for the derive-to-ff-render ColorGradeNode mapping (GPU-default path) and are not applied by the CPU eq filter, which has no such option; they are a GPU-only enrichment (like MotionBlur.sub_frames on the CPU tblend). Range −1.0..=1.0 each, neutral 0.0.

Fields

§brightness: f32
§contrast: f32
§saturation: f32
§temperature: f32

Colour temperature offset (−1.0 cool/blue, +1.0 warm/orange). GPU-only.

§tint: f32

Colour tint offset (−1.0 magenta, +1.0 green). GPU-only.

§

EqAnimated

Brightness / contrast / saturation / gamma via FFmpeg eq filter (optionally animated).

Arguments are evaluated at Duration::ZERO for the initial graph build. Per-frame updates are applied via avfilter_graph_send_command in #363.

temperature/tint are carried for the GPU ColorGradeNode mapping and are not applied by the CPU eq filter (a GPU-only enrichment; see Self::Eq).

Fields

§brightness: AnimatedValue<f64>

Brightness offset. Range: −1.0 – 1.0 (neutral: 0.0).

§contrast: AnimatedValue<f64>

Contrast multiplier. Range: 0.0 – 3.0 (neutral: 1.0).

§saturation: AnimatedValue<f64>

Saturation multiplier. Range: 0.0 – 3.0 (neutral: 1.0; 0.0 = grayscale).

§gamma: AnimatedValue<f64>

Global gamma correction. Range: 0.1 – 10.0 (neutral: 1.0).

§temperature: AnimatedValue<f64>

Colour temperature offset (−1.0 – 1.0; neutral 0.0). GPU-only.

§tint: AnimatedValue<f64>

Colour tint offset (−1.0 – 1.0; neutral 0.0). GPU-only.

§

ColorBalanceAnimated

Three-way color balance (shadows / midtones / highlights) via FFmpeg colorbalance filter (optionally animated).

Each tuple is (R, G, B). Valid range per component: −1.0 – 1.0 (neutral: 0.0).

Arguments are evaluated at Duration::ZERO for the initial graph build. Per-frame updates are applied via avfilter_graph_send_command in #363.

Fields

§lift: AnimatedValue<(f64, f64, f64)>

Shadows (lift) correction per channel. FFmpeg params: "rs", "gs", "bs".

§gamma: AnimatedValue<(f64, f64, f64)>

Midtones (gamma) correction per channel. FFmpeg params: "rm", "gm", "bm".

§gain: AnimatedValue<(f64, f64, f64)>

Highlights (gain) correction per channel. FFmpeg params: "rh", "gh", "bh".

§

Curves

Per-channel RGB color curves adjustment.

Fields

§master: Vec<(f32, f32)>
§r: Vec<(f32, f32)>
§g: Vec<(f32, f32)>
§b: Vec<(f32, f32)>
§

WhiteBalance

White balance correction via colorchannelmixer.

Fields

§temperature_k: u32
§tint: f32
§

Hue

Hue rotation by an arbitrary angle.

Fields

§degrees: f32
§

Gamma

Per-channel gamma correction via FFmpeg eq filter.

Fields

§

ThreeWayCC

Three-way colour corrector (lift / gamma / gain) via FFmpeg curves filter.

Fields

§lift: Rgb

Affects shadows (blacks). Neutral: Rgb::NEUTRAL.

§gamma: Rgb

Affects midtones. Neutral: Rgb::NEUTRAL. All components must be > 0.0.

§gain: Rgb

Affects highlights (whites). Neutral: Rgb::NEUTRAL.

§

ThreeWayCCAnimated

Three-way (lift/gamma/gain) colour corrector with optionally animated per-channel parameters.

Parameters are evaluated at Duration::ZERO for the graph build. curves takes string curve options rather than scalars, so it is not driven by send_command here: the CPU (libavfilter) path renders the Duration::ZERO curves statically; the GPU path (ff_render::ColorWheelsNode) animates the parameters per frame. Each [R, G, B] array carries the per-channel tracks, with the same Rgb::NEUTRAL (1.0) convention as ThreeWayCC.

Fields

§lift: [AnimatedValue<f64>; 3]

Shadows (lift) per channel [R, G, B]. Neutral: 1.0.

§gamma: [AnimatedValue<f64>; 3]

Midtones (gamma) per channel [R, G, B]. Neutral: 1.0; must be > 0.0.

§gain: [AnimatedValue<f64>; 3]

Highlights (gain) per channel [R, G, B]. Neutral: 1.0.

§

Vignette

Vignette effect via FFmpeg vignette filter.

Fields

§angle: f32

Radius angle in radians (valid range: 0.0 – π/2 ≈ 1.5708). Default: π/5 ≈ 0.628.

§x0: f32

Horizontal centre of the vignette. 0.0 maps to w/2.

§y0: f32

Vertical centre of the vignette. 0.0 maps to h/2.

§

VignetteAnimated

Vignette with an optionally animated normalised amount.

amount is a normalised darkening strength in [0, 1]; it maps to the vignette filter’s angle (radians) as amount * PI/2. vignette re-evaluates angle per frame under eval=frame, so a Track self-animates via a t-expression (like RotateAnimated); a Static renders a plain static vignette.

Fields

§amount: AnimatedValue<f64>

Normalised darkening amount, evaluated to [0, 1] at Duration::ZERO.

§x0: f32

Horizontal centre. 0.0 maps to w/2.

§y0: f32

Vertical centre. 0.0 maps to h/2.

§

Hsl

HSL adjustment via FFmpeg hue filter (ff_render::HslNode on the GPU).

hue works in YUV (a chroma rotation for hue/saturation, a luma add for brightness), so it approximates the GPU node’s HSL-space adjustment within a documented tolerance. lightness is scaled to the filter’s b brightness.

Fields

§hue: f32

Hue rotation in degrees.

§saturation: f32

Saturation multiplier (neutral 1.0).

§lightness: f32

Lightness offset in [-1, 1] (scaled to the hue filter’s brightness).

§

HslAnimated

HSL adjustment with optionally animated parameters.

The GPU animates per frame; the CPU (libavfilter) path renders the Duration::ZERO values (hue’s options accept t-expressions, but the CPU path is kept static so the GPU-default path is the single animated one).

Fields

§hue: AnimatedValue<f64>

Hue rotation in degrees, evaluated at Duration::ZERO.

§saturation: AnimatedValue<f64>

Saturation multiplier, evaluated at Duration::ZERO.

§lightness: AnimatedValue<f64>

Lightness offset in [-1, 1], evaluated at Duration::ZERO.

§

HFlip

Horizontal flip (mirror left-right).

§

VFlip

Vertical flip (mirror top-bottom).

§

Reverse

Reverse video playback (buffers entire clip in memory — use only on short clips).

§

AReverse

Reverse audio playback (buffers entire clip in memory — use only on short clips).

§

Pad

Pad to a target resolution with a fill color (letterbox / pillarbox).

Fields

§width: u32

Target canvas width in pixels.

§height: u32

Target canvas height in pixels.

§x: i32

Horizontal offset of the source frame within the canvas. Negative values are replaced with (ow-iw)/2 (centred).

§y: i32

Vertical offset of the source frame within the canvas. Negative values are replaced with (oh-ih)/2 (centred).

§color: String

Fill color (any FFmpeg color string, e.g. "black", "0x000000").

§

FitToAspect

Scale (preserving aspect ratio) then centre-pad to fill target dimensions (letterbox or pillarbox as required).

Implemented as a scale filter with force_original_aspect_ratio=decrease followed by a pad filter that centres the scaled frame on the canvas.

Fields

§width: u32

Target canvas width in pixels.

§height: u32

Target canvas height in pixels.

§color: String

Fill color for the bars (any FFmpeg color string, e.g. "black").

§

FillToAspect

Scale (preserving aspect ratio) to cover the target dimensions, then centre-crop the overflow (no bars).

Implemented as a scale filter with force_original_aspect_ratio=increase followed by a crop filter that centres the scaled frame on the canvas. The counterpart to FitToAspect (cover vs contain).

Fields

§width: u32

Target canvas width in pixels.

§height: u32

Target canvas height in pixels.

§

GBlur

Gaussian blur with configurable radius.

sigma is the blur radius. Valid range: 0.0 – 10.0 (values near 0.0 are nearly a no-op; higher values produce a stronger blur).

Fields

§sigma: f32

Blur radius (standard deviation). Must be ≥ 0.0.

§

CropAnimated

Crop with optionally animated boundaries (pixels, f64 for sub-pixel precision).

Arguments are evaluated at Duration::ZERO for the initial graph build. Per-frame updates are applied via avfilter_graph_send_command in #363.

Fields

§x: AnimatedValue<f64>

X offset of the top-left corner, in pixels.

§y: AnimatedValue<f64>

Y offset of the top-left corner, in pixels.

§width: AnimatedValue<f64>

Width of the cropped region. Must evaluate to > 0 at Duration::ZERO.

§height: AnimatedValue<f64>

Height of the cropped region. Must evaluate to > 0 at Duration::ZERO.

§

GBlurAnimated

Gaussian blur with an optionally animated sigma (blur radius).

Arguments are evaluated at Duration::ZERO for the initial graph build. Per-frame updates are applied via avfilter_graph_send_command in #363.

Fields

§sigma: AnimatedValue<f64>

Blur radius (standard deviation). Must evaluate to ≥ 0.0 at Duration::ZERO.

§

ScaleAnimated

Scale (resize / zoom) with optionally animated width/height, in pixels.

Unlike crop, scale cannot be driven by send_command (its output size is fixed at init); instead this self-animates via scale=eval=frame with the width/height tracks compiled to t-expressions (AnimationTrack::to_ffmpeg_expr). The same expression is placed in both the preview and export graphs, so it animates identically. When both are Static it renders a plain static scale.

Fields

§width: AnimatedValue<f64>

Target width in pixels (expression when a Track).

§height: AnimatedValue<f64>

Target height in pixels (expression when a Track).

§algorithm: ScaleAlgorithm

Resampling algorithm (flags=).

§

RotateAnimated

Rotate with an optionally animated angle (degrees), filling exposed corners with fill_color.

rotate’s angle option is an expression re-evaluated every frame, so this self-animates via rotate=angle=EXPR: the angle track is compiled to a t-expression (AnimationTrack::to_ffmpeg_expr) and converted degrees→radians. The same expression drives preview and export. Output size stays iw×ih (corners clipped / filled). Static → a plain rotate.

Fields

§angle: AnimatedValue<f64>

Rotation angle in degrees (clockwise); an expression when a Track.

§fill_color: String

Colour for exposed corners (e.g. "black", "none" for transparent).

§

Unsharp

Sharpen or blur via unsharp mask (luma + chroma strength).

Positive values sharpen; negative values blur. Valid range for each component: −1.5 – 1.5.

Fields

§luma_strength: f32

Luma (brightness) sharpening/blurring amount. Range: −1.5 – 1.5.

§chroma_strength: f32

Chroma (colour) sharpening/blurring amount. Range: −1.5 – 1.5.

§

UnsharpAnimated

Unsharp mask with an optionally animated luma/chroma amount.

Arguments are evaluated at Duration::ZERO for the graph build. Unlike GBlurAnimated, FFmpeg’s unsharp exposes no runtime-settable parameter (verified against the pinned 7.1/8.0 source), so it cannot be driven by send_command and it has no per-frame expression. On the CPU (libavfilter) path it therefore renders the Duration::ZERO value statically; the GPU path animates it by re-evaluating per frame.

Fields

§luma_strength: AnimatedValue<f64>

Luma amount. Evaluated to −1.5 – 1.5 at Duration::ZERO.

§chroma_strength: AnimatedValue<f64>

Chroma amount. Evaluated to −1.5 – 1.5 at Duration::ZERO.

§

Hqdn3d

High Quality 3D noise reduction (hqdn3d).

Typical values: luma_spatial=4.0, chroma_spatial=3.0, luma_tmp=6.0, chroma_tmp=4.5. All values must be ≥ 0.0.

Fields

§luma_spatial: f32

Spatial luma noise reduction strength. Must be ≥ 0.0.

§chroma_spatial: f32

Spatial chroma noise reduction strength. Must be ≥ 0.0.

§luma_tmp: f32

Temporal luma noise reduction strength. Must be ≥ 0.0.

§chroma_tmp: f32

Temporal chroma noise reduction strength. Must be ≥ 0.0.

§

Nlmeans

Non-local means noise reduction (nlmeans).

strength controls the denoising intensity; range 1.0–30.0. Higher values remove more noise but are significantly more CPU-intensive.

NOTE: nlmeans is CPU-intensive; avoid for real-time pipelines.

Fields

§strength: f32

Denoising strength. Must be in the range [1.0, 30.0].

§

Yadif

Deinterlace using the yadif filter.

Fields

§mode: YadifMode

Deinterlacing mode controlling output frame rate and spatial checks.

§

XFade

Cross-dissolve transition between two video streams (xfade).

Requires two input slots: slot 0 is clip A, slot 1 is clip B. duration is the overlap length in seconds; offset is the PTS offset (in seconds) at which clip B begins.

Fields

§transition: XfadeTransition

Transition style.

§duration: f64

Overlap duration in seconds. Must be > 0.0.

§offset: f64

PTS offset (seconds) where clip B starts.

§

DrawText

Draw text onto the video using the drawtext filter.

Fields

§opts: DrawTextOptions

Full set of drawtext parameters.

§

SubtitlesSrt

Burn-in SRT subtitles (hard subtitles) using the subtitles filter.

Fields

§path: String

Absolute or relative path to the .srt file.

§force_style: Option<String>

Optional ASS style override for the subtitles filter’s force_style option, e.g. "Fontsize=24,PrimaryColour=&H00FFFFFF&,Alignment=2". None uses the file’s default styling. (The ass filter has no force_style; ASS files carry their own styles.)

§

SubtitlesAss

Burn-in ASS/SSA styled subtitles using the ass filter.

Fields

§path: String

Absolute or relative path to the .ass or .ssa file.

§

Speed

Playback speed change using setpts (video) and chained atempo (audio).

factor > 1.0 = fast motion; factor < 1.0 = slow motion. Valid range: 0.1–100.0.

Video path: setpts=PTS/{factor}. Audio path: the atempo filter only accepts [0.5, 2.0] per instance; filter_inner chains multiple instances to cover the full range.

Fields

§factor: f64

Speed multiplier. Must be in [0.1, 100.0].

§

LoudnessNormalize

EBU R128 two-pass loudness normalization.

Pass 1 measures integrated loudness with ebur128=peak=true:metadata=1. Pass 2 applies a linear volume correction so the output reaches target_lufs. All audio frames are buffered in memory between the two passes — use only for clips that fit comfortably in RAM.

Fields

§target_lufs: f32

Target integrated loudness in LUFS (e.g. −23.0). Must be < 0.0.

§true_peak_db: f32

True-peak ceiling in dBTP (e.g. −1.0). Must be ≤ 0.0.

§lra: f32

Target loudness range in LU (e.g. 7.0). Must be > 0.0.

§

NormalizePeak

Peak-level two-pass normalization using astats.

Pass 1 measures the true peak with astats=metadata=1. Pass 2 applies volume={gain}dB so the output peak reaches target_db. All audio frames are buffered in memory between passes — use only for clips that fit comfortably in RAM.

Fields

§target_db: f32

Target peak level in dBFS (e.g. −1.0). Must be ≤ 0.0.

§

ANoiseGate

Noise gate via FFmpeg’s agate filter.

Audio below threshold_db is attenuated; audio above passes through. The threshold is converted from dBFS to the linear scale expected by agate’s threshold parameter (linear = 10^(dB/20)).

Fields

§threshold_db: f32

Gate open/close threshold in dBFS (e.g. −40.0).

§attack_ms: f32

Attack time in milliseconds — how quickly the gate opens. Must be > 0.0.

§release_ms: f32

Release time in milliseconds — how quickly the gate closes. Must be > 0.0.

§

ACompressor

Dynamic range compressor via FFmpeg’s acompressor filter.

Reduces the dynamic range of the audio signal: peaks above threshold_db are attenuated by ratio:1. makeup_db applies additional gain after compression to restore perceived loudness.

Fields

§threshold_db: f32

Compression threshold in dBFS (e.g. −20.0).

§ratio: f32

Compression ratio (e.g. 4.0 = 4:1). Must be ≥ 1.0.

§attack_ms: f32

Attack time in milliseconds. Must be > 0.0.

§release_ms: f32

Release time in milliseconds. Must be > 0.0.

§makeup_db: f32

Make-up gain in dB applied after compression (e.g. 6.0).

§

StereoToMono

Downmix stereo to mono via FFmpeg’s pan filter.

Both channels are mixed with equal weight: mono|c0=0.5*c0+0.5*c1. The output has a single channel.

§

ChannelMap

Remap audio channels using FFmpeg’s channelmap filter.

mapping is a |-separated list of output channel names taken from input channels, e.g. "FR|FL" swaps left and right. Must not be empty.

Fields

§mapping: String

FFmpeg channelmap mapping expression (e.g. "FR|FL").

§

AudioDelay

A/V sync correction via audio delay or advance.

Positive ms: uses FFmpeg’s adelay filter to shift audio later. Negative ms: uses FFmpeg’s atrim filter to trim the audio start, effectively advancing audio by |ms| milliseconds. Zero ms: uses adelay with zero delay (no-op).

Fields

§ms: f64

Delay in milliseconds. Positive = delay; negative = advance.

§

ATrim

Audio trim: keep only samples in [start, end) seconds (atrim). Either bound may be None for an open range. The audio counterpart of Trim.

Fields

§start: Option<f64>
§

AResetPts

Reset audio timestamps to start at zero (asetpts=PTS-STARTPTS). Typically follows an ATrim so a placed track’s delay is applied from zero. The audio counterpart of ResetPts.

§

ConcatVideo

Concatenate n sequential video input segments via FFmpeg’s concat filter.

Requires n video input slots (0 through n-1). n must be ≥ 2.

Fields

§n: u32

Number of video input segments to concatenate. Must be ≥ 2.

§

ConcatAudio

Concatenate n sequential audio input segments via FFmpeg’s concat filter.

Requires n audio input slots (0 through n-1). n must be ≥ 2.

Fields

§n: u32

Number of audio input segments to concatenate. Must be ≥ 2.

§

FreezeFrame

Freeze a single frame for a configurable duration using FFmpeg’s loop filter.

The frame nearest to pts seconds is held for duration seconds, then playback resumes. Frame numbers are approximated using a 25 fps assumption; accuracy depends on the source stream’s actual frame rate.

Fields

§pts: f64

Timestamp of the frame to freeze, in seconds. Must be >= 0.0.

§duration: f64

Duration to hold the frozen frame, in seconds. Must be > 0.0.

§

Ticker

Scrolling text ticker (right-to-left) using the drawtext filter.

The text starts off-screen to the right and scrolls left at speed_px_per_sec pixels per second using the expression x = w - t * speed.

Fields

§text: String

Text to display. Special characters (\, :, ') are escaped.

§y: String

Y position as an FFmpeg expression, e.g. "h-50" or "10".

§speed_px_per_sec: f32

Horizontal scroll speed in pixels per second (must be > 0.0).

§font_size: u32

Font size in points.

§font_color: String

Font color as an FFmpeg color string, e.g. "white" or "0xFFFFFF".

§

OverlayImage

Composite a PNG image (watermark / logo) over video with optional opacity.

This is a compound step: internally it creates a movie source, an optional scale filter, a lut alpha-scaling filter, and an overlay compositing filter. The image file is loaded once at graph construction time.

Fields

§path: String

Absolute or relative path to the .png file.

§x: String

Horizontal position as an FFmpeg expression, e.g. "10" or "W-w-10".

§y: String

Vertical position as an FFmpeg expression, e.g. "10" or "H-h-10".

§opacity: f32

Opacity 0.0 (fully transparent) to 1.0 (fully opaque).

§width: Option<String>

Optional overlay width as an FFmpeg scale expression, e.g. "300" or "iw*0.15" (iw/ih are the overlay’s own dimensions). -1 preserves aspect ratio. None keeps the image’s native width.

§height: Option<String>

Optional overlay height as an FFmpeg scale expression. -1 preserves aspect ratio. None keeps the image’s native height.

§

Blend

Blend a top layer over the current stream (bottom) using the given mode.

This is a compound step:

The top builder’s steps are applied to the second input slot (in1). opacity is clamped to [0.0, 1.0] by the builder method.

Box<FilterGraphBuilder> is used to break the otherwise-recursive type: FilterStepFilterGraphBuilderVec<FilterStep>.

Not serialized: this compositor-internal variant carries a FilterGraphBuilder (which cannot round-trip serde), and it never appears in the editing model’s persisted effect chains.

Fields

§top: Box<FilterGraphBuilder>

Filter pipeline for the top (foreground) layer.

§mode: BlendMode

How the two layers are combined.

§opacity: f32

Opacity of the top layer in [0.0, 1.0]; 1.0 = fully opaque.

§alpha: AlphaMode

How the top layer’s alpha is interpreted by the overlay filter (alpha=). AlphaMode::Straight is the FFmpeg default.

§

Composite

Composite a top layer over the current stream (bottom) using a Porter-Duff alpha-compositing CompositeOp.

This is a compound, two-input step (slot 0 = bottom, slot 1 = top with the top builder’s steps applied). Over/Under are built with the overlay filter; the rest use blend with a per-channel expression.

Box<FilterGraphBuilder> breaks the otherwise-recursive type, following the same pattern as FilterStep::Blend.

Not serialized (compositor-internal; see FilterStep::Blend).

Fields

§op: CompositeOp

The Porter-Duff operator combining the two layers.

§top: Box<FilterGraphBuilder>

Filter pipeline for the top (foreground) layer.

§opacity: f32

Opacity of the top layer in [0.0, 1.0]; 1.0 = fully opaque. Only affects Over/Under (the expression operators ignore it).

§alpha: AlphaMode

How the top layer’s alpha is interpreted by the overlay filter (alpha=). AlphaMode::Straight is the FFmpeg default.

§

ChromaKey

Remove pixels matching color using FFmpeg’s chromakey filter, producing a yuva420p output with transparent areas where the key color was detected.

Use this for YCbCr-encoded sources (most video). For RGB sources use colorkey instead.

Fields

§color: String

FFmpeg color string, e.g. "green", "0x00FF00", "#00FF00".

§similarity: f32

Match radius in [0.0, 1.0]; higher = more pixels removed.

§blend: f32

Edge softness in [0.0, 1.0]; 0.0 = hard edge.

§

ChromaKeyAnimated

ChromaKey with optionally animated similarity / blend.

The GPU animates per frame; the CPU (libavfilter) path renders the Duration::ZERO values (chromakey’s options are static, so the CPU path is kept static and the GPU-default path is the single animated one, matching HslAnimated).

Fields

§color: String

FFmpeg color string, e.g. "0x00FF00".

§similarity: AnimatedValue<f64>

Match radius in [0.0, 1.0], evaluated at Duration::ZERO on the CPU.

§blend: AnimatedValue<f64>

Edge softness in [0.0, 1.0], evaluated at Duration::ZERO on the CPU.

§

ColorKey

Remove pixels matching color in RGB space using FFmpeg’s colorkey filter, producing an rgba output with transparent areas where the key color was detected.

Use this for RGB-encoded sources. For YCbCr-encoded video (most video) use chromakey instead.

Fields

§color: String

FFmpeg color string, e.g. "green", "0x00FF00", "#00FF00".

§similarity: f32

Match radius in [0.0, 1.0]; higher = more pixels removed.

§blend: f32

Edge softness in [0.0, 1.0]; 0.0 = hard edge.

§

SpillSuppress

Reduce color spill from the key color on subject edges using FFmpeg’s hue filter to desaturate the spill hue region.

Applies hue=h=0:s=(1.0 - strength). strength=0.0 leaves the image unchanged; strength=1.0 fully desaturates.

key_color is stored for future use by a more targeted per-hue implementation.

Fields

§key_color: String

FFmpeg color string identifying the spill color, e.g. "green".

§strength: f32

Suppression intensity in [0.0, 1.0]; 0.0 = no effect, 1.0 = full suppression.

§

AlphaMatte

Merge a grayscale matte as the alpha channel of the input video using FFmpeg’s alphamerge filter.

White (luma=255) in the matte produces fully opaque output; black (luma=0) produces fully transparent output.

This is a compound step: the matte builder’s pipeline is applied to the second input slot (in1) before the alphamerge filter is linked.

Box<FilterGraphBuilder> breaks the otherwise-recursive type, following the same pattern as FilterStep::Blend.

Not serialized (compositor-internal; see FilterStep::Blend).

Fields

§matte: Box<FilterGraphBuilder>

Pipeline for the grayscale matte stream (slot 1).

§

LumaKey

Key out pixels by luminance value using FFmpeg’s lumakey filter.

Pixels whose normalized luma is within tolerance of threshold are made transparent. When invert is true, a geq filter is appended to negate the alpha channel, effectively swapping transparent and opaque regions.

  • threshold: luma cutoff in [0.0, 1.0]; 0.0 = black, 1.0 = white.
  • tolerance: match radius around the threshold in [0.0, 1.0].
  • softness: edge feather width in [0.0, 1.0]; 0.0 = hard edge.
  • invert: when false, keys out bright regions (pixels matching the threshold); when true, the alpha is negated after keying, making the complementary region transparent instead.

Output carries an alpha channel (yuva420p).

Fields

§threshold: f32

Luma cutoff in [0.0, 1.0].

§tolerance: f32

Match radius around the threshold in [0.0, 1.0].

§softness: f32

Edge feather width in [0.0, 1.0]; 0.0 = hard edge.

§invert: bool

When true, the alpha channel is negated after keying.

§

RectMask

Apply a rectangular alpha mask using FFmpeg’s geq filter.

Pixels inside the rectangle defined by (x, y, width, height) are made fully opaque (alpha=255); pixels outside are made fully transparent (alpha=0). When invert is true the roles are swapped: inside becomes transparent and outside becomes opaque.

  • x, y: top-left corner of the rectangle (in pixels).
  • width, height: rectangle dimensions (must be > 0).
  • invert: when false, keeps the interior; when true, keeps the exterior.

width and height are validated in build; zero values return crate::FilterError::InvalidConfig.

The output carries an alpha channel (rgba).

Fields

§x: u32

Left edge of the rectangle (pixels from the left).

§y: u32

Top edge of the rectangle (pixels from the top).

§width: u32

Width of the rectangle in pixels (must be > 0).

§height: u32

Height of the rectangle in pixels (must be > 0).

§invert: bool

When true, the mask is inverted: outside is opaque, inside is transparent.

§

RectMaskAnimated

RectMask with optionally animated x / y / width / height.

The GPU animates the rectangle per frame; the CPU (libavfilter) path renders the Duration::ZERO values (the geq rectangle bounds are static, so the CPU path is kept static and the GPU-default path is the animated one, matching ChromaKeyAnimated). width / height are clamped to at least 1 at render time so a zero-size frame never fails geq build.

Fields

§x: AnimatedValue<f64>

Left edge in pixels, evaluated at Duration::ZERO on the CPU.

§y: AnimatedValue<f64>

Top edge in pixels, evaluated at Duration::ZERO on the CPU.

§width: AnimatedValue<f64>

Width in pixels (clamped to >= 1), evaluated at Duration::ZERO on the CPU.

§height: AnimatedValue<f64>

Height in pixels (clamped to >= 1), evaluated at Duration::ZERO on the CPU.

§invert: bool

When true, the mask is inverted: outside is opaque, inside is transparent.

§

LumaMask

Set the alpha channel to the frame’s own BT.709 luma using FFmpeg’s geq filter (a self-referential continuous luma mask).

alpha = luma, where luma = 0.2126·R + 0.7152·G + 0.0722·B on the frame’s own gamma-encoded RGB. Bright pixels stay opaque, dark pixels become transparent. When invert is true, 255 - luma is used, so dark pixels stay opaque. This is the CPU pair of ff_render::LumaMaskNode (mask = the frame itself, which multiplies the existing alpha by luma); on an opaque source alpha = luma and alpha *= luma coincide, and the coefficients match exactly. (geq exposes no alpha-read function here, so the existing alpha is replaced rather than multiplied.)

The output carries an alpha channel (rgba).

Fields

§invert: bool

When true, use 255 - luma (dark pixels stay opaque).

§

FeatherMask

Feather (soften) the alpha channel edges using a Gaussian blur.

Splits the stream into a color copy and an alpha copy, blurs the alpha plane with gblur=sigma=<radius>, then re-merges:

[in]split=2[color][with_alpha];
[with_alpha]alphaextract[alpha_only];
[alpha_only]gblur=sigma=<radius>[alpha_blurred];
[color][alpha_blurred]alphamerge[out]

radius is the blur kernel half-size in pixels and must be > 0. Validated in build; radius == 0 returns crate::FilterError::InvalidConfig.

Typically chained after a keying or masking step (e.g. FilterStep::ChromaKey, FilterStep::RectMask, FilterStep::PolygonMatte). Applying this step to a fully-opaque video (no prior alpha) is a no-op because a uniform alpha of 255 blurs to 255 everywhere.

Fields

§radius: u32

Gaussian blur kernel half-size in pixels (must be > 0).

§

MotionBlur

Simulate motion blur by blending consecutive frames via FFmpeg’s tblend filter.

shutter_angle_degrees controls the blend ratio; 360° equals a full frame-period exposure (maximum blur). sub_frames is the number of frames blended and must be in [2, 16]; it is validated by FilterGraph::motion_blur.

Fields

§shutter_angle_degrees: f32

Shutter angle in degrees (0° = no blur, 360° = full-period blur).

§sub_frames: u8

Number of frames blended. Must be in [2, 16].

§

MotionBlurAnimated

Motion blur with an optionally animated shutter angle.

tblend’s blend is written as an expression (all_expr), and blend re-evaluates that expression per frame with T bound to the frame’s presentation time in seconds. So this self-animates: the shutter track is compiled to a T-expression (AnimationTrack::to_ffmpeg_expr) and folded into the same A/B mix the constant form uses. The same expression drives preview and export.

T, not t. blend’s expression variables are upper-case (X Y W H SW SH T N A B TOP BOTTOM); a lower-case t is not among them and would evaluate as an unknown.

A Static shutter renders exactly what MotionBlur renders, so the two agree where they overlap.

Fields

§shutter_angle: AnimatedValue<f64>

Shutter angle in degrees (0° = no blur, 360° = full-period blur); an expression when a Track.

§sub_frames: u8

Number of frames blended. Must be in [2, 16].

§

LensCorrection

Correct radial lens distortion using two polynomial coefficients via FFmpeg’s lenscorrection filter.

Negative values correct barrel distortion; positive values correct pincushion distortion. Both k1 and k2 must be in [−1.0, 1.0]; validated by FilterGraph::lens_correction.

Fields

§k1: f32

First-order radial distortion coefficient. Range: [−1.0, 1.0].

§k2: f32

Second-order radial distortion coefficient. Range: [−1.0, 1.0].

§

FilmGrain

Add synthetic per-frame random film grain to luma and chroma channels via FFmpeg’s noise filter.

luma_strength and chroma_strength are clamped to [0.0, 100.0]. The allf=t flag varies the seed each frame to simulate real film grain.

Fields

§luma_strength: f32

Grain strength applied to the luma (Y) plane. Clamped to [0.0, 100.0].

§chroma_strength: f32

Grain strength applied to the Cb and Cr planes. Clamped to [0.0, 100.0].

§

FilmGrainAnimated

Temporal film grain (the noise filter) with an optionally animated strength.

Strengths are evaluated at Duration::ZERO for the graph build. Like UnsharpAnimated, noise exposes no runtime-settable parameter, so the CPU (libavfilter) path renders the Duration::ZERO strength statically; the GPU path animates it per frame. The grain pattern is temporal on both paths regardless (allf=t on the CPU, the per-frame seed on the GPU).

Fields

§luma_strength: AnimatedValue<f64>

Luma-plane grain strength. Evaluated to [0.0, 100.0] at Duration::ZERO.

§chroma_strength: AnimatedValue<f64>

Chroma-plane grain strength. Evaluated to [0.0, 100.0] at Duration::ZERO.

§

ScaleMultiplier

Uniform scale by a fractional multiplier via FFmpeg’s scale filter.

Both width and height are multiplied by factor. Used to hide warped border pixels left after lens distortion correction.

Fields

§factor: f32

Scale factor applied to both dimensions (e.g. 1.05 = 5 % zoom-in).

§

ChromaticAberration

Reduce lateral chromatic aberration by independently shifting the R and B channels via FFmpeg’s rgbashift filter.

rh and bh are the horizontal pixel shifts for the red and blue channels respectively. Derived from scale deviations by FilterGraph::fix_chromatic_aberration.

Fields

§rh: i32

Horizontal shift for the red channel in pixels (positive = right).

§bh: i32

Horizontal shift for the blue channel in pixels (positive = right).

§

Glow

Glow / bloom effect: blends blurred highlights back over the image via split, curves, gblur, and blend filters.

This is a compound step — see FilterGraph::glow for parameter semantics.

Fields

§threshold: f32

Luminance threshold that triggers the glow (clamped to [0.0, 1.0]).

§radius: f32

Gaussian blur radius in pixels (clamped to [0.5, 50.0]).

§intensity: f32

Additive blend strength (clamped to [0.0, 2.0]).

§

GlowAnimated

Glow / bloom (the compound split/curves/gblur/blend chain) with optionally animated parameters.

Parameters are evaluated at Duration::ZERO for the graph build. None of the sub-filters expose a runtime-settable glow parameter, so the CPU path renders the Duration::ZERO values statically; the GPU path (ff_render::GlowNode) animates them per frame.

Fields

§threshold: AnimatedValue<f64>

Luminance threshold. Evaluated to [0.0, 1.0] at Duration::ZERO.

§radius: AnimatedValue<f64>

Gaussian blur radius in pixels. Evaluated to [0.5, 50.0] at Duration::ZERO.

§intensity: AnimatedValue<f64>

Additive blend strength. Evaluated to [0.0, 2.0] at Duration::ZERO.

§

ReverbIr

Convolution reverb using an impulse response (IR) audio file.

The IR is loaded via FFmpeg’s amovie filter, optionally delayed by pre_delay_ms via adelay, then convolved with the main audio stream via FFmpeg’s afir filter.

This is a compound step — see FilterGraph::reverb_ir for parameter semantics.

Fields

§ir_path: String

Absolute or relative path to the .wav or .flac IR file.

§wet: f32

Wet (reverb) mix level in [0.0, 1.0].

§dry: f32

Dry (original) mix level in [0.0, 1.0].

§pre_delay_ms: u32

Pre-delay before the reverb tail in milliseconds (clamped to 0–500).

§

ReverbEcho

Algorithmic multi-tap echo/reverb via FFmpeg’s aecho filter.

in_gain and out_gain are amplitude multipliers clamped to [0.0, 1.0]. delays contains delay times in milliseconds (one per tap); decays contains the corresponding decay factors in [0.0, 1.0]. Both vecs must have equal length in the range 1–8; validated by FilterGraph::reverb_echo.

Fields

§in_gain: f32

Input gain (amplitude multiplier). Clamped to [0.0, 1.0].

§out_gain: f32

Output gain (amplitude multiplier). Clamped to [0.0, 1.0].

§delays: Vec<f32>

Delay times in milliseconds (one per tap).

§decays: Vec<f32>

Decay factors per tap. Clamped to [0.0, 1.0].

§

PitchShift

Pitch shift without tempo change.

Shifts audio pitch by semitones semitones without altering playback duration. Implemented as asetrate (changes the declared sample rate to shift pitch) followed by atempo (restores the original duration).

Range: [−24.0, 24.0]; validated by FilterGraph::pitch_shift.

This is a compound step — filter_name() returns "asetrate" for validate_filter_steps; the actual graph construction is handled by filter_inner::build::build_audio_graph.

Fields

§semitones: f32

Pitch shift in semitones. Range: [−24.0, 24.0].

§algo: PitchAlgo

Backend algorithm. PitchAlgo::Rubberband uses the formant-preserving rubberband filter when available (else falls back to the signal path).

§

TimeStretch

Time-stretch audio without changing pitch via FFmpeg’s atempo filter.

factor < 1.0 = slower (longer duration); factor > 1.0 = faster (shorter duration). Range: [0.1, 10.0]. Values outside [0.5, 2.0] are realised by chaining multiple atempo instances (each in [0.5, 2.0]).

Validated by FilterGraph::time_stretch.

Fields

§factor: f32

Speed / duration factor. 0.5 = 2× longer; 2.0 = 2× shorter. Range: [0.1, 10.0].

§algo: PitchAlgo

Backend algorithm. PitchAlgo::Rubberband uses the higher-quality rubberband filter when available (else falls back to the signal path).

§

SpeedChange

Simultaneously change audio speed and pitch by the same factor.

Equivalent to playing a tape at a different speed: factor > 1.0 makes audio faster and higher; factor < 1.0 makes it slower and lower.

Uses FFmpeg’s asetrate to multiply the declared sample rate by factor without resampling. Range: [0.1, 10.0]; validated by FilterGraph::speed_change.

Fields

§factor: f64

Speed/pitch multiplier. Range: [0.1, 10.0].

§

NoiseReduce

Spectral noise reduction using a statistical noise-type model.

Uses FFmpeg’s afftdn filter. noise_type_flag is the single-letter nt parameter ("w" = white, "p" = pink, "b" = brown). nr_level is the reduction amount in dB, clamped to [0.0, 97.0].

Created by FilterGraph::noise_reduce.

Fields

§noise_type_flag: String

afftdn nt flag: "w", "p", or "b".

§nr_level: f32

Noise reduction amount in dB. Clamped to [0.0, 97.0].

§

NoiseReduceProfile

Spectral noise reduction using a captured noise profile.

Uses FFmpeg’s afftdn with the pl (profile length) option: the filter learns the noise profile from the first profile_duration_secs seconds, then subtracts it from the rest of the stream. nr_level is the reduction amount in dB, clamped to [0.0, 97.0].

Created by FilterGraph::noise_reduce_profile.

Fields

§profile_duration_secs: f32

Duration in seconds from which to capture the noise profile. Minimum 0.1.

§nr_level: f32

Noise reduction amount in dB. Clamped to [0.0, 97.0].

§

Duck

Sidechain compression for audio ducking via FFmpeg’s sidechaincompress filter.

Reduces the background audio level when the foreground (sidechain) signal exceeds the threshold. Push background audio to slot 0 and foreground audio to slot 1.

threshold_linear is the trigger level as a linear amplitude (pre-converted from dBFS by FilterGraph::duck). ratio, attack_ms, and release_ms are validated by FilterGraph::duck.

Fields

§threshold_linear: f32

Compression threshold as a linear amplitude ratio in (0.0, 1.0].

§ratio: f32

Compression ratio (e.g. 20.0 for near hard-limiting). Must be >= 1.0.

§attack_ms: f32

Attack time in milliseconds. Must be >= 0.0.

§release_ms: f32

Release time in milliseconds. Must be >= 0.0.

§

PolygonMatte

Apply a polygon alpha mask using FFmpeg’s geq filter with a crossing-number point-in-polygon test.

Pixels inside the polygon are fully opaque (alpha=255); pixels outside are fully transparent (alpha=0). When invert is true the roles are swapped.

  • vertices: polygon corners as (x, y) in [0.0, 1.0] (normalised to frame size). Minimum 3, maximum 16.
  • invert: when false, inside = opaque; when true, outside = opaque.

Vertex count and coordinates are validated in build; out-of-range values return crate::FilterError::InvalidConfig.

The geq expression is constructed from the vertex list at graph build time. Degenerate polygons (zero area) produce a fully-transparent mask. The output carries an alpha channel (rgba).

Fields

§vertices: Vec<(f32, f32)>

Polygon corners in normalised [0.0, 1.0] frame coordinates.

§invert: bool

When true, the mask is inverted: outside is opaque, inside is transparent.

§

Raw

Apply an arbitrary FFmpeg avfilter to the current stream — the escape hatch for filters not covered by the typed builder methods.

filter is the avfilter name (e.g. "selectivecolor", "pseudocolor") and args its option string (e.g. "reds=…:blues=…"; empty when the filter takes no options). It is emitted as a single node filter=args and linked in chain order like any other step, so it accepts one input and produces one output.

The filter name is checked for existence when the graph is built (build); the args are validated by FFmpeg on the first push_video / push_audio, exactly as for the typed steps. Prefer the typed builder methods where they exist; use this for filters they do not cover.

Fields

§filter: String

The avfilter name (e.g. "selectivecolor").

§args: String

The avfilter option string (e.g. "reds=…"); empty for none.

§

ParseDesc

Splice a whole libavfilter description into the chain — the escape hatch for graph shapes the step list cannot express.

desc takes the same syntax as ffmpeg -vf, so it may chain several filters ("scale=64:48,hue=s=0") and may use labels to branch and rejoin ("split[a][b];[a]hue=s=0[c];[b][c]overlay"). It is parsed with avfilter_graph_parse2 and spliced in as one step.

Use Raw for a single untyped filter; that is what it is for, and it needs no parser. This variant exists for the two things Raw cannot do: take a whole chain as one string, and describe a non-linear graph.

The description must have exactly one open input and one open output, so it links into the chain like any other step. Sources ("color=c=red", zero open inputs) and sinks are rejected.

Video only, like Raw: the audio graph builds from an allow-list of audio steps, which neither variant is in.

Fields

§desc: String

The filter description (e.g. "scale=64:48,hue=s=0").

Trait Implementations§

Source§

impl Clone for FilterStep

Source§

fn clone(&self) -> FilterStep

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FilterStep

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FilterStep

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FilterStep

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.