- Change element
InbandEventStream
ofRepresentation
andAdaptationSet
nodes to aVec
instead of anOption
(incompatible change). - Fix spurious error regarding deletion of temporary file for audio/video segments when using keep_audio / keep_video in conjunction with fetch_audio / fetch_video.
- Downloading: show download bitrate for audio and video streams in verbose mode.
- Downloading: incompatible change to the
keep_audio
andkeep_video
attributes on DashDownloader, to allow the user to specify the path for the audio and video files. - Print information on the different media streams available (resolution, bitrate, codec) in a manifest when requested verbosity is non-zero.
- Update dependency quick-xml to v0.29 (thanks to @sdroege).
- Downloading: a connect error is handled as a permanent, rather than a transient, error. In particular, TLS certificate verification errors will no longer be treated as transient errors.
- Downloading: fix a bug in the handling of the
Location
element.
- Add definition for the
Preselection
element. - Add attributes
@byteRange
,@availabilityTimeOffset
and@availabilityTimeComplete
to BaseURL elements (pointed out by @ypo).
- Downloading: only download subtitles when
fetch_subtitles()
has been called on DashDownloader (from @sleepycatcoding). - Add derived PartialEq to data structures to allow for comparison.
- Parsing: certain MPDs including "overlapping" elements can now be parsed.
- Downloading: add support for saving media fragments to a user-specified directory, using new
function
save_fragments_to
onDashDownloader
. This may be useful to help debug issues with DASH streams or to extract additional information from fragmented MP4 segments. - Support for the DASH XML vocabulary associated with the SCTE-35 standard. This standard allows
dynamic insertion of alternate content (mostly used for advertising). Support is gated by the
new
scte35
feature, which is enabled by default. - Parsing of xs:datetime fields attempts to use the rfc3339 crate before falling back to the iso8601 crate if the datetime is not in RFC 3339 format (for example, if it doesn't include a timezone). The rfc3339 crate parses with nanosecond precision, whereas the iso8601 crate only has millisecond resolution.
- Downloading: fix an off-by-one error when calculating
$Number$ -based SegmentTemplate-based addressing (the initialization segment is now counted towards the total number of segments).
- Downloading: add preliminary support for throttling the network bandwidth, with method
with_rate_limit
on DashDownloader. - Add
@scanType
attribute to AdaptationSet nodes. - Add
@presentationDuration
to SegmentBase nodes. - Add
FailoverContent
element to SegmentBase nodes (from @sbuzzard).
- Serialization: default values for the XML namespaces for xlink, xsi, cenc, dvb and scte35 will be provided if they are not supplied explicitly. This should make it easier to generate standards-compliant manifests.
- Downloading: limit length of default output pathname (when using method
download
) to avoid exceeding filesystem limits.
- Downloading: add support for
MP4Box
as an external muxing tool. When built without libav support (the default configuration) and downloading to a path with ".mp4" extension, try to use theMP4Box
commandline application (from the GPAC suite) as a subprocess for muxing, if ffmpeg and VLC fail.MP4Box
is available for Linux and other Unixes, Microsoft Windows and MacOS. - New function
with_mp4box()
onDashDownloader
to allow the location of the MP4Box commandline application to be specified, if in a non-standard location. - New example
round_trip.rs
which can be used to check round trip from XML to Rust structs to XML. - Add
@startWithSAP
and@maximumSAPPeriod
attributes to AdaptationSet nodes. - Add
@timescale
attribute to SegmentList nodes. - Add
@numChannels
,@sampleRate
and@lang
attributes to Representation nodes. - Add
@sar
,@width
,@height
,@maximumSAPPeriod
and@startWithSAP
attributes to AdaptationSet nodes. - Add
EssentialProperty
andSupplementalProperty
node vectors to Representation and AdaptationSet nodes. - Add definition for
ProducerReferenceTime
nodes, used for low-latency streaming. - Add definition for
Switching
nodes, used for Adaptation Set switching. - Add definition for
InbandEventStream
nodes, used to signal presence of DASH event boxes in a media stream. - Add definition for
RepresentationIndex
nodes. - Add
@schemeIdUri
and@value
(deprecated) to Event nodes. - Add
scte214:ContentIdentifier
element to ProgramInformation nodes. - Add
@maxSubsegmentDuration
attribute to MPD nodes.
AdaptationSet.@id
changed from u64 to String type (breaking change).Period.@start
changed from a String to an xs:duration type (breaking change).ContentProtect.@cenc_pssh
changed from an Option to a Vec (breaking change).DashMpdError
enum made#[non_exhaustive]
(breaking change).- Fixed a bug in the parsing of xs:datetime attributes with fractional seconds.
- Fixed parsing of
@starttime
and@duration
attributes on Range elements. - Fixed XML namespace issues for attributes declared in the XLink, XMLSchema-instance, Common Encryption, DVB and SCTE-35 namespaces. These attributes should now be serialized correctly when generating an MPD.
- Add definition for
SubRepresentation
nodes. - Add definition for
Rating
nodes. - Add
@presentationTimeOffset
,@contentEncoding
and@messageData
attributes to Event nodes. The node content is available via thecontent
attribute. - Add
@availabilityTimeOffset
and@availabilityTimeComplete
to SegmentTemplate nodes (from @sbuzzard). - Add
@weight
attribute to BaseURL nodes. - Add
Role
,Rating
andViewpoint
content to ContentComponent and AdaptationSet nodes. - Add
Label
content to SubRepresentation and AdaptationSet nodes. - Add
SupplementalProperty
to Period nodes. - Add
@id
attribute to MPD nodes.
- Downloading: New option
max_error_count
on DashDownloader to specify the maximum number of non-transient network errors that should be ignored before a download is aborted. This is useful on some manifests using Time-based or Number-based SegmentLists for which the packager calculates a number of segments which is different to our calculation (in which case the last segment can generate an HTTP 404 error). - Serializing: the formatting of xs:duration attributes in generated XML has been improved to use nanosecond instead of millisecond precision, and to use minute and hour markers if relevant.
- Downloading: improve support for subtitles by making use of Representation.mimeType attributes
- New crate feature
native-tls
(enabled by default) which is passed through to thereqwest
crate. This change allows users to select between TLS support using the platform-native stack (native-tls
) and using therustls-tls
stack. - New crate feature
socks
(enabled by default) which is passed through to thereqwest
crate. It enables SOCKS5 proxy support for HTTP/HTTPS requests. - Add
@segmentProfiles
attributes to Representation and AdaptationSet nodes. - Add
@dependencyId
attribute to Representation nodes. - Add
@qualityRanking
attribute to Representation nodes. - Add
@indexRange
and@indexRangeExact
attributes to SegmentTemplate and SegmentList nodes. - Add definition for
Representation.FramePacking
nodes. - Add definition for
MPD.PatchLocation
nodes, that allow a DASH client to retrieve a patch from the server that contains a set of instructions for replacing certain parts of the MPD manifest with updated information. - Add definition (with correct capitalization) for
Metrics.Reporting
nodes.
- Downloading: use
Representation.qualityRanking
attribute, if present, to select representations according to user's quality preference. - Update dependency quick-xml to v0.28.
- Update dependency xattr to v1.0.
AudioChannelConfiguration
nodes in Representation and AdaptationSet changed from an Option to a Vec (they may be present multiple times).
- Add
EventStream
node to Period nodes (thanks to @noguxun). - Add
@maxPlayoutRate
,@profiles
and@codingDependency
attributes on Representation and AdaptationSet nodes. - New crate features
compression
,rustls-tls
andtrust-dns
to enable (pass through) the corresponding features on thereqwest
dependency. Otherwise, we use reqwest with its default feature set. Suggestion from @HoLLy.
- Fix download of media streams with
$Time
-basedSegmentTimeline
when initial@t
is non-zero. - Update dependency iso8601 to v0.6.
- The tokio crate is a dev-dependency rather than a full dependency (from @HoLLy).
- Downloading: switched to an asynchronous API. This will require code changes for clients.
Functions
download
anddownload_to
are nowasync
, and you will need to call them from an async context and use.await
(see the exampledownload_bbc.rs
for some sample code). If you are passing a reqwest client toDashDownloader
(usingwith_http_client
), you should now use a standardClient
built usingreqwest::Client::builder()
, instead of usingreqwest::blocking::Client::builder()
as previously (see the exampledownload_proxy.rs
for some sample code). Clients will need to add an explicit dependency on the tokio crate (which was already pulled in via the reqwest crate, but implicitly).
- Preliminary support for fetching subtitles (see function
fetch_subtitles
onDashDownloader
). There is support for subtitles in WebVTT format (an AdaptationSet node with a@mimeType
attribute of "text/vtt"), TTML (@mimeType
of "application/ttml+xml") and SAMI (@mimeType
of "application/x-sami"). There is also some support for WVTT (binary WebVTT in a wvtt box in fragmented MP4 container, as specified by ISO/IEC 14496-30:2014) and for STPP format (TTML in a fragmented MP4 container). WVTT subtitles will be converted to SRT format using the MP4Box commandline application, if it is available in the PATH.
- Update dependency quick-xml to v0.27
- Simplify serialization example using new version of the quick-xml crate.
- Fix: xs:datetime fields such as
MPD@publishTime
andMPD@availabilityStartTime
without a timezone are now parsed correctly instead of triggering an error. Issue seen with YouTube DASH manifests, reported by @erg43hergeg.
- Downloading: implement support for
SegmentURL@mediaRange
andInitialization@range
using HTTP byte range requests. This allows us to download crazy DASH manifests that misuse Twitter's CDN by prepending dummy PNG headers to media segments (https://twitter.com/David3141593/status/1587978423120666625). - Fixed default value for
SegmentTemplate@startNumber
when downloading (1 instead of 0). - Fix: an AdaptationSet may contain a SegmentList.
- We now check that the HTTP content-type of downloaded segments corresponds to audio or video content.
New function
without_content_type_checks
onDashDownloader
to disable these checks (may be necessary with poorly configured HTTP servers). - Added functions
keep_video
andkeep_audio
onDashDownloader
to retain video and audio streams on disk after muxing. - Added attribute
Representation@mediaStreamStructureId
. - Added attribute
SegmentTemplate@eptDelta
.
- Support for data URLs in initialization segments (per RFC 2397).
- API change: rationalize struct field types: fields that were of type Option<Vec<>> (such as MPD.Periods and Period.Representations) become Vec<> in the serialized representation. If none present, the vector is empty. This simplifies iteration over their contents. Some items such as BaseURL that can appear multiple times changed to Vec<> instead of Option<>.
- Add missing
Event@presentationTime
attribute. - Add missing
AdaptationSet > Label
node type. - Add missing
AdaptationSet@selectionPriority
attribute.
- Serialization support to allow programmatic generation of an MPD manifest (in XML format) from Rust
structs. See
examples/serialize.rs
for some example code.
- New functions
with_vlc()
andwith_mkvmerge()
onDashDownloader
to allow the location of VLC and mkvmerge applications to be specified, if in a non-standard location. Aligns with the existing functionality to specify the location of the ffmpeg binary.
- The default path for the external muxing applications now depends on the platform (for instance "ffmpeg.exe" on Windows and "ffmpeg" elsewhere).
- The
download_to()
function returns the path that the media was downloaded to, instead of()
.
- API change: reworked the error handling using an error enumeration DashMpdError and the
thiserror
crate, instead of theanyhow
crate. This allows clients of the library to handle errors depending on their type (I/O, network, parsing, muxing, etc.). - Update required version of chrono crate to resolve security vulnerability RUSTSEC-2020-0159.
- Download support is conditional on the
fetch
crate feature being enabled (which is the default configuration). Disabling it reduces code size and the number of dependencies pulled in.
- Downloading: add support for
mkvmerge
as an external muxing tool. When built without libav support (the default configuration) and downloading to a path with ".mkv" extension, try to usemkvmerge
(from the MkvToolnix suite) as a subprocess for muxing, before falling back toffmpeg
.mkvmerge
will generate files in a Matroska container, which allows more codec flexibility than MPEG-4.mkvmerge
is available for Linux and other Unixes, Microsoft Windows and MacOS. - Add support for manifests containing a
Location
node. This allows the server to specify a new URL from which the client should request an updated manifest (similar to an HTTP redirect). - Change type of some attributes specified to be of type
xs:dateTime
to anXsDatetime
instead of an unserialized String, using serde support in the chrono crate (@publishTime, @availabilityStartTime, @availabilityEndTime). - Change type of some attributes specified to be of type
xs:duration
to aDuration
instead of an unserialized String (@minBufferTime, @minimumUpdatePeriod, @timeShiftBufferDepth, @mediaPresentationDuration, @suggestedPresentationDelay).
- Downloading: functions
audio_only
andvideo_only
on DashDownloader allow the user to fetch only the audio stream, or only the video stream (for streams in which audio and video content are available separately). - Downloading: function
prefer_language
on DashDownloader allows the user to specify the preferred language when multiple audio streams with different languages are available. The argument must be in RFC 5646 format (eg. "fr" or "en-AU"). If a preference is not specified and multiple audio streams are present, the first one listed in the DASH manifest will be downloaded.
- Downloading: support for sleeping between network requests, a primitive mechanism for throttling
network bandwidth consumption (function
sleep_between_requests
on DashDownloader).
- Fixes to allow download of DASH streams with SegmentList addressing where the
SegmentURL
nodes useBaseURL
instead of@media
paths (eg. http://download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-single/mp4-main-single-mpd-AV-BS.mpd) - Downloading: muxing using VLC should now work correctly.
- Downloading: improve handling of transient and permanent HTTP errors.
- An
AdaptationSet
node may contain multipleContentComponent
nodes. - Optional fields
frameRate
andsar
added toRepresentation
nodes. - Implement our own parser for ISO 8601 durations to avoid bugs in the iso8601 crate. This fixes download support for several video publishers (content previously handled as if it had zero length, due to this parsing bug).
- Optional
SegmentTemplate@duration
field changed from u64 to f64 type. It is specified to be an unsigned int, but some manifests in the wild use a floating point value (eg. https://dash.akamaized.net/akamai/bbb_30fps/bbb_with_multiple_tiled_thumbnails.mpd).
- Function
with_ffmpeg
on DashDownloader allows the user to specify the location of the ffmpeg binary to use for muxing (useful if it's not in the PATH). - Optional field
ContentProtection
added to theAdaptationSet
node type. - Add optional field
cenc_pssh
toContentProtection
nodes.
- Function
add_progress_observer
on DashDownloader provides support for implementing progress bar, using the observer pattern. - Function
verbosity
on DashDownloader provides support for setting the level of verbose messages concerning the progression of the download. - Function
record_metainformation
controls whether metainformation such as the origin URL are recorded in the output file as extended attributes.
- fetch_mpd() function now takes only a single DashDownloader argument.
- Downloading: move to a builder pattern with DashDownloader API. The function
fetch_mpd
should now be considered internal. - Downloading: preference for quality/bitrate can be specified.
- Downloading: fix use of SegmentTemplate
@startNumber
attribute. - Downloading: fix regression concerning streams that use a SegmentTimeline.
- Path fixes to allow tests and examples to run on Windows.
- Downloading: support multi-period MPD manifests.
- Downloading: support remote resources using XLink (
xlink:href
attributes). - The
id
andbandwidth
attributes of aRepresentation
node are now optional (for XLink support).
- Downloading: fix handling of manifests with negative
@r
attribute onS
nodes. - Downloading: fix handling of manifests with segment templates that use
$Bandwidth$
.
- Add support for using ffmpeg or vlc as a subprocess for muxing, rather than ffmpeg's libav library. This is more robust on certain invalid media streams and may be easier to build on certain platforms. Support is gated by the "libav" feature.
- When using libav (ffmpeg as a library), errors and informational messages from ffmpeg will be logged at info level.
- The
serviceLocation
attribute onBaseURL
nodes is now public. - The
media
attribute onSegmentTemplate
nodes is now an optional field (it was previously a required field). - The
actuate
(xlink:actuate) attribute onPeriod
nodes is now of typeOption<String>
(previouslyOption<bool>
). - On platforms that support extended filesystem attributes, write the origin MPD URL to attribute
user.xdg.origin.url
on the output media file, using thexattr
crate, unless the URL contains sensitive information such as a password. Likewise, write any MPD.ProgramInformation.{Title, Source, Copyright} information from the MPD manifest to attributes user.dublincore.{title, source, rights}. - Downloading: improve handling of transient HTTP errors.
- Downloading: improve support for certain stream types.
- Initial release.