Skip to content

Commit b45d581

Browse files
add long duration hls shaka test
1 parent f422ca8 commit b45d581

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

media/generate_hls.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function make_fmp4_audio_hls {
3737
-master_pl_name main.m3u8 \
3838
-var_stream_map 'a:0' $stream_dir/stream_%v/.m3u8
3939
fi
40+
4041
}
4142

4243
function make_hls {
@@ -45,6 +46,7 @@ function make_hls {
4546
local vcodec=$3
4647
local acodec=$4
4748
local stream_dir=$5
49+
local streamloop="${6:-0}"
4850
local extension="mp4"
4951
if [[ $container == "mpegts" ]]; then
5052
extension="ts"
@@ -53,7 +55,7 @@ function make_hls {
5355
if [ ! -f $stream_dir/main.m3u8 ]; then
5456
mkdir -p $stream_dir
5557
local video_args='-g 48 -sc_threshold 0 -keyint_min 48'
56-
ffmpeg -i $input \
58+
ffmpeg -stream_loop $streamloop -i $input \
5759
-filter_complex \
5860
'[0:v]split=3[v1][v2][v3]; [v1]scale=w=1280:h=720[v0out]; [v2]scale=w=640:h=360[v1out]; [v3]scale=w=360:h=180[v2out]' \
5961
-map "[v0out]" -c:v:0 $vcodec -profile:v:0 main -b:v:0 5M -maxrate:v:0 5M -minrate:v:0 5M -bufsize:v:0 10 $video_args \
@@ -102,3 +104,7 @@ if [ ! -f $hls_path/fmp4_h264_aac_vtt/main.m3u8 ]; then
102104
-var_stream_map "v:0,a:0,s:0,sgroup:subtitles,language:en" \
103105
$hls_path/fmp4_h264_aac_vtt/stream_%v/.m3u8
104106
fi
107+
108+
#Generate long duration dash stream by appending video in a loop such that play duration >= 1.5hrs
109+
#input video duration = 2mins, so the number of loops required is 45 to get 92 min video
110+
make_hls $progressive_path/vid1_h264_aac.mp4 mpegts libx264 aac $hls_path/longdur 45

src/mediaStreams.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,17 @@ var MS = {
686686
},
687687
widevine: true,
688688
},
689+
MP2TS_AVC_AAC_LONG: {
690+
variant: "hls",
691+
container: "mpeg2ts",
692+
src: "test-materials/hls/longdur/main.m3u8",
693+
video: {
694+
codec: "avc",
695+
},
696+
audio: {
697+
codec: "aac",
698+
},
699+
},
689700
},
690701
HSS: {
691702
FMP4_AVC_AAC_VTT: {
@@ -1061,6 +1072,7 @@ const StreamSets = {
10611072
DRM: [MS.HLS.WIDEVINE_CENC, MS.HLS.WIDEVINE_CBCS],
10621073
Subtitles: [MS.HLS.FMP4_AVC_AAC_VTT],
10631074
Performance: [MS.HLS.MP2TS_AVC_AAC_PLAYBACK_START_TIME, MS.HLS.WIDEVINE_CENC_PLAYBACK_START_TIME],
1075+
LongDuration: [MS.HLS.MP2TS_AVC_AAC_LONG],
10641076
},
10651077
Progressive: {
10661078
Common: [

src/suites.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,19 @@ var LONG_DUR_VIDEO_TIMEOUT_MS = 2*60*60*1000;
288288

289289
registerTestSuite(testSuite, makeTests(tests));
290290
})();
291+
292+
(function () {
293+
const testSuite = "Long Duration HLS shaka";
294+
let engine = new ShakaEngine();
295+
let skipTests = {};
296+
297+
let tests = makeMvtMediaTests(testLongDurationVideoPlayback, engine, StreamSets.HLS.LongDuration, null, LONG_DUR_VIDEO_TIMEOUT_MS);
298+
tests = tests.concat(makeMvtMediaTests(testLongDurationVideoPause, engine, StreamSets.HLS.LongDuration, null, LONG_DUR_VIDEO_TIMEOUT_MS));
299+
tests = tests.concat(makeMvtMediaTests(testLongDurationVideoSetPosition, engine, StreamSets.HLS.LongDuration, null, LONG_DUR_VIDEO_TIMEOUT_MS));
300+
tests = tests.concat(makeMvtMediaTests(testLongDurationVideoPlayRate, engine, StreamSets.HLS.LongDuration, null, LONG_DUR_VIDEO_TIMEOUT_MS));
301+
302+
tests = filterUnsupportedOnProfile(SelectedProfile, tests);
303+
tests = filterSkipTests(skipTests, tests);
304+
305+
registerTestSuite(testSuite, makeTests(tests));
306+
})();

0 commit comments

Comments
 (0)