A Rust utility crate providing a simple wrapper around FFmpeg's avio interface, enabling seamless integration with any types implementing Read + Write + Seek. Additionally, it offers a straightforward remux function for multimedia container format conversion.
- FFmpeg avio wrapper: Use any Rust type that implements
Read + Write + Seekas a custom IO source or sink for FFmpeg operations. - Simple remuxing: Easily remux multimedia streams from one container format to another without re-encoding.
- Designed for ergonomic and safe usage in Rust projects leveraging FFmpeg's powerful multimedia processing capabilities.
Add convert-util to your Cargo.toml dependencies:
[dependencies]
convert-util = "0.1"
Make sure FFmpeg libraries are installed on your system.
convert-util allows you to create an FFmpeg avio context from any Rust type implementing Read + Write + Seek. This enables custom IO handling for FFmpeg input/output operations, such as reading from or writing to in-memory buffers, network streams, or other custom sources.
The crate provides a simple remux function that takes input and output streams and remuxes multimedia data from one container format to another without re-encoding, preserving codec data.
Example usage:
use convert_util::remux_file;
use std::env;
fn main() {
let input_file = env::args().nth(1).expect("missing input file");
let output_file = env::args().nth(2).expect("missing output file");
let _frames_converted = remux_file(input_file, output_file).expect("failed to remux media");
}
Thanks to zmwangx/rust-ffmpeg (ffmpeg-next) for providing the foundational FFmpeg Rust bindings and inspiration for this project.