diff --git a/video-ai-system/engines/subtitle-pipeline/ab-test-tools/subtitle-style-ab-test.py b/video-ai-system/engines/subtitle-pipeline/ab-test-tools/subtitle-style-ab-test.py index 2691c4a..0620195 100644 --- a/video-ai-system/engines/subtitle-pipeline/ab-test-tools/subtitle-style-ab-test.py +++ b/video-ai-system/engines/subtitle-pipeline/ab-test-tools/subtitle-style-ab-test.py @@ -276,12 +276,13 @@ def burn_subtitles_with_ffmpeg(video_path: str, ass_path: str, output_path: str) return False # FFmpeg 命令 + # 正确语法:subtitles=filename='path' (需要 filename= 前缀) ass_path_escaped = ass_path.replace(":", "\\:").replace("'", "'\\''") cmd = [ "ffmpeg", "-y", "-i", video_path, - "-vf", f"subtitles='{ass_path_escaped}'", + "-vf", f"subtitles=filename='{ass_path_escaped}'", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "copy", diff --git a/video-ai-system/engines/subtitle-pipeline/reference-analysis/ass-subtitle-renderer.py b/video-ai-system/engines/subtitle-pipeline/reference-analysis/ass-subtitle-renderer.py index 25d0f29..efca922 100644 --- a/video-ai-system/engines/subtitle-pipeline/reference-analysis/ass-subtitle-renderer.py +++ b/video-ai-system/engines/subtitle-pipeline/reference-analysis/ass-subtitle-renderer.py @@ -262,17 +262,14 @@ def burn_subtitles_with_ffmpeg(video_path: str, ass_path: str, output_path: str) print(f"[ERROR] ASS 字幕文件不存在:{ass_path}") return False - # FFmpeg 命令:使用 libass 烧录字幕 - # -vf "ass=subtitles.ass" # 方法1:直接指定 ASS 文件 - # -vf "subtitles=subtitles.ass" # 方法2:使用 subtitles 滤镜(自动检测格式) - # 使用 subtitles 滤镜(更通用,支持 SRT/ASS 等多种格式) + # 正确语法:subtitles=filename='path' (需要 filename= 前缀) ass_path_escaped = ass_path.replace(":", "\\:").replace("'", "'\\''") cmd = [ "ffmpeg", "-y", "-i", video_path, - "-vf", f"subtitles='{ass_path_escaped}'", + "-vf", f"subtitles=filename='{ass_path_escaped}'", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-c:a", "copy",