Windows: -vsync 在 ffmpeg 9.x 中被删除,导致帧提取失败;非 ASCII 路径会导致子进程输出解码崩溃

作者: wooay123-cloud创建于 2026年9月23日更新于 2026年9月23日
  • Bug 1 — -vsync removed in ffmpeg 9.x
  • extract_scene_candidates() and extract_keyframes() in frames.py pass -vsync vfr to ffmpeg:
python
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 found

Every --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 in frames.py and whisper.py (get_metadata, extract_scene_candidates, extract_at_timestamps, extract_keyframes, and the two ffprobe/Whisper calls in whisper.py) relies on Python's default text-mode decoding, which uses locale.getpreferredencoding(). On this Windows machine that's cp949 (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 raises UnicodeDecodeError inside the background reader thread subprocess.Popen spawns for capture_output=True + text=True (see Lib/subprocess.py:_readerthread). Because that thread's exception isn't propagated to the caller, subprocess.run() just returns with result.stdout / result.stderr set to None instead of raising — which cascades into confusing downstream failures:
  • get_metadata() silently computes duration_seconds: 0.0 (via json.loads(result.stdout or "{}") falling back to {}) instead of erroring, so frames.py prints extracting scene-aware frames over full 0.0s and proceeds with a bogus duration.
  • …

内容来源: bradautomates/claude-video