ffmpeg-next-io

Crates.ioffmpeg-next-io
lib.rsffmpeg-next-io
version0.1.0
sourcesrc
created_at2024-01-03 09:34:04.706116
updated_at2024-01-03 09:34:04.706116
descriptionIO Extensions for ffmpeg-next
homepage
repositoryhttps://github.com/scuffletv/ffmpeg-next-io
max_upload_size
id1087258
size462,650
Troy (TroyKomodo)

documentation

README

ffmpeg-next-io

This is a helper library for ffmpeg-next that provides a general purpose IO implementation for bindings.

This library provides a wrapper for any struct that implements std::io::Read and std::io::Write, with seeking support for std::io::Seek.

We also have a channel compatability layer for many popular channels, including std::sync::mpsc, crossbeam-channel and tokio.

This library allows you to write to FFmpeg from a different thread. Meaning you can use FFmpeg in a async runtime and pass data from the async context to the sync context without blocking or having to write to a file first.

Without this libary you would be required to write to a tempory file or network socket or some unix pipe, which is not ideal. This library provides a much needed in-memory solution for ffmpeg-next.

Usage

Add this to your Cargo.toml:

[dependencies]
ffmpeg-next-io = "0.1.0"

Example

use ffmpeg_next_io::Input;

let bytes = include_bytes!("../input.mp4"); // or any other source of bytes

let mut input = Input::seekable(std::io::Cursor::new(bytes));

// now you can use `input` as an input for ffmpeg-next

For more examples, see the examples directory.

License

This project is licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).

Commit count: 0

cargo fmt