mirror of
https://github.com/Luchexx/claude-video.git
synced 2026-11-02 09:19:48 +00:00
fix: detect -fps_mode in FFmpeg 9 help output
FFmpeg 9 lists the option as "-fps_mode[:<stream_spec>]", so the whitespace-anchored probe missed it and every local run lost its frames. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a9e2c460d0
commit
c1975ef3b1
@ -117,9 +117,10 @@ def _sync_option(executable: str) -> tuple[str, str]:
|
|||||||
result = run_text([executable, "-hide_banner", "-h", "full"], timeout=30)
|
result = run_text([executable, "-hide_banner", "-h", "full"], timeout=30)
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
help_text = result.stdout + result.stderr
|
help_text = result.stdout + result.stderr
|
||||||
if re.search(r"(?m)^\s*-fps_mode\s", help_text):
|
# FFmpeg 9 lists options with stream specifiers, e.g. "-fps_mode[:<stream_spec>]".
|
||||||
|
if re.search(r"(?m)^\s*-fps_mode\b", help_text):
|
||||||
return "-fps_mode", "vfr"
|
return "-fps_mode", "vfr"
|
||||||
if re.search(r"(?m)^\s*-vsync\s", help_text):
|
if re.search(r"(?m)^\s*-vsync\b", help_text):
|
||||||
return "-vsync", "vfr"
|
return "-vsync", "vfr"
|
||||||
raise SystemExit(f"{executable} did not advertise -fps_mode or -vsync; check the FFmpeg installation. {diagnostic(result.stderr)}")
|
raise SystemExit(f"{executable} did not advertise -fps_mode or -vsync; check the FFmpeg installation. {diagnostic(result.stderr)}")
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ def test_invalid_probe_metadata(monkeypatch, data):
|
|||||||
frames.get_metadata('test.mp4')
|
frames.get_metadata('test.mp4')
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('help_text,expected', [('-vsync set video sync', '-vsync'), ('-fps_mode set fps\n-vsync set sync', '-fps_mode'), ('-fps_mode set fps', '-fps_mode'), ('unknown option: fps_mode', None)])
|
@pytest.mark.parametrize('help_text,expected', [('-vsync set video sync', '-vsync'), ('-fps_mode set fps\n-vsync set sync', '-fps_mode'), ('-fps_mode set fps', '-fps_mode'), ('-fps_mode[:<stream_spec>] set framerate mode for matching video streams', '-fps_mode'), ('unknown option: fps_mode', None)])
|
||||||
def test_sync_capability_probe(monkeypatch, help_text, expected):
|
def test_sync_capability_probe(monkeypatch, help_text, expected):
|
||||||
calls = []
|
calls = []
|
||||||
def help_run(cmd, **kw):
|
def help_run(cmd, **kw):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user