feat: add short_side resize to build_ffmpeg_command

This commit is contained in:
2026-04-06 13:31:58 +02:00
parent ce7e808249
commit 798c5ff4f4
2 changed files with 23 additions and 6 deletions
+10 -1
View File
@@ -25,7 +25,7 @@ def test_format_time_no_sixty_rollover():
assert format_time(59.95) == "0:59.9"
def test_ffmpeg_command():
def test_ffmpeg_command_no_resize():
cmd = build_ffmpeg_command("/in/video.mp4", 12.5, "/out/clip_001.mp4")
assert cmd[0] == "ffmpeg"
assert "-y" in cmd
@@ -34,6 +34,15 @@ def test_ffmpeg_command():
assert "-t" in cmd
assert "8" in cmd
assert cmd[-1] == "/out/clip_001.mp4"
assert "-vf" not in cmd
def test_ffmpeg_command_with_resize():
cmd = build_ffmpeg_command("/in/video.mp4", 0.0, "/out/clip_001.mp4", short_side=256)
assert "-vf" in cmd
vf_value = cmd[cmd.index("-vf") + 1]
assert "256" in vf_value
assert "scale" in vf_value
assert cmd[-1] == "/out/clip_001.mp4"
# --- _normalize_filename ---