A module to parse, analyze and validate MPEG-DASH MPD
Project description
mpd-inspector
Overview
This is a module to parse MPEG-DASH Media Presentation Documents (aka. MPD) from files or URLs, and interpret them This package is built as a fork from the excellent mpd-parser. The main reasons for forking it are:
- I needed to change the behaviour to be closer to the MPEG-DASH spec, in particular DASH-IF IOP rules.
- I wanted to parse all MPD attributes into native Python types (including for datetimes and durations)
- I wanted to be able to expose unparsed elements
- I wanted to add a layer of inspection/analysis to make it possible to calculate implicit/derived values (eg. start and duration of periods in multi-period MPD) - in particular again for validation against the DASH-IF Interoperability guidance
Installation
$ python -m pip install mpd-inspector
Usage
Importing
from mpd_parser.parser import Parser
parse from string
with open("path/to/file.mpd", mode="r") as manifest_file:
mpd_string = manifest_file.read()
parsed_mpd = Parser.from_string(mpd_string)
parse from file
input_file = "path/to/file.mpd"
mpd = Parser.from_file(input_file)
parse from url
input_url = "https://my-server.com/path/to/stream.mpd"
mpd = Parser.from_url(input_url)
inspect it
mpd_inspector = MPDInspector(mpd)
convert back to string
mpd_as_xml_string = Parser.to_string(parsed_mpd)
Example manifests
Taken from a variety of places
Build locally
poetry build
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
mpd_inspector-0.5.0.tar.gz
(14.2 kB
view details)
Built Distribution
File details
Details for the file mpd_inspector-0.5.0.tar.gz
.
File metadata
- Download URL: mpd_inspector-0.5.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4c8008e37b037500493f6e4191dac9e7b0d579a1d852766cb68f2dd42bcf435 |
|
MD5 | ea2fff0c4bd4ee4ee12e9739b80ebddd |
|
BLAKE2b-256 | 56191bbcbe4b7157d05d6721c41d43e26b17a0b70a77fb6b20706cd5295daa06 |
Provenance
File details
Details for the file mpd_inspector-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: mpd_inspector-0.5.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59e1606dbe70fdbafb8f35113e3341a99a6d05c6bf2bedc4a32d04aed4e61402 |
|
MD5 | 1e216a62ff70abd1c3d5caaeb81f5f14 |
|
BLAKE2b-256 | a4a8d666fc86980aff5e16c5d067ad786464e8c9f20d66fc40be7e5d799b24b9 |