spacedrive/crates/ffmpeg
Ericson "Fogo" Soares 7c90bcb95b
[ENG-1479] AI Prototype (#1845)
* First draft on image labeling

* Fixing execution providers for other OSs

* Better error handling and shutdown

* Working with shallow media processor

* bruh

* Fix warnings

* Now hooked to media processor job

* Link desktop app with libonnxruntime to avoid TLS error during startup

* Be able to change models on runtime
Revert to use labels table instead of tags

* A bug on a model-less inference

* Show AI labels on Inspector
 - Change yolo inference to use half precision
 - Add labels api to core

* Remove LD_PRELOAD

* Fix race condition on model executor shutdown

* Don't load all images in memory moron

* Embeed yolo model in prod build
 - Change yolo model path to new one relative to executable

* Disable volume watcher on linux, it was crashing the app
 - Invalidate labels when they are updated

* Rust fmt

* Minor changes

* Gate onnxruntime linking to the ai-models feature

* Add build script to sd-server to handle onnxruntime linking workaround

* Move AI stuff to its own crate and normalize deps

* Rust fmt

* Don't regenerate labels unless asked to

* Now blazingly fast

* Bad merge

* Fix

* Fix

* Add backend logic to download extra yolo models

* Add models api route
 - Add api call to get available model version
 - Add api call to change the model version

* Improve new model download logic
 - Add frontend to change image labeler model

* Fix new model downloader

* Fix model select width

* invalidate labels count after media_processor generates a new output

* Rename AI crate and first draft on download notifications

* fix types

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
..
src [ENG-1320 | ENG-1340] Separate thumbnails FS location by library | Make the thumbnails actor report back its progress (#1656) 2023-10-26 04:48:29 +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
}