pub struct VideoConcatenator { /* private fields */ }Expand description
Concatenates multiple video clips into a single seamless output stream.
Each clip is loaded via a movie= source node. When
output_resolution is set, a scale filter is
inserted per clip to normalise all clips to a common resolution before
concatenation. A single clip skips the concat filter and passes through
directly.
The resulting FilterGraph is source-only — call
FilterGraph::pull_video in a loop to extract the output frames.
§Examples
ⓘ
use ff_filter::VideoConcatenator;
let mut graph = VideoConcatenator::new(vec!["clip_a.mp4", "clip_b.mp4"])
.output_resolution(1280, 720)
.build()?;
while let Some(frame) = graph.pull_video()? {
// encode or display `frame`
}Implementations§
Source§impl VideoConcatenator
impl VideoConcatenator
Sourcepub fn new(clips: Vec<impl AsRef<Path>>) -> Self
pub fn new(clips: Vec<impl AsRef<Path>>) -> Self
Creates a new concatenator for the given clip paths.
Sourcepub fn output_resolution(self, w: u32, h: u32) -> Self
pub fn output_resolution(self, w: u32, h: u32) -> Self
Sets the output resolution. When provided, a scale=W:H filter is
inserted per clip before concatenation.
Sourcepub fn build(self) -> Result<FilterGraph, FilterError>
pub fn build(self) -> Result<FilterGraph, FilterError>
Builds a source-only FilterGraph that concatenates all clips.
§Errors
FilterError::CompositionFailed— no clips were provided, or an underlyingFFmpeggraph-construction call failed.
Auto Trait Implementations§
impl Freeze for VideoConcatenator
impl RefUnwindSafe for VideoConcatenator
impl Send for VideoConcatenator
impl Sync for VideoConcatenator
impl Unpin for VideoConcatenator
impl UnsafeUnpin for VideoConcatenator
impl UnwindSafe for VideoConcatenator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more