mod args;
mod progress;
mod runner;
pub fn run(args: &[String]) -> Result<i32, Error> {
runner::run_ffmpeg(&args::parse_args(args))
}
#[derive(Debug)]
pub enum Error {
SpawnFailed(std::io::Error),
FfmpegNotFound,
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::SpawnFailed(e) => write!(f, "failed to spawn ffmpeg ({e})"),
Error::FfmpegNotFound => write!(f, "ffmpeg not found in PATH"),
}
}
}
impl std::error::Error for Error {}