From d1990e618142d0f9a056f827d67df4d0132b8d22 Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 28 Sep 2026 02:22:12 +0800 Subject: [PATCH] feat: add CUT processor config support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增: - CUT 處理器配置 - Rust 原生實現(使用 ffmpeg) 工具優先級: 1. rust (priority=0, enabled=true) - Rust 原生實現 - 使用 ffmpeg 場景檢測 - use_ffmpeg: true - min_scene_duration: 0.5秒 2. python (priority=1, enabled=false) - Python 備用方案 配置參數: - ffmpeg 場景檢測配置 - 最小場景持續時間 ToolSelector: - cut 返回 Rust 原生標記 - 支持 python 備用 目的: - 統一所有處理器配置架構 - 支持 ffmpeg 參數配置 --- config/processor_tools.json | 21 +++++++++++++++++++++ src/core/processor/tool_selector.rs | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/config/processor_tools.json b/config/processor_tools.json index 2aee7be5..3c87f5ef 100644 --- a/config/processor_tools.json +++ b/config/processor_tools.json @@ -201,6 +201,27 @@ ], "default_tool": "rust", "enabled": true + }, + "cut": { + "tools": [ + { + "name": "rust", + "priority": 0, + "enabled": true, + "parameters": { + "use_ffmpeg": true, + "min_scene_duration": 0.5 + } + }, + { + "name": "python", + "priority": 1, + "enabled": false, + "parameters": {} + } + ], + "default_tool": "rust", + "enabled": true } } } diff --git a/src/core/processor/tool_selector.rs b/src/core/processor/tool_selector.rs index 5a45ec15..d978e24a 100644 --- a/src/core/processor/tool_selector.rs +++ b/src/core/processor/tool_selector.rs @@ -179,6 +179,17 @@ impl ToolSelector { Some(std::path::PathBuf::from("rust_vlm_summary")) } + // CUT (Scene detection) tools + ("cut", "rust") => { + // CUT is implemented in Rust using ffmpeg + // Return a placeholder path to indicate availability + Some(std::path::PathBuf::from("rust_cut")) + } + ("cut", "python") => { + let script = executor.script_path("cut_processor.py"); + if script.exists() { Some(script) } else { None } + } + _ => None, } }