[FFmpeg-devel] [PATCH v2 2/2] tests/fate/hlsenc: add testcase of ac3 surround sound input in hlsenc

Steven Liu lq at chinaffmpeg.org
Mon Jun 15 15:37:41 EEST 2020


add probeaudiostream for get audio stream's codec_name,codec_time_base,
sample_fmt,channels and channel_layout.

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 tests/fate-run.sh           |  4 ++++
 tests/fate/hlsenc.mak       | 14 +++++++++++++-
 tests/ref/fate/hls-fmp4_ac3 |  9 +++++++++
 3 files changed, 26 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/hls-fmp4_ac3

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 002944b010..414ac6f825 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -89,6 +89,10 @@ probefmt(){
     run ffprobe${PROGSUF}${EXECSUF} -show_entries format=format_name -print_format default=nw=1:nk=1 -v 0 "$@"
 }
 
+probeaudiostream(){
+    run ffprobe${PROGSUF}${EXECSUF} -show_entries stream=codec_name,codec_time_base,sample_fmt,channels,channel_layout -v 0 "$@"
+}
+
 probetags(){
     run ffprobe${PROGSUF}${EXECSUF} -show_entries format_tags -v 0 "$@"
 }
diff --git a/tests/fate/hlsenc.mak b/tests/fate/hlsenc.mak
index 43f93c8c5b..c56a541f43 100644
--- a/tests/fate/hlsenc.mak
+++ b/tests/fate/hlsenc.mak
@@ -97,5 +97,17 @@ FATE_HLSENC-$(call ALLYES, HLS_DEMUXER MPEGTS_MUXER MPEGTS_DEMUXER AEVALSRC_FILT
 fate-hls-fmp4: tests/data/hls_segment_type_fmp4.m3u8
 fate-hls-fmp4: CMD = framecrc -flags +bitexact -i $(TARGET_PATH)/tests/data/hls_fmp4.m3u8 -vf setpts=N*23
 
-FATE_FFMPEG += $(FATE_HLSENC-yes)
+tests/data/hls_fmp4_ac3.m3u8: TAG = GEN
+tests/data/hls_fmp4_ac3.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+	$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+	-stream_loop 4 -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3 -c copy -map 0 \
+	-hls_segment_type fmp4 -hls_fmp4_init_filename now.mp4 -hls_list_size 0 \
+	-hls_time 2 -hls_segment_filename "$(TARGET_PATH)/tests/data/hls_fmp4_%d.m4s" \
+	$(TARGET_PATH)/tests/data/hls_fmp4_ac3.m3u8 2>/dev/null
+
+FATE_HLSENC-$(call ALLYES, HLS_DEMUXER EAC3_DEMUXER) += fate-hls-fmp4_ac3
+fate-hls-fmp4_ac3: tests/data/hls_fmp4_ac3.m3u8
+fate-hls-fmp4_ac3: CMD = probeaudiostream $(TARGET_PATH)/tests/data/now.mp4
+
+FATE_SAMPLES_FFMPEG += $(FATE_HLSENC-yes)
 fate-hlsenc: $(FATE_HLSENC-yes)
diff --git a/tests/ref/fate/hls-fmp4_ac3 b/tests/ref/fate/hls-fmp4_ac3
new file mode 100644
index 0000000000..1f45172a0e
--- /dev/null
+++ b/tests/ref/fate/hls-fmp4_ac3
@@ -0,0 +1,9 @@
+[STREAM]
+codec_name=ac3
+codec_time_base=1/48000
+sample_fmt=fltp
+channels=6
+channel_layout=5.1(side)
+[SIDE_DATA]
+[/SIDE_DATA]
+[/STREAM]
-- 
2.25.0





More information about the ffmpeg-devel mailing list