diff --git a/imageio_ffmpeg/_parsing.py b/imageio_ffmpeg/_parsing.py index b32ea35..8dd71b8 100644 --- a/imageio_ffmpeg/_parsing.py +++ b/imageio_ffmpeg/_parsing.py @@ -161,9 +161,8 @@ def parse_ffmpeg_header(text): # the regexp omits values of "1k tbr" which seems a specific edge-case #262 # it seems that tbr is generally to be preferred #262 fps = 0 - for line in (videolines[0], videolines[-1]): - matches = re.findall(r" ([0-9]+\.?[0-9]*) (tbr|fps)", line) - matches.sort(key=lambda x: x[1] == "tbr", reverse=True) + for line in [videolines[0]]: + matches = re.findall(r" ([0-9]+\.?[0-9]*) (fps)", line) if matches: fps = float(matches[0][0].strip()) meta["fps"] = fps diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 74d0c13..e83bd9b 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -74,7 +74,7 @@ def test_get_correct_fps1(): ) info = parse_ffmpeg_header(sample) - assert info["fps"] == 26.58 + assert info["fps"] == 29.46 def test_get_correct_fps2():