Skip to content

Commit

Permalink
Merge pull request #115 from MPEGGroup/5th-Ed
Browse files Browse the repository at this point in the history
Merge 5th Ed branch into dev
  • Loading branch information
Michael A Dolan authored Jun 17, 2021
2 parents 9b982fe + 91e9bf9 commit d760170
Show file tree
Hide file tree
Showing 7 changed files with 521 additions and 522 deletions.
25 changes: 9 additions & 16 deletions DASH-MPD.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@
<xs:element name="InitializationSet" type="InitializationSetType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="InitializationGroup" type="UIntVWithIDType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="InitializationPresentation" type="UIntVWithIDType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Period" type="PeriodType" maxOccurs="unbounded"/>
<xs:element name="ContentProtection" type="ContentProtectionType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Period" type="PeriodType" maxOccurs="unbounded"/>
<xs:element name="Metrics" type="MetricsType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="EssentialProperty" type="DescriptorType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="SupplementalProperty" type="DescriptorType" minOccurs="0" maxOccurs="unbounded"/>
Expand Down Expand Up @@ -145,7 +146,7 @@
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attribute name="ttl" type="xs:double" use="required"/>
<xs:attribute name="ttl" type="xs:double" use="optional"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:extension>
</xs:simpleContent>
Expand Down Expand Up @@ -435,23 +436,15 @@
<xs:attribute name="maxHeight" type="xs:unsignedInt"/>
<xs:attribute name="minFrameRate" type="FrameRateType"/>
<xs:attribute name="maxFrameRate" type="FrameRateType"/>
<xs:attribute name="segmentAlignment" type="ConditionalUintType" default="false"/>
<xs:attribute name="subsegmentAlignment" type="ConditionalUintType" default="false"/>
<xs:attribute name="segmentAlignment" type="xs:boolean" default="false"/>
<xs:attribute name="subsegmentAlignment" type="xs:boolean" default="false"/>
<xs:attribute name="subsegmentStartsWithSAP" type="SAPType" default="0"/>
<xs:attribute name="bitstreamSwitching" type="xs:boolean"/>
<xs:attribute name="initializationSetRef" type="UIntVectorType"/>
<xs:attribute name="initializationPrincipal" type="xs:anyURI"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="ConditionalUintType">
<xs:annotation>
<xs:documentation xml:lang="en">
Conditional Unsigned Integer (unsignedInt or boolean)
</xs:documentation>
</xs:annotation>
<xs:union memberTypes="xs:unsignedInt xs:boolean"/>
</xs:simpleType>
<xs:simpleType name="RatioType">
<xs:annotation>
<xs:documentation xml:lang="en">
Expand Down Expand Up @@ -533,7 +526,7 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ExtendedBandwidthType">
<xs:complexType name="ExtendedBandwidthType">
<xs:annotation>
<xs:documentation xml:lang="en">
Extended Bandwidth Model
Expand All @@ -551,12 +544,12 @@
<xs:documentation xml:lang="en">
Model Pair
</xs:documentation>
</xs:annotation>
</xs:annotation>
<xs:sequence>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="bufferTime" type="xs:duration"/>
<xs:attribute name="bandwidth" type="xs:unsignedInt"/>
<xs:attribute name="bufferTime" type="xs:duration" use="required"/>
<xs:attribute name="bandwidth" type="xs:unsignedInt" use="required"/>
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
<xs:simpleType name="StringNoWhitespaceType">
Expand Down
308 changes: 308 additions & 0 deletions tests/DASH-IF-manifests.json

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions tests/HbbTV-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[
{"source":"http://refapp.hbbtv.org/videos/"},
{"annotation":"Caminandes 01, Llama Drama (25fps, 75gop, 1080p, KID=1234) v3"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_1080p_25f75g6sv3/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_1080p_25f75g6sv3/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_1080p_25f75g6sv3/drm/manifest_clearkey.mpd"},
{"annotation":"Caminandes 02, Gran Dillama (25fps, 75gop, 1080p, KID=1236) v5"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/manifest_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/manifest_subib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/manifest_subob.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/manifest_subib_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/manifest_subob_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_subib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_subob.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_subib_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_subob_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_playready.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_marlin.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_widevine.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f75g6sv5/drm/manifest_clearkey.mpd"},
{"annotation":"Tears of Steel (25fps, 75gop, 1080p, KID=1237) v3"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_1080p_25f75g6sv3/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_1080p_25f75g6sv3/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_1080p_25f75g6sv3/drm/manifest_subib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_1080p_25f75g6sv3/drm/manifest_subob.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_1080p_25f75g6sv3/drm/manifest_clearkey.mpd"},
{"annotation":"Caminandes 02, Gran Dillama (25fps, 75gop, 1080p, KID=1236), multiaudio v4"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/manifest_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/manifest_subib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/manifest_subob.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/manifest_subib_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/manifest_subob_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest_subib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest_subob.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest_subib_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest_subob_evtib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv4/drm/manifest_clearkey.mpd"},
{"annotation":"Caminandes 02, Gran Dillama (25fps, 75gop, 1080p, KID=1236), multiaudio v5"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv5/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_ma_25f75g6sv5/drm/manifest.mpd"},
{"annotation":"Caminandes 01, Llama Drama (25fps, 75gop, 2160p h265, KID=1235) v3"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_2160p_25f75g6sv3/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_2160p_25f75g6sv3/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_2160p_25f75g6sv3/drm/manifest_clearkey.mpd"},
{"annotation":"Caminandes 01, Llama Drama (25fps, 75gop, 1080p h265, KID=1235) v2"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_2160pmr_25f75g6sv2/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_2160pmr_25f75g6sv2/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/01_llama_drama_2160pmr_25f75g6sv2/drm/manifest_clearkey.mpd"},
{"annotation":"Caminandes 03, Llamigos (25fps, 75gop, 2160p h265, KID=1238) v2"},
{"url":"http://refapp.hbbtv.org/videos/03_llamigos_2160psr_25f75g6sv2/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/03_llamigos_2160psr_25f75g6sv2/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/03_llamigos_2160psr_25f75g6sv2/drm/manifest_clearkey.mpd"},
{"annotation":"Tears of Steel (25fps, 75gop, 2160p h265, KID=1237) v2"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_2160psr_25f75g6sv2/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_2160psr_25f75g6sv2/drm/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_2160psr_25f75g6sv2/drm/manifest_subib.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_2160psr_25f75g6sv2/drm/manifest_subob.mpd"},
{"url":"http://refapp.hbbtv.org/videos/tears_of_steel_2160psr_25f75g6sv2/drm/manifest_clearkey.mpd"},
{"annotation":" Spring (25fps, 75gop, 1920x804(2.40) h264, KID=148D) v1"},
{"url":"http://refapp.hbbtv.org/videos/spring_804p_v1/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/spring_804p_v1/drm/manifest.mpd"},
{"annotation":"LiveSIM Caminandes 02, Gran Dillama (25fps, 25gop, 2sec, multi MOOF/MDAT, 1080p, KID=1236) v2"},
{"url":"http://refapp.hbbtv.org/livesim/02_llamav2/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/livesim/02_llamadrmv2/manifest.mpd"},
{"annotation":"LiveSIM Caminandes 02, Gran Dillama (25fps, 25gop, 2sec, multi MOOF/MDAT, 1080p, KID=1236) v5"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f25g2sv5/manifest.mpd"},
{"url":"http://refapp.hbbtv.org/videos/02_gran_dillama_1080p_25f25g2sv5/drm/manifest.mpd"}
]
5 changes: 5 additions & 0 deletions tests/MPEG-CMAF-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{"url":"https://usp-cmaf-test.s3.eu-central-1.amazonaws.com/tears-of-steel-hevc-only.mpd"},
{"url":"https://usp-cmaf-test.s3.eu-central-1.amazonaws.com/tears-of-steel-ttml.mpd"},
{"url":"https://usp-cmaf-test.s3.eu-central-1.amazonaws.com/tears-of-steel.mpd"}
]
30 changes: 30 additions & 0 deletions tests/dvb-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{"source":"https://dvb-2017-dm.s3.eu-central-1.amazonaws.com/overview.html"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/0.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/1.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/2.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/3.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/4.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/5.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/6.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/7.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/8.mpd"},
{"url":"https://a09ac5ffb43c4015b4a006d2b85fa289.mediatailor.eu-central-1.amazonaws.com/v1/dash/6531e8093d869efd0cb1a0354ebd2f3411a4bb88/testmp/.mpd"},
{"url":"https://ylxa8rnu79.execute-api.eu-central-1.amazonaws.com/learning.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/1.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/3.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/5.mpd"},
{"url":"https://pl8q5ug7b6.execute-api.eu-central-1.amazonaws.com/6.mpd"},
{"url":"https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-widevine-playready.ism/.mpd"},
{"url":"https://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-widevine-playready.ism/.mpd"},
{"url":"https://livesim.dashif.org/livesim-chunked/chunkdur_1/ato_7/testpic4_8s/Manifest.mpd"},
{"url":"https://testlowlat.harmonicinc.com/Content/DASH/Live/channel(dash_ll_time)/manifest.mpd"},
{"url":"https://pf5.broadpeak-vcdn.com/bpk-tv/tvrll/llcmaf/index.mpd"},
{"url":"https://akamaibroadcasteruseast.akamaized.net/cmaf/live/657078/akasource/out.mpd"},
{"url":"https://live.unified-streaming.com/scte35/scte35.isml/.mpd"},
{"url":"https://d3tsbu4e72p918.cloudfront.net/dolbyac4/manifest.mpd"},
{"url":"https://dvb-2017-dm.s3.eu-central-1.amazonaws.com/ST2094-10.mpd"},
{"url":"https://dvb-2017-dm.s3.eu-central-1.amazonaws.com/SL-HDR2.mpd"},
{"url":"https://dvb-2017-dm.s3.eu-central-1.amazonaws.com/SL-HDR2-on-off.mpd"},
{"url":"https://dvb-2017-dm.s3.eu-central-1.amazonaws.com/ST2094-10-on-off.mpd"}
]
95 changes: 95 additions & 0 deletions tests/regression-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"""
evaluate manifests from other organisations against the MPEG DASH schema
developed by Paul Higgs using Python 3.9.1
uses the following libraries
* requests, python -m pip install requests
* lxml, python -m pip install lxml
"""

import sys
import unittest
import logging
import requests
import json
import re

from lxml import etree

DVBManifestsFile="DVB-manifests.json"
HbbTVManifestsFile="HbbTV-manifests.json"
MPEGCMAFManifestsFile="MPEG-CMAF-manifests.json"
DASHIFManifestsFile="DASH-IF-Manifests.json"

DASHIF_dataset_url = "https://raw.githubusercontent.com/Dash-Industry-Forum/Test-Assets-Dataset-Public/master/dataset/data/testvector.json"

class TestManifests(unittest.TestCase):
def setUp(self):
self.log = logging.getLogger('MDP_tests')
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
self.log.info('Loading MPEG DASH schema')
self.xsdParser=etree.XMLParser(load_dtd=True, huge_tree=True, resolve_entities=True)
with open('../DASH-MPD.xsd', 'r') as schema_file:
self.mpd_schema = etree.XMLSchema(etree.parse(schema_file, self.xsdParser))
# is_python3 = sys.version_info.major == 3
self.xmlParser=etree.XMLParser(load_dtd=True, huge_tree=True, resolve_entities=True)

def check_a_manifest(self, mpdURL, source):
with self.subTest(msg=mpdURL):
self.log.info('Validating {%s} %s', source, mpdURL)
try:
mpdRequest=requests.get(mpdURL, allow_redirects=True)
except Exception as err:
self.fail(err)
else:
self.assertEqual(mpdRequest.status_code, 200, "Request error; expected 200, got %d" % mpdRequest.status_code)
if mpdRequest.status_code == 200:
mpd=etree.fromstring((mpdRequest.text).encode('utf8'), self.xmlParser)
if not self.mpd_schema.validate(mpd):
self.fail(self.mpd_schema.error_log.filter_from_errors())

def check_manifests(self, mpdList, source):
for mpdURL in mpdList:
self.check_a_manifest(mpdURL, source)

def isURL(self, value):
return re.search("^https?://.*", value) != None

def loadDataset(self, fromLocation):
result=[]
if self.isURL(fromLocation):
response=requests.get(fromLocation, allow_redirects=True)
dataset=json.loads(response.text)
else:
with open(fromLocation, 'r') as manifest_file:
dataset=json.load(manifest_file)
for item in dataset:
if "url" in item:
if "status" in item:
if item["status"].upper() == 'OK':
result.append(item["url"])
else:
result.append(item["url"])
return result

def test_DVB(self):
self.check_manifests(self.loadDataset(DVBManifestsFile), "DVB")

def test_HbbTV(self):
self.check_manifests(self.loadDataset(HbbTVManifestsFile), "HbbTV")

def test_MPEG_CMAF(self):
self.check_manifests(self.loadDataset(MPEGCMAFManifestsFile), "MPEG CMAF")

def test_DASH_IF_list(self):
self.check_manifests(self.loadDataset(DASHIFManifestsFile), "DASH-IF Local List")

def test_DASH_IF_dataset(self):
self.check_manifests(self.loadDataset(DASHIF_dataset_url), "DASH-IF Dataset")

def dont_test_one(self):
mpd="http://html5.cablelabs.com:8100/cenc/prwv/dash.mpd"
self.check_a_manifest(mpd, "debugging1")

if __name__ == '__main__':
unittest.main()
Loading

0 comments on commit d760170

Please sign in to comment.