use std::process::Command;
#[derive(Debug, Clone)]
pub struct DependencyStatus;
impl DependencyStatus {
pub fn check() -> bool {
check_command("ffmpeg", &["-version"])
&& check_command("ffprobe", &["-version"])
&& check_vmaf_available()
}
}
fn check_command(cmd: &str, args: &[&str]) -> bool {
Command::new(cmd)
.args(args)
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()
.is_ok_and(|s| s.success())
}
fn check_vmaf_available() -> bool {
Command::new("ffmpeg")
.args(["-filters"])
.output()
.ok()
.is_some_and(|o| String::from_utf8_lossy(&o.stdout).contains("libvmaf"))
}