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

Parsing error for representations without segment info #164

Open
nhasselmeyer opened this issue Sep 19, 2022 · 0 comments
Open

Parsing error for representations without segment info #164

nhasselmeyer opened this issue Sep 19, 2022 · 0 comments

Comments

@nhasselmeyer
Copy link

The following file fails to parse:

<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" type="static" minBufferTime="PT30S" profiles="urn:mpeg:dash:profile:isoff-main:2011" mediaPresentationDuration="PT1M4.800S">
  <Period start="PT0S" duration="PT1M4.800S" id="1">
    <AdaptationSet mimeType="video/webm" frameRate="30/1" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1" subsegmentStartsWithSAP="1" bitstreamSwitching="false">
      <Representation id="1" width="1920" height="1080" bandwidth="1800000" codecs="vp9">
        <BaseURL>864_vp9.webm</BaseURL>
      </Representation>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" lang="eng" segmentAlignment="0">
      <Representation id="2" bandwidth="96000" audioSamplingRate="48000" codecs="mp4a.40.2">
        <BaseURL>864_aac.mp4</BaseURL>
        <SegmentBase indexRange="658-961">
          <Initialization range="0-657"/>
        </SegmentBase>
      </Representation>
    </AdaptationSet>
  </Period>
</MPD>

The problem seems to be in

const segmentsInfo = {
attributes
};
if (!segmentsFn) {
return segmentsInfo;
}

For the first representation, there are no elements with any segment information, so segmentsFn is not set. The toM3u8 function requires segmentsInfo.segments to be a list, leading to a error that is hard to debug (trying to call undefined.reduce())

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

No branches or pull requests

1 participant