Crate dash_mpd[−][src]
Expand description
A Rust library for parsing and downloading media content from a DASH MPD manifest, as used for on-demand replay of TV content and video streaming services.
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).
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 ffmpeg or VLC (this includes 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
Structs
Specifies the accessibility scheme used by the media content.
Contains a set of Representations. For example, if multiple language streams are available for the audio content, each one can be in its own AdaptationSet.
Specifies information concerning the audio channel (eg. stereo, multichannel).
A URI string that specifies one or more common locations for Segments and other resources.
Describes a media content component.
Contains information on DRM (rights management / encryption) mechanisms used in the stream, such as Widevine and Playready. Note that this library is not able to download content with DRM. If this node is not present, no content protection is applied.
Copyright information concerning the media stream.
A DASH event.
The first media segment in a sequence of Segments. Subsequent segments can be concatenated to this segment to produce a media stream.
The root node of a parsed DASH MPD manifest.
Describes a chunk of the content with a start time and a duration. Content can be split up into multiple periods (such as chapters, advertising segments).
Metainformation concerning the media stream (title, language, etc.)
A representation describes a version of the content, using a specific encoding and bitrate. Streams often have multiple representations with different bitrates, to allow the client to select that most suitable to its network conditions.
The purpose of this media stream, such as captions, subtitle, main, alternate, supplementary, commentary, and dub.
Describes a sequence of contiguous Segments with identical duration.
Specifies some common information concerning media segments.
Contains a sequence of SegmentURL elements.
Allows template-based SegmentURL
construction. Specifies various substitution rules using
dynamic values such as $Time$
and $Number$
that map to a sequence of Segments.
Contains a sequence of S
elements, each of which describes a sequence of contiguous segments of
identical duration.
The URL of a media segment.
The original source of the media stream.
The title of the media stream.
Functions
Download the media stream content from a DASH MPD manifest.
Returns true
if this AdaptationSet contains audio content.
Returns true
if this AdaptationSet contains video content.
Parse an MPD manifest, provided as an XML string, returning an MPD
node.
Type Definitions
A blocking Client
from the reqwest
crate, that we use to download content over HTTP.