Skip to content

Commit

Permalink
Integrate Widevine tests, fix for MULTIAUDIO AudioTracks and changed …
Browse files Browse the repository at this point in the history
…logic in index.html (#40)

* Add Widevine implementation

* Add generating Widevine streams with shaka-packager

* Add little delay between scripts load, change in Audiotracks test and in profile selection

* Major change in scripts loading inside index.html

* Update codecs for Widevine streams, disable CBCS on hlsjs
  • Loading branch information
lukasz-rutkowski-red committed Jul 18, 2023
1 parent 19c17ea commit 8dccf9c
Show file tree
Hide file tree
Showing 18 changed files with 454 additions and 214 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ WORKDIR $MVT_PATH
RUN mv httpd.conf /usr/local/apache2/conf/httpd.conf

RUN apt-get update
RUN apt-get install -y ffmpeg wget python3
RUN apt-get install -y ffmpeg wget python3 nano
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ A list of of all external media assets used by a deployed instance of MVT:

Tests are grouped into test suites, which differ in streaming type (DASH, HLS, HSS, progressive) and player (Shaka Player, dash.js, hls.js, native).

The test list is generated dynamically based on available streams (`mediaStreams.js`),
The test list is generated dynamically based on available streams (`src/mediaStreams.js`),
test templates (`src/mediaTests.js`) and selected profile configuration (e.g. `src/profiles.js`).
Each test is actually an instantiation of a test template, e.g. `DASH-FMP4-AVC1-AAC Playback`
and `DASH-DYNAMIC Playback` share the same test code (`src/mediaTests.js::testPlayback`),
Expand Down Expand Up @@ -156,7 +156,7 @@ Most of the URL parameters can be combined. Here's a full list of supported quer
- `engine_shaka=3.0.1|3.2.1|4.3.6` - select Shaka Player version. Please note it will only affect Shaka test suites.
- `engine_dashjs=3.1.1|4.4.0|4.7.0|latest` - select dash.js version. Please note it will only affect dash.js test suites.
- `engine_hlsjs=1.0.0|1.2.1|1.3.0|1.4.5` - select hls.js version. Please note it will only affect hls.js test suites.
- `profile=all|default|desktop|VIP7002W` - depends of tested unit.
- `profile=all|default|desktop|extended_drm` - depends of tested unit.
- `debug=true|false` - adding additional timestamps to the output log.

### JavaScript API
Expand Down Expand Up @@ -231,7 +231,7 @@ in order to start `js_mse_eme` submodule and to render the UI.

### Adding new tests

MVT test cases are a product of test templates (`src/mediaTests.js`) and media streams (`mediaStreams.js`).
MVT test cases are a product of test templates (`src/mediaTests.js`) and media streams (`src/mediaStreams.js`).
Test templates provide the actual test implementation, which can be parametrized with a given media stream.
It means that e.g. `DASH_FMP4_AVC_AAC Playback` and `DASH_FMP4_MPEG2_MP3 Playback` load different media content,
but the test code is exactly the same (`src/mediaTests.js::testPlayback`). Such approach allows us to verify
Expand Down
6 changes: 3 additions & 3 deletions coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -36,7 +36,7 @@
"test-materials/js/countdown-es.js",
"src/constants.js",
"src/common.js",
"mediaStreams.js",
"src/mediaStreams.js",
"src/mvtTest.js",
"src/profiles.js",
"src/engines.js",
Expand All @@ -58,7 +58,7 @@
scriptSources.shift();
loadNextScript();
};
document.head.appendChild(script);
document.head.append(script);
} else {
generateCoverage();
}
Expand Down
2 changes: 1 addition & 1 deletion docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# limitations under the License.

mkdir -p ${TEST_MATERIALS_SRC:-/data/test-materials}
docker run -v ${TEST_MATERIALS_SRC:-/data/test-materials}:/home/MVT/test-materials --rm -d -it --name mvt-app -p ${PORT:-80}:80 mvt-app-img
docker run -v ${TEST_MATERIALS_SRC:-/data/test-materials}:/home/MVT/test-materials --rm -d --name mvt-app -p ${PORT:-80}:80 mvt-app-img
44 changes: 1 addition & 43 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,9 @@
<title>Media Validation Tool</title>
<link rel="stylesheet" href="js_mse_eme/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/mux.js/6.2.0/mux.min.js" defer></script>
<!-- Do NOT Change order of script sources! -->
<script src="src/engineChange.js" defer></script>
<script src="test-materials/js/countdown-de.js" defer></script>
<script src="test-materials/js/countdown-en.js" defer></script>
<script src="test-materials/js/countdown-fr.js" defer></script>
<script src="test-materials/js/countdown-es.js" defer></script>
<script src="src/constants.js" defer></script>
<script src="src/common.js" defer></script>
<script src="mediaStreams.js" defer></script>
<script src="js_mse_eme/harness/util.js" defer></script>
<script src="js_mse_eme/harness/constants.js" defer></script>
<script src="js_mse_eme/harness/key.js" defer></script>
<script src="js_mse_eme/harness/focusManager.js" defer></script>
<script src="js_mse_eme/harness/logger.js" defer></script>
<script src="js_mse_eme/harness/xhr.js" defer></script>
<script src="js_mse_eme/harness/timeout.js" defer></script>
<script src="js_mse_eme/harness/testView.js" defer></script>
<script src="js_mse_eme/harness/compactTestList.js" defer></script>
<script src="js_mse_eme/harness/compactTestView.js" defer></script>
<script src="js_mse_eme/harness/test.js" defer></script>
<script src="js_mse_eme/lib/mse/msutil.js" defer></script>
<script src="js_mse_eme/lib/mse/mediaSourcePortability.js" defer></script>
<script src="src/mvtTest.js" defer></script>
<script src="src/profiles.js" defer></script>
<script src="src/engines.js" defer></script>
<script src="src/mediaTests.js" defer></script>
<script src="src/suites.js" defer></script>
<script src="js_mse_eme/harness/main.js" defer></script>
</head>
<body>
<div id="testArea" style="display: none"></div>
<div id="login-pop-up" style="display: none">
<div id="client-id-div">
<p class="step">1) On your phone or computer, go to youtube.com/activate</p>
<br />
<p class="step" id="client-id">2) Enter this code</p>
<br />
<p class="step">3) Sign in with your Google account</p>
</div>
</div>
<script type="text/javascript">
window.addEventListener('load', function() {
startMseTest(testVersion);
})
</script>
<script src="src/main.js" async defer></script>
</body>
</html>
3 changes: 1 addition & 2 deletions media/generate_hls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,4 @@ if [ ! -f $hls_path/fmp4_h264_aac_vtt/main.m3u8 ]; then
-master_pl_name main.m3u8 \
-var_stream_map "v:0,a:0,s:0,sgroup:subtitles,language:en" \
$hls_path/fmp4_h264_aac_vtt/stream_%v/.m3u8

