From 1ab18e6ab5c11c9280ec8355017664d80200afe2 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Mon, 6 Apr 2026 15:58:33 +0200 Subject: [PATCH] fix: use -c:v and explicit -an in image_sequence ffmpeg command --- main.py | 3 ++- tests/test_utils.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index ba05d7e..f618f65 100644 --- a/main.py +++ b/main.py @@ -66,7 +66,8 @@ def build_ffmpeg_command( if image_sequence: cmd += [ - "-vcodec", "libwebp", + "-an", + "-c:v", "libwebp", "-lossless", "1", "-compression_level", "4", os.path.join(output_path, "frame_%04d.webp"), diff --git a/tests/test_utils.py b/tests/test_utils.py index bb0a895..cc33fb1 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -192,8 +192,8 @@ def test_build_sequence_dir_counter(): def test_ffmpeg_command_image_sequence(): cmd = build_ffmpeg_command("/in/v.mp4", 0.0, "/out/seq_001", image_sequence=True) - assert "-vcodec" in cmd - assert cmd[cmd.index("-vcodec") + 1] == "libwebp" + assert "-c:v" in cmd + assert cmd[cmd.index("-c:v") + 1] == "libwebp" assert "-lossless" in cmd assert cmd[cmd.index("-lossless") + 1] == "1" assert "-compression_level" in cmd @@ -209,5 +209,6 @@ def test_ffmpeg_command_image_sequence_with_resize(): def test_ffmpeg_command_image_sequence_no_audio(): cmd = build_ffmpeg_command("/in/v.mp4", 0.0, "/out/seq_001", image_sequence=True) + assert "-an" in cmd assert "-c:a" not in cmd assert "aac" not in cmd