caery-lib 0.1.0

Reusable ffmpeg media conversion engine from Caery.
Documentation
  • Coverage
  • 2.41%
    2 out of 83 items documented1 out of 37 items with examples
  • Size
  • Source code size: 33.95 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 903.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Tknott95

caery-lib

caery-lib is the reusable media conversion engine used by Caery. It validates conversion requests, builds safe ffmpeg commands, probes duration with ffprobe, and reports conversion logs and progress as events.

The crate supports video-to-audio extraction, video transcoding, and audio transcoding across Caery's supported formats and quality presets.

Example

use caery_lib::{
    start_conversion, AudioFormat, ConversionMode, ConversionRequest, OperationEvent,
    QualityPreset, VideoFormat,
};
use std::path::PathBuf;

let request = ConversionRequest {
    mode: ConversionMode::ExtractAudio,
    input_path: PathBuf::from("clip.mp4"),
    output_path: PathBuf::from("clip.mp3"),
    audio_format: AudioFormat::Mp3,
    video_format: VideoFormat::Mp4,
    quality: QualityPreset::Balanced,
    overwrite: false,
};

let events = start_conversion(&request)?;
for event in events {
    match event {
        OperationEvent::Progress { current_seconds, total_seconds } => {
            println!("{current_seconds:.1} / {total_seconds:.1}");
        }
        OperationEvent::Finished(result) => {
            result.expect("ffmpeg conversion failed");
            break;
        }
        _ => {}
    }
}
# Ok::<(), caery_lib::ConversionError>(())

Requirements

ffmpeg performs conversions and ffprobe provides duration information. Both executables must be available on PATH at runtime.