fi
fi
63 changes: 63 additions & 0 deletions media/generate_widevine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#! /bin/bash
#
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2022 Liberty Global B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

mp4_input=$progressive_path/vid2_h264_aac.mp4
shaka_packager_url="https://github.com/shaka-project/shaka-packager/releases/download/v2.6.1/packager-linux-x64"

if [ ! -f $test_materials_path/shaka-packager ]; then
wget $shaka_packager_url --no-check-certificate -O $test_materials_path/shaka-packager
chmod +x $test_materials_path/shaka-packager
fi

function make_widevine {
local video_ext=$1
local audio_ext=$2
local container=$3
local encryption=$4

if [ "$container" = "DASH" ]; then
output_path=$test_materials_path/dash/widevine/$encryption
manifest_cmd="--generate_static_live_mpd --mpd_output $output_path/manifest.mpd"
elif [ "$container" = "HLS" ]; then
output_path=$test_materials_path/hls/widevine/$encryption
manifest_cmd="--hls_playlist_type vod --hls_master_playlist_output $output_path/manifest.m3u8"
fi

if [ ! -f $output_path/manifest* ]; then
$test_materials_path/shaka-packager \
in=$mp4_input,stream=video,init_segment=$output_path/init-stream0.$video_ext,segment_template=$output_path/chunk-stream0-\$Number\$.$video_ext \
in=$mp4_input,stream=audio,init_segment=$output_path/init-stream1.$audio_ext,segment_template=$output_path/chunk-stream1-\$Number\$.$audio_ext \
--protection_scheme $encryption \
--enable_widevine_encryption \
--key_server_url https://license.uat.widevine.com/cenc/getcontentkey/widevine_test \
--content_id 7465737420636f6e74656e74206964 \
--signer widevine_test \
--aes_signing_key 1ae8ccd0e7985cc0b6203a55855a1034afc252980e970ca90e5202689f947ab9 \
--aes_signing_iv d58ce954203b7c9a9a9d467f59839249 \
--segment_duration 12 \
$manifest_cmd
fi
}

make_widevine mp4 m4a HLS cenc
make_widevine mp4 m4a HLS cbcs
make_widevine m4s m4s DASH cenc
make_widevine m4s m4s DASH cbcs
1 change: 1 addition & 0 deletions media/prepare_media_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ $media_path/generate_progressive.sh
$media_path/generate_dash.sh
$media_path/generate_hls.sh
$media_path/generate_cmaf.sh
$media_path/generate_widevine.sh

echo "All test materials downloaded!"
2 changes: 1 addition & 1 deletion patches/0001_js_mse_eme_mvt.patch
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ index c040757..a342af3 100644
document.body.appendChild(createElement('span', 'info', 'h4'));
document.body.appendChild(createElement('span', 'usage', 'h4'));
+ var config = createElement('span', 'configure', 'h4')
+ config.innerHTML = "Configuration: " + window.ConfigString;
+ config.innerHTML = 'Profile: <span style="color: green">' + window.ConfigString + '</span>';
+ document.body.appendChild(config);
document.body.appendChild(createElement('div', 'testview'));

Expand Down
2 changes: 1 addition & 1 deletion src/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function generateCoverage() {
const streamingType = STREAMING_TYPES[streamingName];

let top = createAndAdd(coverage, "div");
top.setAttribute("style", "width: 100%")
top.setAttribute("style", "width: 100%");
top.appendChild(util.createElement("h1", streamingName, "focusable", streamingName));
let table = util.createElement("table", streamingName + "_table", "coverage_table");
top.appendChild(table);
Expand Down
105 changes: 0 additions & 105 deletions src/engineChange.js

This file was deleted.

0 comments on commit 8dccf9c

Please sign in to comment.