pub enum FilterStep {
Show 52 variants
Trim {
start: f64,
end: 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,
},
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,
},
Vignette {
angle: f32,
x0: f32,
y0: f32,
},
HFlip,
VFlip,
Reverse,
AReverse,
Pad {
width: u32,
height: u32,
x: i32,
y: i32,
color: String,
},
FitToAspect {
width: u32,
height: u32,
color: String,
},
GBlur {
sigma: f32,
},
Unsharp {
luma_strength: f32,
chroma_strength: f32,
},
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,
},
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,
},
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,
},
JoinWithDissolve {
clip_a_end: f64,
clip_b_start: f64,
dissolve_dur: f64,
},
OverlayImage {
path: String,
x: String,
y: String,
opacity: f32,
},
}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§
Trim
Trim: keep only frames in [start, end) seconds.
Scale
Scale to a new resolution using the given resampling algorithm.
Crop
Crop a rectangular region.
Overlay
Overlay a second stream at position (x, y).
FadeIn
Fade-in from black starting at start seconds, over duration seconds.
FadeOut
Fade-out to black starting at start seconds, over duration seconds.
AFadeIn
Audio fade-in from silence starting at start seconds, over duration seconds.
AFadeOut
Audio fade-out to silence starting at start seconds, over duration seconds.
FadeInWhite
Fade-in from white starting at start seconds, over duration seconds.
FadeOutWhite
Fade-out to white starting at start seconds, over duration seconds.
Rotate
Rotate clockwise by angle_degrees, filling exposed areas with fill_color.
ToneMap(ToneMap)
HDR-to-SDR tone mapping.
Volume(f64)
Adjust audio volume (in dB; negative = quieter).
Amix(usize)
Mix n audio inputs together.
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.
Lut3d
Apply a 3D LUT from a .cube or .3dl file.
Eq
Brightness/contrast/saturation adjustment via FFmpeg eq filter.
Curves
Per-channel RGB color curves adjustment.
WhiteBalance
White balance correction via colorchannelmixer.
Hue
Hue rotation by an arbitrary angle.
Gamma
Per-channel gamma correction via FFmpeg eq filter.
ThreeWayCC
Three-way colour corrector (lift / gamma / gain) via FFmpeg curves filter.
Fields
Vignette
Vignette effect via FFmpeg vignette filter.
Fields
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
x: i32Horizontal offset of the source frame within the canvas.
Negative values are replaced with (ow-iw)/2 (centred).
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
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).
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
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
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.
Yadif
Deinterlace using the yadif filter.
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: XfadeTransitionTransition style.
DrawText
Draw text onto the video using the drawtext filter.
Fields
opts: DrawTextOptionsFull set of drawtext parameters.
SubtitlesSrt
Burn-in SRT subtitles (hard subtitles) using the subtitles filter.
SubtitlesAss
Burn-in ASS/SSA styled subtitles using the ass filter.
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.
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
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.
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
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
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.
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).
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.
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.
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
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
JoinWithDissolve
Join two video clips with a cross-dissolve transition.
Compound step — expands in filter_inner to:
in0 → trim(end=clip_a_end+dissolve_dur) → setpts → xfade[0]
in1 → trim(start=max(0, clip_b_start−dissolve_dur)) → setpts → xfade[1]Requires two video input slots: slot 0 = clip A, slot 1 = clip B.
clip_a_end and dissolve_dur must be > 0.0.
Fields
OverlayImage
Composite a PNG image (watermark / logo) over video with optional opacity.
This is a compound step: internally it creates a movie source,
a lut alpha-scaling filter, and an overlay compositing filter.
The image file is loaded once at graph construction time.
Trait Implementations§
Source§impl Clone for FilterStep
impl Clone for FilterStep
Source§fn clone(&self) -> FilterStep
fn clone(&self) -> FilterStep
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more