Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ffmpeg-pipeline

Crates.io Documentation CI License

ffmpeg-pipeline provides composable Rust APIs for common media-processing workflows on top of ffmpeg-next. It operates directly through FFmpeg libraries and never invokes the ffmpeg command-line program.

Features

  • Decode audio and video streams as packets or frames.
  • Encode audio and video with configurable codec parameters and metadata.
  • Resample, reformat, and buffer audio for encoder frame requirements.
  • Scale decoded video frames.
  • Remux selected streams while preserving or replacing stream metadata.
  • Read from files, byte buffers, or custom Read + Seek sources.
  • Write to files, byte buffers, or custom Write + Seek destinations.
  • Inspect stream metadata and calculate video frame counts.

Installation

[dependencies]
ffmpeg-pipeline = "0.2"
log = "0.4"

The crate links FFmpeg statically. Provide a compatible FFmpeg 7.1 installation through FFMPEG_DIR, or enable source compilation:

[dependencies]
ffmpeg-pipeline = { version = "0.2", features = ["build-from-source"] }

The available codecs and formats are determined by the linked FFmpeg build. Platform system libraries and frameworks may still be required; third-party FFmpeg dependencies must be linked statically.

Example

use ffmpeg_pipeline::{initialize, input_file, parse_stream_info};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    initialize(log::Level::Error)?;

    let input = input_file("sample.mkv")?;
    for stream in input.streams() {
        let info = parse_stream_info(&stream)?;
        println!("{}: {} ({})", stream.index(), info.get_title(), info.format);
    }

    Ok(())
}

Call initialize once before creating FFmpeg contexts. See the API documentation for decoding, encoding, remuxing, scaling, and custom I/O types.

Status

The crate is under active development. The public API may change before version 1.0.

License

Copyright © 2023–2026 DarkSky.

Licensed under the GNU Affero General Public License, version 3 only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages