Expand description
Video and audio filter graph operations — the Rust way.
This crate provides a safe, ergonomic API for constructing and running
FFmpeg libavfilter filter graphs. All unsafe FFmpeg internals are
encapsulated in the filter_inner module; users never need to write unsafe code.
§Quick start
ⓘ
use ff_filter::{FilterGraph, ToneMap};
use std::time::Duration;
// Build a filter graph: scale to 1280×720, then apply tone mapping.
let mut graph = FilterGraph::builder()
.scale(1280, 720)
.tone_map(ToneMap::Hable)
.build()?;
// Push decoded VideoFrames in …
graph.push_video(0, &decoded_frame)?;
// … and pull filtered frames out.
while let Some(frame) = graph.pull_video()? {
// encode or display `frame`
}§Module structure
graph— public types:FilterGraph,FilterGraphBuilder,ToneMap,HwAccelerror—FilterErrorfilter_inner—pub(crate)unsafeFFmpegcalls (not part of the public API)
Re-exports§
pub use analysis::LoudnessMeter;pub use analysis::LoudnessResult;pub use analysis::QualityMetrics;pub use animation::AnimatedValue;pub use animation::AnimationEntry;pub use animation::AnimationTrack;pub use animation::Easing;pub use animation::Keyframe;pub use animation::Lerp;pub use blend::BlendMode;pub use error::FilterError;pub use graph::AudioConcatenator;pub use graph::AudioTrack;pub use graph::ClipJoiner;pub use graph::DrawTextOptions;pub use graph::EqBand;pub use graph::FilterGraph;pub use graph::FilterGraphBuilder;pub use graph::FilterStep;pub use graph::HwAccel;pub use graph::MultiTrackAudioMixer;pub use graph::MultiTrackComposer;pub use graph::Rgb;pub use graph::ScaleAlgorithm;pub use graph::ToneMap;pub use graph::VideoConcatenator;pub use graph::VideoLayer;pub use graph::XfadeTransition;pub use graph::YadifMode;
Modules§
- analysis
- Loudness, audio analysis, and video quality metric tools for media files.
- animation
- Keyframe animation system for time-varying filter parameters.
- blend
- Blend mode definitions for video compositing operations.
- error
- Error types for filter graph operations.
- graph
- Filter graph public API:
FilterGraphandFilterGraphBuilder.