From e2ec5ea3b7d9e5fd3225a05891f3611e29adbd1d Mon Sep 17 00:00:00 2001 From: Tom Vercauteren Date: Thu, 7 Mar 2024 14:28:21 +0000 Subject: [PATCH 1/2] Add a null filter to re-enable frame count This aims at addressing https://github.com/imageio/imageio-ffmpeg/issues/99 --- imageio_ffmpeg/_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imageio_ffmpeg/_io.py b/imageio_ffmpeg/_io.py index b85c453..faf1ee8 100644 --- a/imageio_ffmpeg/_io.py +++ b/imageio_ffmpeg/_io.py @@ -153,8 +153,8 @@ def count_frames_and_secs(path): path, "-map", "0:v:0", - "-c", - "copy", + "-vf", + "null", "-f", "null", "-", From fc9f14f1173a5cb7976a000e04d22d1a1b64c551 Mon Sep 17 00:00:00 2001 From: Tom Vercauteren Date: Thu, 23 May 2024 08:49:20 +0100 Subject: [PATCH 2/2] Relax testing criteria in test_read_nframes See https://github.com/imageio/imageio-ffmpeg/pull/107#issuecomment-1985252543 --- tests/test_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_io.py b/tests/test_io.py index bb14869..c3cbea8 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -40,7 +40,7 @@ def test_ffmpeg_version(): def test_read_nframes(): nframes, nsecs = imageio_ffmpeg.count_frames_and_secs(test_file1) assert nframes == 280 - assert 13.80 < nsecs < 13.99 + assert 13.80 < nsecs <= 14.00 def test_read_frames_resource_warning():