优化字幕检测算法、添加多语言翻译支持
Some checks failed
Docker Build and Push / check-secrets (push) Successful in 2s
Docker Build and Push / build-and-push (cpu, latest) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 11.8) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.6) (push) Has been skipped
Docker Build and Push / build-and-push (cuda, 12.8) (push) Has been skipped
Docker Build and Push / build-and-push (directml, latest) (push) Has been skipped
Build Windows CPU / build (push) Has been cancelled
Build Windows CUDA 11.8 / build (push) Has been cancelled
Build Windows CUDA 12.6 / build (push) Has been cancelled
Build Windows CUDA 12.8 / build (push) Has been cancelled
Build Windows DirectML / build (push) Has been cancelled

- 自适应采样间隔:根据视频帧率调整(60fps+→4, 30fps+→3, 低帧率→2)
- filter_and_merge_intervals 复杂度从 O(n²) 优化为 O(n log n)
- detect_subtitle 区域过滤:单区域快速路径,多区域匹配即停
- 插值逻辑改用 zip 预计算 max_gap,更高效
- SubtitleDetectMode 枚举值改为英文key,通过翻译系统显示本地化名称
- 7种语言文件添加 SubtitleDetectMode 翻译(中/繁/英/日/韩/越/西)
- 旧配置值自动迁移兼容

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
flavioy
2026-04-09 00:17:01 +08:00
parent 93d822d067
commit 0bae013097
12 changed files with 104 additions and 58 deletions

View File

@@ -112,6 +112,13 @@ CONFIG_FILE = 'config/config.json'
config = Config()
qconfig.load(CONFIG_FILE, config)
# 向后兼容:旧的 SubtitleDetectMode 枚举值为中文,迁移为新值
_detect_mode_value = config.subtitleDetectMode.value
if isinstance(_detect_mode_value, str) and _detect_mode_value in ("快速", "Fast"):
config.set(config.subtitleDetectMode, SubtitleDetectMode.PP_OCRv5_MOBILE)
elif isinstance(_detect_mode_value, str) and _detect_mode_value in ("精准", "Precise"):
config.set(config.subtitleDetectMode, SubtitleDetectMode.PP_OCRv5_SERVER)
# 读取界面语言配置
tr = configparser.ConfigParser()