Skip to content

Commit

Permalink
[tests] use "h264" instead of "libx264" for tests (fixes: #951)
Browse files Browse the repository at this point in the history
This allows running the test suite against FFmpeg builds which do not
have libx264 enabled.
  • Loading branch information
jlaine committed Apr 18, 2022
1 parent e5ae31d commit 541b028
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions tests/test_codec_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def image_sequence_encode(self, codec_name):
self.assertEqual(frame.format.name, pix_fmt)

def test_encoding_h264(self):
self.video_encoding("libx264", {"crf": "19"})
self.video_encoding("h264", {"crf": "19"})

def test_encoding_mpeg4(self):
self.video_encoding("mpeg4")
Expand Down Expand Up @@ -282,11 +282,7 @@ def video_encoding(self, codec_name, options={}, codec_tag=None):
packet_sizes.append(packet.size)
f.write(packet)

dec_codec_name = codec_name
if codec_name == "libx264":
dec_codec_name = "h264"

ctx = av.Codec(dec_codec_name, "r").create()
ctx = av.Codec(codec_name, "r").create()
ctx.open()

decoded_frame_count = 0
Expand Down
2 changes: 1 addition & 1 deletion tests/test_encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_encoding_with_pts(self):
path = self.sandboxed("video_with_pts.mov")

with av.open(path, "w") as output:
stream = output.add_stream("libx264", 24)
stream = output.add_stream("h264", 24)
stream.width = WIDTH
stream.height = HEIGHT
stream.pix_fmt = "yuv420p"
Expand Down

0 comments on commit 541b028

Please sign in to comment.