Windows: -vsync 在 ffmpeg 9.x 中被删除,导致帧提取失败;非 ASCII 路径会导致子进程输出解码崩溃
作者: wooay123-cloud创建于 2026年9月23日更新于 2026年9月23日
- Bug 1 —
-vsyncremoved in ffmpeg 9.x extract_scene_candidates()andextract_keyframes()inframes.pypass-vsync vfrto ffmpeg:
cmd += [
"-i", str(Path(video_path).resolve()),
"-vf", vf,
"-vsync", "vfr",
]ffmpeg 9.0.1 has dropped the global -vsync option entirely (it was deprecated in favor of the per-output -fps_mode for a long time, and appears to now be a hard error):
$ ffmpeg -hide_banner -loglevel error -f lavfi -i color=c=red:s=64x64:d=1 -vsync vfr -frames:v 1 out.jpg
Unrecognized option 'vsync'.
Error splitting the argument list: Option not foundEvery --detail balanced / token-burner (scene) and --detail efficient (keyframe) run fails outright on ffmpeg 9.x. --detail transcript still works since it never shells out to ffmpeg for frames.
Fix: replace -vsync vfr with -fps_mode vfr in both call sites (frames.py lines ~256 and ~615 in the 0.2.0 tag). Confirmed this resolves extraction with ffmpeg 9.0.1 and produces correct scene-change frames.
- Bug 2 — non-ASCII working-directory path breaks
subprocess.run(..., capture_output=True, text=True) - Every
subprocess.run(cmd, capture_output=True, text=True)call inframes.pyandwhisper.py(get_metadata,extract_scene_candidates,extract_at_timestamps,extract_keyframes, and the two ffprobe/Whisper calls inwhisper.py) relies on Python's default text-mode decoding, which useslocale.getpreferredencoding(). On this Windows machine that'scp949(Korean code page), not UTF-8. - ffmpeg/ffprobe print the resolved absolute path back in some of their stdout/stderr (e.g.
showinfo, error messages,Output #0, ... to <path>), and the temp working directory (%TEMP%\watch-xxxx\...) is itself made of UTF-8-encoded Korean characters from the username. Decoding those bytes as cp949 raisesUnicodeDecodeErrorinside the background reader threadsubprocess.Popenspawns forcapture_output=True+text=True(seeLib/subprocess.py:_readerthread). Because that thread's exception isn't propagated to the caller,subprocess.run()just returns withresult.stdout/result.stderrset toNoneinstead of raising — which cascades into confusing downstream failures: get_metadata()silently computesduration_seconds: 0.0(viajson.loads(result.stdout or "{}")falling back to{}) instead of erroring, soframes.pyprintsextracting scene-aware frames over full 0.0sand proceeds with a bogus duration.- …
内容来源: bradautomates/claude-video