Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with sequence of elements in the MPD #85

Open
ypo opened this issue Nov 12, 2024 · 4 comments
Open

Issue with sequence of elements in the MPD #85

ypo opened this issue Nov 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ypo
Copy link

ypo commented Nov 12, 2024

MPD elements are not ordered based the <xs:sequence> of the DASH schema.
The results is that MPDs generated by this library are not passing the XML Schema validation

For example, the following MPD Instance :

<?xml version="1.0" encoding="UTF-8"?>
<MPD type="dynamic"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:cenc="urn:mpeg:cenc:2013"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:dvb="urn:dvb:dash-extensions:2014-1"
  xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" minBufferTime="PT2S" minimumUpdatePeriod="PT2S" timeShiftBufferDepth="PT1M0S" publishTime="2024-11-12T11:49:06Z" availabilityStartTime="1970-01-01T00:00:02.664019486Z">
  <Period id="P0" start="PT0S">
    <AdaptationSet contentType="video" sar="1:1" scanType="progressive" segmentAlignment="true" mimeType="video/mp4" maxWidth="1280" maxHeight="720" frameRate="50" maxFrameRate="50" startWithSAP="1">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
      <SegmentTemplate initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/$Number$.m4s" startNumber="0" duration="200" timescale="100"/>
      <Representation id="HD" codecs="avc1.640020" bandwidth="6281004" width="1280" height="720"/>
      <Representation id="SD" codecs="avc1.64001f" bandwidth="1507176" width="854" height="480"/>
    </AdaptationSet>
    <AdaptationSet contentType="audio" lang="eng" segmentAlignment="true" audioSamplingRate="48000" mimeType="audio/mp4" codecs="mp4a.40.2" startWithSAP="1">
      <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
      <SegmentTemplate initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/$Number$.m4s" startNumber="0" duration="96000" timescale="48000"/>
      <AudioChannelConfiguration schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" value="2"/>
      <Representation id="audio" bandwidth="101673"/>
    </AdaptationSet>
  </Period>
  <UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-iso:2014" value="http://dvb.gw/time?iso&amp;ms"/>
</MPD>

Is generating the following error when validating with DASH-MPD.xsd :

Element '{urn:mpeg:dash:schema:mpd:2011}AudioChannelConfiguration': This element is not expected. Expected is ( {urn:mpeg:dash:schema:mpd:2011}Representation ).

@emarsden
Copy link
Owner

Indeed, most MPD consumers don't care about the order of elements, but it should be fixed.

@emarsden emarsden added the enhancement New feature or request label Nov 23, 2024
@ypo
Copy link
Author

ypo commented Nov 25, 2024

This is correct, most players don't care.
However I'm using this project to manipulate and serialize MPDs, generated MPDs are passing through validators before going on production and they are rejected.
I'd be very happy if it can be fixed 👍

@emarsden
Copy link
Owner

emarsden commented Dec 2, 2024

There is some initial support for this in HEAD. I don't currently have fully satisfactory test support in place (in part because many manifests in the wild don't appear to be valid), so please report and remaining problems.

@ypo
Copy link
Author

ypo commented Dec 2, 2024

I moved to the HEAD and I confirm that the generated MDPs are now valid against the schema .
However I'm using only a very limited subset of DASH, but I'll report if I see a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants