ffmpeg_sidecar/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! Wrap a standalone FFmpeg binary in an intuitive Iterator interface.
4//!
5//! ## Example
6//!
7//! ```rust
8//! use ffmpeg_sidecar::command::FfmpegCommand;
9//! fn main() -> anyhow::Result<()> {
10//!   // Run an FFmpeg command that generates a test video
11//!   let iter = FfmpegCommand::new() // <- Builder API like `std::process::Command`
12//!     .testsrc()  // <- Discoverable aliases for FFmpeg args
13//!     .rawvideo() // <- Convenient argument presets
14//!     .spawn()?   // <- Ordinary `std::process::Child`
15//!     .iter()?;   // <- Blocking iterator over logs and output
16//!
17//!   // Use a regular "for" loop to read decoded video data
18//!   for frame in iter.filter_frames() {
19//!     println!("frame: {}x{}", frame.width, frame.height);
20//!     let _pixels: Vec<u8> = frame.data; // <- raw RGB pixels! 🎨
21//!   }
22//!
23//!   Ok(())
24//! }
25//! ```
26
27#[cfg(test)]
28mod test;
29
30pub mod child;
31pub mod comma_iter;
32pub mod command;
33pub mod download;
34pub mod event;
35pub mod ffprobe;
36pub mod iter;
37pub mod log_parser;
38pub mod metadata;
39pub mod paths;
40pub mod pix_fmt;
41pub mod read_until_any;
42pub mod version;
43
44#[cfg(feature = "named_pipes")]
45#[cfg_attr(docsrs, doc(cfg(feature = "named_pipes")))]
46pub mod named_pipes;
47
48pub use anyhow::Result;