fix: replace deprecated -vsync with -fps_mode for ffmpeg 7
This commit is contained in:
1 parent
fe0c3af9a4
commit
6229bea7f4
1 file changed
+3
-2
+3
-2
@@ -125,14 +125,15 @@ for INPUT_FILE in INPUT_FILES:
|
|||||||
# Only apply fps filter if probed fps differs from target (avoid needless re-timing)
|
# Only apply fps filter if probed fps differs from target (avoid needless re-timing)
|
||||||
fps = probed.get(INPUT_FILE)
|
fps = probed.get(INPUT_FILE)
|
||||||
needs_fps = not fps_matches(fps, TARGET_FPS_FLOAT)
|
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:
|
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'}")
|
print(f"[fps] {stem}: probed {fps:.3f} → {'convert to ' + TARGET_FPS if needs_fps else 'already ' + TARGET_FPS + ', keeping native timing'}")
|
||||||
else:
|
else:
|
||||||
print(f"[fps] {stem}: unknown fps → forcing {TARGET_FPS} (safe fallback)")
|
print(f"[fps] {stem}: unknown fps → forcing {TARGET_FPS} (safe fallback)")
|
||||||
# ensure fallback forces target if we couldn't probe
|
# ensure fallback forces target if we couldn't probe
|
||||||
if not needs_fps:
|
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 = [
|
cmd_video = [
|
||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
|
|||||||
Reference in new issue
Block a user