Expand description
A Rust library for parsing, serializing and downloading media content from a DASH MPD manifest, as used for on-demand replay of TV content and video streaming services. Allows both parsing of a DASH manifest (XML format) to Rust structs (deserialization) and programmatic generation of an MPD manifest (serialization). The library also allows you to download media content from a streaming server. 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 (deserializer) and serializer 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).
DASH features supported
- VOD (static) stream manifests
- Multi-period content
- XLink elements (only with actuate=onLoad semantics, resolve-to-zero supported)
- All forms of segment index info: SegmentBase@indexRange, SegmentTimeline, SegmentTemplate@duration, SegmentTemplate@index, SegmentList
- Media containers of types supported by mkvmerge, ffmpeg or VLC (this includes Matroska, ISO-BMFF / CMAF / MP4, WebM, MPEG-2 TS)
Limitations / unsupported features
- Dynamic MPD manifests, that are used for live streaming/OTT TV
- Encrypted content using DRM such as Encrypted Media Extensions (EME) and Media Source Extension (MSE)
- Subtitles (eg. WebVTT and TTML streams)
- XLink with actuate=onRequest
Modules
Structs
SegmentURL
construction. Specifies various substitution rules using
dynamic values such as $Time$
and $Number$
that map to a sequence of Segments.S
elements, each of which describes a sequence of contiguous segments of
identical duration.Enums
Functions
true
if this AdaptationSet contains audio content.true
if this AdaptationSet contains subtitle content.true
if this AdaptationSet contains video content.MPD
node.