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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpd_inspector-0.8.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpd_inspector-0.8.1.tar.gz
Algorithm Hash digest
SHA256 f20929000598f12b1724d6f235da0dbf0b74e8040eecb0049ff4c503d076b85b
MD5 09db6c852c74456c14b6c0fc205dd6f3
BLAKE2b-256 3cb4b8cbd1569309efaa464ccd686ebb5eff1b3d768356c89acf733319fad907

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mpd_inspector-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.7 Darwin/24.2.0

File hashes

Hashes for mpd_inspector-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2e04341b0f2b6db031ec5dad5d5a9237105efe5d5942295d9f83dbc2a73a8bf
MD5 203774db9a4267e8e3fefc9b9bfcda72
BLAKE2b-256 f34cc243391b2e79f8b38be7ecb9c33c54ddf4321a408f0da7502661e3be79b7

See more details on using hashes here.

Supported by

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