From cb611bcc7d33a63bf1e8cd700f5995439236f89c Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Wed, 3 Jun 2026 00:06:04 +0200 Subject: [PATCH] fix: wire FfmpegWrapUpRenderer into worker when ffmpeg available --- crates/worker/Cargo.toml | 1 + crates/worker/src/main.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/worker/Cargo.toml b/crates/worker/Cargo.toml index 4a85445..592f1f3 100644 --- a/crates/worker/Cargo.toml +++ b/crates/worker/Cargo.toml @@ -29,6 +29,7 @@ export = { workspace = true } tmdb-enrichment = { workspace = true } importer = { workspace = true } image-converter = { workspace = true } +wrapup-renderer = { workspace = true } nats = { workspace = true, optional = true } sqlx = { workspace = true } async-trait = { workspace = true } diff --git a/crates/worker/src/main.rs b/crates/worker/src/main.rs index 2786863..0f707f1 100644 --- a/crates/worker/src/main.rs +++ b/crates/worker/src/main.rs @@ -104,7 +104,16 @@ async fn main() -> anyhow::Result<()> { event_publisher: event_publisher_arc, diary_exporter: Arc::new(ExportAdapter) as Arc, document_parser: Arc::new(ImporterDocumentParser) as Arc, - video_renderer: None, + video_renderer: { + let ffmpeg = &app_config.wrapup.ffmpeg_path; + if std::process::Command::new(ffmpeg).arg("-version").output().is_ok() { + tracing::info!("wrapup video renderer enabled (ffmpeg={ffmpeg})"); + Some(Arc::new(wrapup_renderer::FfmpegWrapUpRenderer::new()) as Arc) + } else { + tracing::info!("wrapup video renderer disabled (ffmpeg not found)"); + None + } + }, }, config: app_config, };