diff --git a/apps/worker/video_processing/bgm_mixer.py b/apps/worker/video_processing/bgm_mixer.py index 7e10e261b..a28320756 100755 --- a/apps/worker/video_processing/bgm_mixer.py +++ b/apps/worker/video_processing/bgm_mixer.py @@ -192,7 +192,7 @@ def _mix_simple(main_path: Path, bgm_path: Path, output_path: Path) -> None: """ # 使用 amix:inputs=2,duration=first(以主音频时长为准) # 然后用 volume=2 补偿 amix 的衰减(2路输入每路平均乘0.5) - filter_complex = f"[0:a][1:a]amix=inputs=2:duration=first:dropout_transition=0[outa];" f"[outa]volume=2[final]" + filter_complex = "[0:a][1:a]amix=inputs=2:duration=first:dropout_transition=0[outa];" "[outa]volume=2[final]" command = [ FFMPEG_BIN, diff --git a/apps/worker/video_processing/unified_render_service.py b/apps/worker/video_processing/unified_render_service.py index a0c6d5e27..27ab9cc96 100755 --- a/apps/worker/video_processing/unified_render_service.py +++ b/apps/worker/video_processing/unified_render_service.py @@ -296,7 +296,6 @@ class UnifiedRenderService: run_ffmpeg(extract_cmd) final_audio = mix_bgm_with_main(ctx, main_audio_path, bgm_cfg, video_duration) # 合并回视频 - from video_processing.render_audio import merge_audio_video bgm_output = self.work_dir / f"rendered_{self.plan.id}_bgm.mp4" merge_audio_video(ctx, output_path, final_audio, bgm_output) diff --git a/tests/unit/test_bgm_mixer.py b/tests/unit/test_bgm_mixer.py index 859097f5d..1891f9200 100755 --- a/tests/unit/test_bgm_mixer.py +++ b/tests/unit/test_bgm_mixer.py @@ -187,7 +187,7 @@ class TestPresetBGM: for bgm in PRESET_BGM_LIBRARY: assert bgm.id, f"{bgm.name} 缺少 id" - assert bgm.name, f"缺少 name" + assert bgm.name, "缺少 name" assert bgm.style, f"{bgm.name} 缺少 style" assert bgm.duration > 0, f"{bgm.name} 时长无效"