Crate simple_ffmpeg

Source
Expand description

§Simple zero-dependency single-file crate for generating videos with ffmpeg in Rust

This crate is meant to be extremely light-weight. If you need a feature this crate doesn’t provide, go use something else.

In fact, this crate can even be used without cargo. Just download lib.rs and add it to your source tree as a module.

§Basic Usage

use simple_ffmpeg as ffmpeg;

let mut ffmpeg = ffmpeg::start("out.mp4", WIDTH, HEIGHT, FPS)?;

let mut pixels = [0u32; WIDTH * HEIGHT]
for _ in 0..(DURATION * FPS) {
    // <draw frame into pixels array>

    ffmpeg.send_frame(&pixels)?;
}

ffmpeg.finalize()?;

Structs§

FFMpeg
Main interface into FFMPEG

Enums§

Error
Main error type

Functions§

get_color
Turn separate R, G, B, and A values into a single RGBA Color
start
Start the FFMPEG rendering

Type Aliases§

Color
Representation of a single pixel
Result
Main Result type