[nginx-tests] Tests: adjusted mp4 tests to use mpeg4 encoder.

Maxim Dounin mdounin at mdounin.ru
Tue Oct 14 23:32:41 UTC 2025


details:   http://freenginx.org/hg/nginx-tests/rev/6e663bd67bc4
branches:  
changeset: 2027:6e663bd67bc4
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Wed Oct 15 02:32:07 2025 +0300
description:
Tests: adjusted mp4 tests to use mpeg4 encoder.

It turns out libopenh264 encoder as provided on Fedora is not stable,
and, in particular, mp4 tests fail due to this on current Fedora Rawhide.
As a workaround, switched to using mpeg4 internal encoder instead,
which is always available.

diffstat:

 mp4.t                 |  6 ++----
 mp4_directio.t        |  4 +---
 mp4_ssi.t             |  4 +---
 mp4_start_key_frame.t |  4 +---
 range_mp4.t           |  4 +---
 5 files changed, 6 insertions(+), 16 deletions(-)

diffs (89 lines):

diff --git a/mp4.t b/mp4.t
--- a/mp4.t
+++ b/mp4.t
@@ -51,18 +51,16 @@ EOF
 
 plan(skip_all => 'no lavfi')
 	unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
-plan(skip_all => 'no libx264 or libopenh264')
-	unless grep /libx264|libopenh264/, `ffmpeg -loglevel quiet -encoders`;
 system('ffmpeg -nostdin -loglevel quiet -y '
 	. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
 	. '-f lavfi -i testsrc=duration=20:size=320x200:rate=15 '
-	. '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v h264 '
+	. '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v mpeg4 '
 	. "${\($t->testdir())}/test.mp4") == 0
 	or die "Can't create mp4 file: $!";
 system('ffmpeg -nostdin -loglevel quiet -y '
 	. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
 	. '-f lavfi -i testsrc=duration=20:size=320x200:rate=15 '
-	. '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v h264 '
+	. '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v mpeg4 '
 	. '-movflags +faststart '
 	. "${\($t->testdir())}/no_mdat.mp4") == 0
 	or die "Can't create mp4 file: $!";
diff --git a/mp4_directio.t b/mp4_directio.t
--- a/mp4_directio.t
+++ b/mp4_directio.t
@@ -50,11 +50,9 @@ EOF
 
 plan(skip_all => 'no lavfi')
 	unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
-plan(skip_all => 'no libx264 or libopenh264')
-	unless grep /libx264|libopenh264/, `ffmpeg -loglevel quiet -encoders`;
 system('ffmpeg -nostdin -loglevel quiet -y '
 	. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
-	. '-g 15 -c:v h264 '
+	. '-g 15 -c:v mpeg4 '
 	. "${\($t->testdir())}/test.mp4") == 0
 	or die "Can't create mp4 file: $!";
 
diff --git a/mp4_ssi.t b/mp4_ssi.t
--- a/mp4_ssi.t
+++ b/mp4_ssi.t
@@ -52,12 +52,10 @@ EOF
 
 plan(skip_all => 'no lavfi')
 	unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
-plan(skip_all => 'no libx264 or libopenh264')
-	unless grep /libx264|libopenh264/, `ffmpeg -loglevel quiet -encoders`;
 system('ffmpeg -nostdin -loglevel quiet -y '
 	. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
 	. '-f lavfi -i testsrc=duration=20:size=320x200:rate=15 '
-	. '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v h264 '
+	. '-map 0:0 -map 1:0 -pix_fmt yuv420p -g 15 -c:v mpeg4 '
 	. "${\($t->testdir())}/ssi.mp4") == 0
 	or die "Can't create mp4 file: $!";
 
diff --git a/mp4_start_key_frame.t b/mp4_start_key_frame.t
--- a/mp4_start_key_frame.t
+++ b/mp4_start_key_frame.t
@@ -56,11 +56,9 @@ EOF
 
 plan(skip_all => 'no lavfi')
 	unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
-plan(skip_all => 'no libx264 or libopenh264')
-	unless grep /libx264|libopenh264/, `ffmpeg -loglevel quiet -encoders`;
 system('ffmpeg -nostdin -loglevel quiet -y '
 	. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
-	. '-pix_fmt yuv420p -g 15 -c:v h264 '
+	. '-pix_fmt yuv420p -g 15 -c:v mpeg4 '
 	. "${\($t->testdir())}/test.mp4") == 0
 	or die "Can't create mp4 file: $!";
 $t->run()->plan(4);
diff --git a/range_mp4.t b/range_mp4.t
--- a/range_mp4.t
+++ b/range_mp4.t
@@ -49,11 +49,9 @@ EOF
 
 plan(skip_all => 'no lavfi')
 	unless grep /lavfi/, `ffmpeg -loglevel quiet -formats`;
-plan(skip_all => 'no libx264 or libopenh264')
-	unless grep /libx264|libopenh264/, `ffmpeg -loglevel quiet -encoders`;
 system('ffmpeg -nostdin -loglevel quiet -y '
 	. '-f lavfi -i testsrc=duration=10:size=320x200:rate=15 '
-	. "-pix_fmt yuv420p -c:v h264 ${\($t->testdir())}/test.mp4") == 0
+	. "-pix_fmt yuv420p -c:v mpeg4 ${\($t->testdir())}/test.mp4") == 0
 	or die "Can't create mp4 file: $!";
 
 $t->run()->plan(13);


More information about the nginx-devel mailing list