MPEG-DASH MPD(Media Presentation Description) Parser
Project description
python-mpegdash
MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 2.6+ and Python 3.
Installation
$ pip install mpegdash
Test
$ python -m unittest discover
$ python3 -m unittest discover
Usage
from mpegdash.parser import MPEGDASHParser
# Parse from file path
mpd_path = './tests/mpd-samples/sample-001.mpd'
mpd = MPEGDASHParser.parse(mpd_path)
# Parse from url
mpd_url = 'http://yt-dash-mse-test.commondatastorage.googleapis.com/media/motion-20120802-manifest.mpd'
mpd = MPEGDASHParser.parse(mpd_url)
# Parse from string
mpd_string = '''
<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" mediaPresentationDuration="PT0H1M52.43S" minBufferTime="PT1.5S"
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static">
<Period duration="PT0H1M52.43S" start="PT0S">
<AdaptationSet>
<ContentComponent contentType="video" id="1" />
<Representation bandwidth="4190760" codecs="avc1.640028" height="1080" id="1" mimeType="video/mp4" width="1920">
<BaseURL>motion-20120802-89.mp4</BaseURL>
<SegmentBase indexRange="674-981">
<Initialization range="0-673" />
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
'''
mpd = MPEGDASHParser.parse(mpd_string)
# Write to xml file
MPEGDASHParser.write(mpd, './tests/mpd-samples/output.mpd')
License
This project is released under the MIT license. Please read and agree to the license before use, it can be found in the LICENSE file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mpegdash-0.3.1.tar.gz
(11.3 kB
view details)
Built Distribution
mpegdash-0.3.1-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file mpegdash-0.3.1.tar.gz
.
File metadata
- Download URL: mpegdash-0.3.1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f314a6e465f1f00fdf775918ff871971fe54daba9c6d0bfb5c145b69b716a24 |
|
MD5 | 0c74a908536264a28380ec8a56267b89 |
|
BLAKE2b-256 | 0befda88735b0284b3dd0125ddb67048a7dfa54005da9e61afdc62b664e7571c |
File details
Details for the file mpegdash-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: mpegdash-0.3.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abefe682f5db4528b930013d3dd12f6a108e145cffb6333de464df73f4707a69 |
|
MD5 | b24bd3473e28e57bd69c995c0f4f09e7 |
|
BLAKE2b-256 | 1d3bd671a1a51d3fa6e46931cc0eca614107ec98d1775c9042b8b182d86b3189 |