Skip to content

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.

Notifications You must be signed in to change notification settings

kontaver/convert-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

convert-util

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.


Features

  • FFmpeg avio wrapper: Use any Rust type that implements Read + Write + Seek as 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.

Contents


Installation

Add convert-util to your Cargo.toml dependencies:

[dependencies]
convert-util = "0.1"

Make sure FFmpeg libraries are installed on your system.


Usage

Wrapping Read+Write+Seek types

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.

Remux function

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");
}

Acknowledgements

Thanks to zmwangx/rust-ffmpeg (ffmpeg-next) for providing the foundational FFmpeg Rust bindings and inspiration for this project.


About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages