fix: replace deprecated -vsync with -fps_mode for ffmpeg 7

This commit is contained in:
Honney OC committed 2026-09-13 19:50:34 +00:00
1 parent e258dfecd3
commit 476b2543d1
1 file changed
+3 -2
+3 -2
View File
@@ -125,14 +125,15 @@ for INPUT_FILE in INPUT_FILES:
# Only apply fps filter if probed fps differs from target (avoid needless re-timing)
fps = probed.get(INPUT_FILE)
needs_fps = not fps_matches(fps, TARGET_FPS_FLOAT)
video_codec = VIDEO_CODEC_BASE + (["-vf", f"fps={TARGET_FPS}:round=near", "-vsync", "cfr"] if needs_fps else [])
# fps filter alone forces CFR; use fps_mode cfr (vsync removed in ffmpeg >=7)
video_codec = VIDEO_CODEC_BASE + (["-vf", f"fps={TARGET_FPS}:round=near", "-fps_mode", "cfr"] if needs_fps else [])
if fps is not None:
print(f"[fps] {stem}: probed {fps:.3f} → {'convert to ' + TARGET_FPS if needs_fps else 'already ' + TARGET_FPS + ', keeping native timing'}")
else:
print(f"[fps] {stem}: unknown fps → forcing {TARGET_FPS} (safe fallback)")
# ensure fallback forces target if we couldn't probe
if not needs_fps:
video_codec = VIDEO_CODEC_BASE + ["-vf", f"fps={TARGET_FPS}:round=near", "-vsync", "cfr"]
video_codec = VIDEO_CODEC_BASE + ["-vf", f"fps={TARGET_FPS}:round=near", "-fps_mode", "cfr"]
cmd_video = [
"ffmpeg",