Check ffmpeg is in PATH

This commit is contained in:
CDrummond committed 2025-03-01 16:06:07 +00:00
1 parent 22133436b9
commit 5fa745975c
4 files changed
+152 -8

No files matched your search

+10
View File
@@ -14,6 +14,7 @@ use log::LevelFilter;
use std::io::Write;
use std::path::PathBuf;
use std::process;
use which::which;
mod analyse;
mod db;
mod ffmpeg;
@@ -93,6 +94,15 @@ fn main() {
process::exit(-1);
}
// Ensure ffmpeg is in PATH...
match which("ffmpeg") {
Ok(_) => { }
Err(_) => {
log::error!("'ffmpeg' was not found! Please ensure this in your PATH");
process::exit(-1);
},
}
if !config_file.is_empty() {
let path = PathBuf::from(&config_file);
if path.exists() && path.is_file() {