pub struct FilterGraphBuilder { /* private fields */ }Expand description
Builder for constructing a FilterGraph.
Create one with FilterGraph::builder(), chain the desired filter
methods, then call build to obtain the graph.
§Examples
use ff_filter::{FilterGraph, ToneMap};
let graph = FilterGraph::builder()
.scale(1280, 720)
.tone_map(ToneMap::Hable)
.build()?;Implementations§
Source§impl FilterGraphBuilder
impl FilterGraphBuilder
Sourcepub fn trim(self, start: f64, end: f64) -> Self
pub fn trim(self, start: f64, end: f64) -> Self
Trim the stream to the half-open interval [start, end) in seconds.
Sourcepub fn crop(self, x: u32, y: u32, width: u32, height: u32) -> Self
pub fn crop(self, x: u32, y: u32, width: u32, height: u32) -> Self
Crop a rectangle starting at (x, y) with the given dimensions.
Sourcepub fn tone_map(self, algorithm: ToneMap) -> Self
pub fn tone_map(self, algorithm: ToneMap) -> Self
Apply HDR-to-SDR tone mapping using the given algorithm.
Sourcepub fn volume(self, gain_db: f64) -> Self
pub fn volume(self, gain_db: f64) -> Self
Adjust audio volume by gain_db decibels (negative = quieter).
Sourcepub fn equalizer(self, band_hz: f64, gain_db: f64) -> Self
pub fn equalizer(self, band_hz: f64, gain_db: f64) -> Self
Apply a parametric equalizer band at band_hz Hz with gain_db dB.
Sourcepub fn hardware(self, hw: HwAccel) -> Self
pub fn hardware(self, hw: HwAccel) -> Self
Enable hardware-accelerated filtering.
When set, hwupload and hwdownload filters are inserted around the
filter chain automatically.
Sourcepub fn build(self) -> Result<FilterGraph, FilterError>
pub fn build(self) -> Result<FilterGraph, FilterError>
Build the FilterGraph.
§Errors
Returns FilterError::BuildFailed if steps is empty (there is
nothing to filter). The actual FFmpeg graph is constructed lazily on the
first push_video or
push_audio call.