diff --git a/extract.py b/extract.py index cafc149..a09cc09 100644 --- a/extract.py +++ b/extract.py @@ -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",