Skip to main content

Python library for converting DASH manifest files to HLS format.

Project description

PyDash2HLS

License Release Latest Version

PyDash2HLS is a Python library for converting DASH (Dynamic Adaptive Streaming over HTTP) manifest files to HLS (HTTP Live Streaming) format.

Features

  • Convert MPD files to HLS format.
  • Support for remote and local MPD files.
  • Retrieve media URLs for a specific profile.
  • Handle DRM (Digital Rights Management) information in MPD files.

Installation

You can install PyDash2HLS using pip:

pip install pydash2hls

Usage

Converter Initialization

To initialize the Converter class, you can use the following methods:

Initialization from a Remote URL

from pydash2hls import Converter

# Initialize Converter from a remote URL
url = "http://example.com/manifest.mpd"
converter = Converter.from_remote(url)

Initialization from a Local File

from pydash2hls import Converter
from pathlib import Path

# Initialize Converter from a local file
file_path = Path("path/to/manifest.mpd")
converter = Converter.from_local(file_path)

Building HLS Manifest

To build an HLS manifest for a specific profile, you can use the build_hls() method:

# Build HLS manifest for a profile
profile_id = "profile1"
hls_manifest = converter.build_hls(profile_id)

Getting Media URLs

To retrieve a list of media URLs for a specific profile, you can use the media_urls() method:

# Get media URLs for a profile
profile_id = "profile1"
media_urls = converter.media_urls(profile_id)

Exceptions

The following exceptions can be raised by PyDash2HLS:

  • InvalidPath: Raised when the file path is invalid.
  • InvalidFileContent: Raised when the contents of the file are not in DASH format or are incompatible.
  • InvalidProfile: Raised when the selected profile is invalid.
  • MissingRemoteUrl: Raised when a remote file URL is required but not provided.

License

This project is licensed under the GPL v3 License.

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

pydash2hls-2.1.4.tar.gz (18.2 kB view details)

Uploaded Source

File details

Details for the file pydash2hls-2.1.4.tar.gz.

File metadata

  • Download URL: pydash2hls-2.1.4.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for pydash2hls-2.1.4.tar.gz
Algorithm Hash digest
SHA256 6ad766e3eb7aab125caf57f201b7e9116e202a7538a33dbe98d567f064f84c3a
MD5 7d117e6b68de9984b464977dc19912b2
BLAKE2b-256 a45530d09fd58a5e689d33216f2e7df9c6c4f44216f6e9441a5082bf0e901f63

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