Coder Social home page Coder Social logo

Comments (3)

mpegdash-user avatar mpegdash-user commented on September 27, 2024 1

Here is an example .mpd file (multi_subs.mpd) from the git-hub Dash Industry Forum .

I believe the issue here is that the file is marked as utf-8 encoded. @athensofamerica provided a fine set of patches that enable the library to work on utf-8 encoded .xml files.

<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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,urn:com:dashif:dash264" maxSegmentDuration="PT2S" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT1H">
   <ProgramInformation>
      <Title>Media Presentation Description by MobiTV. Powered by MDL Team@Sweden.</Title>
   </ProgramInformation>
   <Period id="precambrian" start="PT0S">
      <AdaptationSet contentType="audio" mimeType="audio/mp4" lang="eng" segmentAlignment="true" startWithSAP="1">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="A48" codecs="mp4a.40.2" bandwidth="48000" audioSamplingRate="48000">
            <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
         </Representation>
      </AdaptationSet>
      <AdaptationSet contentType="video" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" par="16:9" minWidth="640" maxWidth="640" minHeight="360" maxHeight="360" maxFrameRate="60/2">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="V300" codecs="avc1.64001e" bandwidth="300000" width="640" height="360" frameRate="30" sar="1:1"/>
      </AdaptationSet>
      <AdaptationSet contentType="text" mimeType="application/mp4" segmentAlignment="true" lang="eng">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="sub_eng" codecs="stpp" startWithSAP="1" bandwidth="5367"/>
      </AdaptationSet>
      <AdaptationSet contentType="text" mimeType="application/mp4" segmentAlignment="true" lang="eng">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="caption"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="sub_eng_cap" codecs="stpp" startWithSAP="1" bandwidth="5367"/>
      </AdaptationSet>
      <AdaptationSet contentType="text" mimeType="application/mp4" segmentAlignment="true" lang="swe">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="sub_swe" codecs="stpp" startWithSAP="1" bandwidth="5367"/>
      </AdaptationSet>
      <AdaptationSet contentType="text" mimeType="application/mp4" segmentAlignment="true" lang="qbb">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="sub_ttml_qbb" codecs="stpp" startWithSAP="1" bandwidth="5367"/>
      </AdaptationSet>
      <AdaptationSet contentType="text" mimeType="application/mp4" segmentAlignment="true" lang="nor">
         <Role schemeIdUri="urn:mpeg:dash:role:2011" value="subtitle"/>
         <SegmentTemplate startNumber="1" initialization="$RepresentationID$/init.mp4" duration="2" media="$RepresentationID$/$Number$.m4s"/>
         <Representation id="sub_nor" codecs="stpp" startWithSAP="1" bandwidth="5367"/>
      </AdaptationSet>
   </Period>
</MPD>

from python-mpegdash.

sangwonl avatar sangwonl commented on September 27, 2024

@athensofamerica Thanks also. Regarding the issue, it could be a corner case. Can you help me reproduce the problem? Any test code you've faced the issue would be helpful.

from python-mpegdash.

sangwonl avatar sangwonl commented on September 27, 2024

@athensofamerica Hello, it was a long time. Today, I was trying to reproduce the issue again, but wasn't. The MPD sample from @mpegdash-user also works fine with parsing and saving. Can you give a valid MPD sample that causes #n.write(new_elem) #This doesn't work for str type. exception throws?

from python-mpegdash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.