Skip to main content

Crate ff_filter

Crate ff_filter 

Source
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

Re-exports§

pub use error::FilterError;
pub use graph::FilterGraph;
pub use graph::FilterGraphBuilder;
pub use graph::HwAccel;
pub use graph::ToneMap;

Modules§

error
Error types for filter graph operations.
graph
Filter graph public API: FilterGraph and FilterGraphBuilder.