Skip to main content

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.

Build Status License


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.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

mpegdash-0.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file mpegdash-0.3.0.tar.gz.

File metadata

  • Download URL: mpegdash-0.3.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for mpegdash-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bfe40464a60994efac00d20feb8fc1be76f4949406161ece4376ebd348e5e34e
MD5 18952dace87d3729efa1dc86a3a134b8
BLAKE2b-256 7fb8950bdfeb04fe01b2832e60b94f8482e564e5c2c2b10cd5c6e5789ee04bc1

See more details on using hashes here.

File details

Details for the file mpegdash-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mpegdash-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for mpegdash-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 470df6365ca6ad384b286c630807de8f45ca8a7519020e69fb51b6da684b4fcb
MD5 d451c33933ad33c3dbada3df0aa9ae48
BLAKE2b-256 953395da2d7f2c24e14126e229b83e167771aa12081d845cdd8f80d08bd54e55

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page