Given a MPEG DASH .mpd URL, is that possible to down all media segments through youtube_dl?
Asked Answered
E

1

26

I'm looking for a MPEG DASH downloader and youtube_dl just hit on me.

Given a .mpd URL, is that possible to use youtube_dl to download all media segments then?

Expressive answered 6/8, 2015 at 3:52 Comment(0)
W
46

To download all video and audio segments and mux them into a single file, call youtube-dl thus:

youtube-dl -f bestvideo+bestaudio http://URL/TO/manifest.mpd

The option -f <id1>[,<id2>]... is used to select which stream (or streams) of segments to save. The -f bestvideo+bestaudio in this example makes youtube-dl save only the best video and audio streams. See format selection syntax for details and more advanced format selectors. In order to discover the available streams, use youtube-dl -F http://URL/TO/manifest.mpd.

In order to mux (merge) video and audio streams into a single file, you must have FFmpeg or libav installed in your system. Otherwise, youtube-dl will produce a separate file for each stream (in my example, one for audio and one for video).

Without explicit format selection, the default is -f bestvideo+bestaudio/best. Youtube-dl will automatically select the best video and audio, and if there are no separate video-only or audio-only streams, the best stream that contains both video and audio is selected.

youtube-dl http://URL/TO/manifest.mpd

This default is used since version 2015.04.26. Before that (or if -o - is specified, making youtube-dl write output to stdout), the default was -f best, ignoring the video-only and audio-only streams. You may want to specify -f best explicitly when separate video and audio have worse quality than a stream that has both.

Wintergreen answered 8/10, 2016 at 11:16 Comment(4)
In my case, only manually specifying the bestvideo+bestaudio switch resulted in actually downloading the video.Parament
I added more details on the default format selector. Which version of youtube-dl did you use, @JeroenBaert?Villainage
@Villainage : I don't remember, but it's fixed in the latest version now :)Parament
Is it possible to specify a local .mpd file?Hindenburg

© 2022 - 2024 — McMap. All rights reserved.