dash-mpd
A Rust library for parsing and downloading media content from a DASH MPD file, as used by video services such as on-demand replay of TV content and video streaming services like YouTube.
DASH (dynamic adaptive streaming over HTTP), also called MPEG-DASH, is a technology used for media streaming over the web, commonly used for video on demand (VOD) services. The Media Presentation Description (MPD) is a description of the resources (manifest or “playlist”) forming a streaming service, that a DASH client uses to determine which assets to request in order to perform adaptive streaming of the content. DASH MPD manifests can be used both with content encoded as MPEG and as WebM.
This library provides a serde-based parser for the DASH MPD format, as formally defined in ISO/IEC standard 23009-1:2019. XML schema files are available for no cost from ISO. When MPD files in practical use diverge from the formal standard, this library prefers to interoperate with existing practice.
The library also provides experimental support for downloading content (audio or video) described by
an MPD manifest. This involves selecting the alternative with the most appropriate encoding (in
terms of bitrate, codec, etc.), fetching segments of the content using HTTP or HTTPS requests (this
functionality depends on the reqwest
crate) and muxing audio and video segments together (using
ffmpeg via the ac_ffmpeg
crate).
This crate does not support content encrypted with DRM such as Encrypted Media Extensions (EME) and Media Source Extension (MSE). It currently does not provide download support for dynamic MPD manifests, that are used for live streaming. It currently only provides support for downloading audio and video streams, and not subtitles (eg. WebVTT streams).
Usage
use Duration;
use ;
The experimental support for downloading content from an MPD manifest:
use Duration;
use fetch_mpd;
Installation
Add to your Cargo.toml
file:
[]
= "0.1"
License
This project is licensed under the MIT license. For more information, see the LICENSE-MIT
file.