From a082774f12520f14a0250eb9c5b6c180e3bcedab Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Tue, 4 Aug 2026 12:29:03 -0400 Subject: [PATCH] FFmpeg 9.0 reorders AVCodecID --- tests/test_codec.py | 4 ++-- tests/test_containerformat.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_codec.py b/tests/test_codec.py index 2f8b95e0b..2203f4cba 100644 --- a/tests/test_codec.py +++ b/tests/test_codec.py @@ -18,7 +18,7 @@ def test_codec_mpeg4_decoder() -> None: assert c.name == "mpeg4" assert c.long_name == "MPEG-4 part 2" assert c.type == "video" - assert c.id in (12, 13) + assert c.id == Codec("mpeg4", "w").id # ids are not stable across FFmpeg versions assert c.is_decoder assert not c.is_encoder assert c.delay @@ -38,7 +38,7 @@ def test_codec_mpeg4_encoder() -> None: assert c.name == "mpeg4" assert c.long_name == "MPEG-4 part 2" assert c.type == "video" - assert c.id in (12, 13) + assert c.id == Codec("mpeg4").id # ids are not stable across FFmpeg versions assert c.is_encoder assert not c.is_decoder assert c.delay diff --git a/tests/test_containerformat.py b/tests/test_containerformat.py index ca0b72fd7..453d65d64 100644 --- a/tests/test_containerformat.py +++ b/tests/test_containerformat.py @@ -1,4 +1,4 @@ -from av import ContainerFormat, formats_available, open +from av import Codec, ContainerFormat, formats_available, open from .common import fate_suite @@ -62,7 +62,7 @@ def test_video_codec_id() -> None: # Regression test for https://github.com/PyAV-Org/PyAV/issues/2243 # video_codec_id allows overriding the codec used when opening a container. AV_CODEC_ID_NONE = 0 - AV_CODEC_ID_H264 = 27 + AV_CODEC_ID_H264 = Codec("h264").id with open(fate_suite("h264/interlaced_crop.mp4")) as container: assert container.video_codec_id == AV_CODEC_ID_NONE