feat: check for ffmpeg on startup

This commit is contained in:
uku 2025-05-21 22:33:16 +02:00
parent a19aa8206b
commit 6f46c768ce
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
2 changed files with 8 additions and 2 deletions

View file

@ -57,6 +57,13 @@ impl From<String> for Codec {
} }
} }
pub fn check() -> Result<()> {
std::process::Command::new("ffmpeg").output()?;
std::process::Command::new("ffprobe").output()?;
Ok(())
}
pub async fn get_video_meta(path: &Path) -> Result<VideoMeta> { pub async fn get_video_meta(path: &Path) -> Result<VideoMeta> {
let output = Command::new("ffprobe") let output = Command::new("ffprobe")
.args([ .args([

View file

@ -391,7 +391,6 @@ impl AsyncComponent for Tyrolienne {
} }
} }
// TODO check for ffmpeg
// TODO app icon // TODO app icon
fn main() -> Result<()> { fn main() -> Result<()> {
tracing_subscriber::fmt() tracing_subscriber::fmt()
@ -400,7 +399,7 @@ fn main() -> Result<()> {
color_eyre::install()?; color_eyre::install()?;
match get_config() { match ffmpeg::check().and_then(|_| get_config()) {
Ok(config) => RelmApp::new("net.uku3lig.Tyrolienne").run_async::<Tyrolienne>(config), Ok(config) => RelmApp::new("net.uku3lig.Tyrolienne").run_async::<Tyrolienne>(config),
Err(e) => RelmApp::new("net.uku3lig.Tyrolienne").run::<StandaloneDialog>(e.to_string()), Err(e) => RelmApp::new("net.uku3lig.Tyrolienne").run::<StandaloneDialog>(e.to_string()),
} }