spacedrive/crates/ffmpeg
Ericson "Fogo" Soares 68ca2382fd
[ENG-1627] Move all jobs and actors to an "Old" namespace (#2157)
* Bunch of new warns due to a stronger clippy config

* Moving old processing stuff to a new namespace
Also fixing a bunch of typos through the entire codebase.

* Rustfmt
2024-03-04 18:57:35 +00:00
..
src [ENG-1627] Move all jobs and actors to an "Old" namespace (#2157) 2024-03-04 18:57:35 +00:00
.gitignore Added crates folder (#389) 2022-09-29 21:02:29 -07:00
Cargo.toml [ENG-1479] AI Prototype (#1845) 2023-12-19 09:28:57 +00:00
README.md Improve setup script (#436) 2022-10-25 18:08:50 -07:00

FFmpeg Thumbnailer RS

Rust implementation of a thumbnail generation for video files using FFmpeg. Based on https://github.com/dirkvdb/ffmpegthumbnailer

For now only implements the minimum API for Spacedrive needs. PRs are welcome

Usage


use ffmpegthumbnailer_rs::{to_thumbnail, ThumbnailerError};

#[tokio::main]
async fn main() -> Result<(), ThumbnailerError> {
    to_thumbnail("input.mp4", "output.webp", 256, 100.0).await
}

Or you can use a builder to change the default options


use ffmpegthumbnailer_rs::{ThumbnailerBuilder, ThumbnailerError};

#[tokio::main]
async fn main() -> Result<(), ThumbnailerError> {
    let thumbnailer = ThumbnailerBuilder::new()
        .width_and_height(420, 315)
        .seek_percentage(0.25)?
        .with_film_strip(false)
        .quality(80.0)?
        .build();

    thumbnailer.process("input.mp4", "output.webp").await
}