#ffmpeg #color #simple-ffmpeg

simple-ffmpeg

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

1 stable release

1.0.0 Mar 5, 2025

#241 in Video

WTFPL license

8KB
85 lines

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()?;

simple-ffmpeg

Simple zero-dependency single-file Rust crate for generating videos with ffmpeg 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()?;

No runtime deps