From 19b517fd49ae7852396fbfb7a646cbf024373b24 Mon Sep 17 00:00:00 2001 From: bradautomates Date: Fri, 25 Sep 2026 09:26:23 +1000 Subject: [PATCH] test: tolerate FFmpeg 7.1 muxing the shifted-PTS fixture one frame short Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/test_frames.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_frames.py b/tests/test_frames.py index 32460fd..a5e8b3b 100644 --- a/tests/test_frames.py +++ b/tests/test_frames.py @@ -102,7 +102,8 @@ def test_nonzero_input_pts_are_source_relative(tmp_path): subprocess.run(['ffmpeg', '-v', 'error', '-f', 'lavfi', '-i', 'testsrc2=s=160x120:r=10:d=3', '-vf', 'setpts=PTS+7/TB', '-c:v', 'libx264', str(clip)], check=True) out = frames.extract(str(clip), tmp_path / 'f', fps=1, max_frames=3) assert [f['timestamp_seconds'] for f in out] == [0, 1, 2] - assert frames.get_metadata(str(clip))['duration_seconds'] == 3 + # FFmpeg 7.1 muxes this shifted clip one frame (0.1s) short; either is source-relative, 10 would not be. + assert 2.9 <= frames.get_metadata(str(clip))['duration_seconds'] <= 3 @pytest.mark.parametrize('fps', [float('nan'), float('inf'), -1, 0])