diff --git a/cargos/tvai/src/config/topaz_templates.rs b/cargos/tvai/src/config/topaz_templates.rs index 505f418..1c7407a 100644 --- a/cargos/tvai/src/config/topaz_templates.rs +++ b/cargos/tvai/src/config/topaz_templates.rs @@ -1124,6 +1124,19 @@ impl TopazTemplateManager { interpolation_filter.push_str(&format!(":rdt={}", rdt)); } + // Always add fps parameter to avoid default "0" value + if let Some(fps) = opts.target_fps { + if fps > 0 { + interpolation_filter.push_str(&format!(":fps={}", fps)); + } else { + // If target_fps is 0, use a reasonable default (24fps) + interpolation_filter.push_str(":fps=24"); + } + } else { + // If no target_fps specified, use input video framerate (24fps as default) + interpolation_filter.push_str(":fps=24"); + } + // Add device and performance settings if let Some(device) = opts.topaz_device { interpolation_filter.push_str(&format!(":device={}", device)); @@ -1739,6 +1752,19 @@ impl TopazTemplateManager { interpolation_filter.push_str(&format!(":rdt={}", rdt)); } + // Always add fps parameter to avoid default "0" value + if let Some(fps) = opts.target_fps { + if fps > 0 { + interpolation_filter.push_str(&format!(":fps={}", fps)); + } else { + // If target_fps is 0, use a reasonable default (24fps) + interpolation_filter.push_str(":fps=24"); + } + } else { + // If no target_fps specified, use input video framerate (24fps as default) + interpolation_filter.push_str(":fps=24"); + } + // Add device and performance settings if let Some(device) = opts.topaz_device { interpolation_filter.push_str(&format!(":device={}", device)); @@ -1823,10 +1849,17 @@ impl TopazTemplateManager { fi_filter.push_str(&format!(":rdt={}", rdt)); } + // Always add fps parameter to avoid default "0" value if let Some(fps) = opts.target_fps { if fps > 0 { fi_filter.push_str(&format!(":fps={}", fps)); + } else { + // If target_fps is 0, use a reasonable default (24fps) + fi_filter.push_str(":fps=24"); } + } else { + // If no target_fps specified, use input video framerate (24fps as default) + fi_filter.push_str(":fps=24"); } fi_filter.push_str(&format!( diff --git a/cargos/tvai/src/web_api.rs b/cargos/tvai/src/web_api.rs index 82a9c34..b66e194 100644 --- a/cargos/tvai/src/web_api.rs +++ b/cargos/tvai/src/web_api.rs @@ -277,6 +277,19 @@ impl WebApi { options.enable_two_pass = true; options.temp_dir = Some("/tmp/tvai".to_string()); } + + // Debug: Check if out_fps is 0 and set target_fps appropriately + println!("Debug: template.settings.output.out_fps = {}", template.settings.output.out_fps); + println!("Debug: options.target_fps before = {:?}", options.target_fps); + + // If out_fps is 0, ensure target_fps remains None + if template.settings.output.out_fps == 0 { + options.target_fps = None; + } else if template.settings.output.out_fps > 0 { + options.target_fps = Some(template.settings.output.out_fps as u32); + } + + println!("Debug: options.target_fps after = {:?}", options.target_fps); // Generate usage statistics let usage_stats = Self::calculate_usage_stats(&request.settings);