Skip to main content

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:

  1. I needed to change the behaviour to be closer to the MPEG-DASH spec, in particular DASH-IF IOP rules.
  2. I wanted to parse all MPD attributes into native Python types (including for datetimes and durations)
  3. I wanted to be able to expose unparsed elements
  4. 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.4.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

mpd_inspector-0.4.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file mpd_inspector-0.4.0.tar.gz.

File metadata

  • Download URL: mpd_inspector-0.4.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/23.3.0

File hashes

Hashes for mpd_inspector-0.4.0.tar.gz
Algorithm Hash digest
SHA256 06331e03607f62fe1d9e88e74d4617dd0ec531f0d8fce14138a869e6b4df03d9
MD5 d7e0cbbb345d5c25ba21a94dce3a1bf8
BLAKE2b-256 fa453ed1032aa45cd49dbe57fd7fdca005ca65c993c70ae6e214aa4bc8c9802c

See more details on using hashes here.

Provenance

File details

Details for the file mpd_inspector-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mpd_inspector-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 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

Hashes for mpd_inspector-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31867d0e66584b36f9a0fd63baf77a9f4874fff5676aba71da817165bd35228c
MD5 fb32b216d6f6848f17a40e402c54aef5
BLAKE2b-256 d66f82855ade053dc8a98a0c30caa140712a6e841d8b33e01c716cfb058e5c63

See more details on using hashes here.

Provenance

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