Comments (3)
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.
@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.
@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)
- upload to python package index HOT 5
- Python 3 Compatibility HOT 4
- parse_child_nodes bug for str node_type HOT 5
- Non-text Event child nodes not supported HOT 1
- ProgramInformation writing throws exception HOT 1
- xs:boolean types are not cased correctly when written
- MPEGDASHParser write to file throws error HOT 1
- New version for PyPi? HOT 1
- Support label non-standard dash attribute
- Respect AdaptationSet selectionPriority HOT 1
- AdaptationSet should have the "profiles" attribute
- About viedo mpd HOT 3
- Wrong type of SubRepresentation.content_component HOT 3
- ContentProtection's most likely don't use `@value`, e.g. `@cenc:pssh` HOT 4
- ContentProtection's key_id can be more than ns2:default_KID HOT 1
- Enable CI
- Applying the latest MPD schema
- Add typing HOT 1
- Decode signal SCTE-35 <binary> strings with threefive HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-mpegdash.