Open misuzu opened 7 years ago
type="dynamic"
m4s are supported. The real cause is that live DASH streams are not supported yet. Would you like to share where you got this mpd link?
UPDATE: Sorry I didn't see there are already some examples in the original post.
as a work around, you can use the m3u8 url: http://tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/playlist.m3u8
+1 This would be very nice!
Any plans to implement this soon?
Supporting this requires lots of changes. I don't think it can be done in a short time. See #9109 for the first step.
Third party solutions like mp4client of gpac can be used as of now.
Thanks for the suggestion!
Long time w/o trying it, but I think https://github.com/streamlink/streamlink also support YT Live streams. Check -o examples for recording the stream.
Apparently DASH isn't supported on streamlink as well. I'm able to watch Youtube livestream atm using mpv + youtube-dl, however it's capped @30fps. I've tried using MP4Client + youtube-dl but it doesn't seem to work (though I'm not sure if I'm using this correctly):
$ MP4Client $(youtube-dl -g 'https://www.youtube.com/watch?v=ekpfeh7IuRA') 3.88 16:28:58
Using config file in /home/gui/.gpac directory
System info: 7927 MB RAM - 4 cores
Modules Found : 35
Loading GPAC Terminal
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xc9dbe700
[Thread MediaManager] Couldn't set priority(2) for thread ID 0xc9dbe700
Terminal Loaded in 104 ms
Opening URL https://manifest.googlevideo.com/api/manifest/hls_playlist/id/ekpfeh7IuRA.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r3---sn-b8u-nvqe.googlevideo.com/ei/gSnyWZbmNs-qwQSA1IzgBg/gcr/br/playlist_type/DVR/mm/32/mn/sn-b8u-nvqe/ms/lv/mv/m/pl/22/dover/6/mt/1509042450/ip/179.179.144.242/ipbits/0/expire/1509064161/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,ei,gcr,playlist_type,mm,mn,ms,mv,pl/signature/42C62F384A5B5A36F7FF8F2BC8108ED038161B5E.880D272559DC2D05BA22812D1A25367BE09C0C00/key/dg_yt0/playlist/index.m3u8
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=28.679000,ID="1509041205005385-AD-START",START-DATE="2017-10-26T18:06:45.005+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=1.321000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=25.736000,ID="1509041285000385-AD-START",START-DATE="2017-10-26T18:08:05.000+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=4.264000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=25.773000,ID="1509041505004385-AD-START",START-DATE="2017-10-26T18:11:45.004+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=4.227000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-DATERANGE:CLASS="CUEPOINT-AD",DURATION=29.022000,ID="1509041790005385-AD-START",START-DATE="2017-10-26T18:16:30.005+00:00",X-YTCP-EVENT="START",X-YTCP-OFFSET=0.978000,X-YTCP-TYPE="AD"
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=1.321000,TYPE=AD
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=4.264000,TYPE=AD
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=4.227000,TYPE=AD
[M3U8] Unknown line in M3U8 file #EXT-X-CUEPOINT:DURATION=30.000000,EVENT=START,TIME_OFFSET=0.978000,TYPE=AD
[DASH] Error - cannot connect service: MPD creation problem Bad Parameter
[MPD_IN] Error - cannot initialize DASH Client for https://manifest.googlevideo.com/api/manifest/hls_playlist/id/ekpfeh7IuRA.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r3---sn-b8u-nvqe.googlevideo.com/ei/gSnyWZbmNs-qwQSA1IzgBg/gcr/br/playlist_type/DVR/mm/32/mn/sn-b8u-nvqe/ms/lv/mv/m/pl/22/dover/6/mt/1509042450/ip/179.179.144.242/ipbits/0/expire/1509064161/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,ei,gcr,playlist_type,mm,mn,ms,mv,pl/signature/42C62F384A5B5A36F7FF8F2BC8108ED038161B5E.880D272559DC2D05BA22812D1A25367BE09C0C00/key/dg_yt0/playlist/index.m3u8: Bad Parameter
Cannot open https://manifest.googlevideo.com/api/manifest/hls_playlist/id/ekpfeh7IuRA.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/cmbypass/yes/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/r3---sn-b8u-nvqe.googlevideo.com/ei/gSnyWZbmNs-qwQSA1IzgBg/gcr/br/playlist_type/DVR/mm/32/mn/sn-b8u-nvqe/ms/lv/mv/m/pl/22/dover/6/mt/1509042450/ip/179.179.144.242/ipbits/0/expire/1509064161/sparams/ip,ipbits,expire,id,itag,source,requiressl,ratebypass,live,cmbypass,goi,sgoap,sgovp,hls_chunk_host,ei,gcr,playlist_type,mm,mn,ms,mv,pl/signature/42C62F384A5B5A36F7FF8F2BC8108ED038161B5E.880D272559DC2D05BA22812D1A25367BE09C0C00/key/dg_yt0/playlist/index.m3u8: Bad Parameter
Audio and Video need to be downloaded together, most likely by somehow using 2 fragment contexts within DashSegementsFD (FragmentsFD would likely have to be changed as well for this to work), but first, DashSegmentsFD needs to be fed both at the same time.
Other than that, it's possible to hack around the other issues (not exactly pretty, but it works).
About stream.mpd, here is one example: https://vidalytics.com/video/0TdguiZ2jRVjKEXR
This player is used on some websites and requests a stream.mpd.
Currently, if I use the request url, ytdl can download but it results in separated video and audio streams. I have to do an extra step to merge them in one container (mkv). Could ytdl auto merge streams at the end of downloading ?
If I rename the URL replacing .mpd by .m3u8, it works if ffmpeg is installed. It would be nice we wouldn’t have to do this extra renaming step and ytdl did automatically.
@freMea wrote:
if I use the request url, ytdl can download but it results in separated video and audio streams. I have to do an extra step to merge them in one container (mkv). Could ytdl auto merge streams at the end of downloading ?
First of all, your referenced MPEG-DASH manifest (MPD):
https://quick.vidalytics.com/video/5SwBVaqN/0TdguiZ2jRVjKEXR/9060/4595/stream.mpd
is a static (VOD), NOT a dynamic one (i.e. Live stream), which is the subject of this issue 😠 ; so, it's totally out of context here... 👎
If you -F
your MPD, you'll see it does contain separate streams for audio and video content (most MPDs usually do!), so it's no surprise yt-dl
fetches two separate standalone streams...
And in these cases, yt-dl
of course can merge (mux) them into an appropriate container, provided it already knows where to look for an FFmpeg binary!
Your MPD is kinda special in that it offers three different video codecs (VP9, h264=avc1, hevc=hvc1) between its video streams, additionally all streams are being throttled server-side 😞 ...
youtube-dl -F "https://quick.vidalytics.com/video/5SwBVaqN/0TdguiZ2jRVjKEXR/9060/4595/stream.mpd"
=>
[generic] stream: Requesting header
WARNING: Falling back on generic information extractor.
[generic] stream: Downloading webpage
[generic] stream: Extracting information
[info] Available formats for stream:
format code extension resolution note
e2992025-4615-450d-81d9-da9de1bedf17 m4a audio only [en] DASH audio 96
k , m4a_dash container, mp4a.40.2 (48000Hz)
deac0958-2887-4bd9-827b-21d19f55e65c webm 480x270 DASH video 78k , w
ebm_dash container, vp9, 25fps, video only
23c5afd2-ff83-4aa5-801c-279e90a6558d mp4 480x270 DASH video 78k , m
p4_dash container, hvc1.1.6.L63.90, 25fps, video only
7db8b8ca-944d-4c3d-878f-71878440b193 mp4 480x270 DASH video 157k , m
p4_dash container, avc1.4D4015, 25fps, video only
6b798290-c1b0-445c-9e41-e1c65b33bb1e webm 640x360 DASH video 236k , w
ebm_dash container, vp9, 25fps, video only
e25526cf-c4e2-4127-a1b9-066e8fd5ab87 mp4 640x360 DASH video 245k , m
p4_dash container, hvc1.1.6.L63.90, 25fps, video only
01996de9-ebe9-484b-a229-98359f834d24 mp4 640x360 DASH video 355k , m
p4_dash container, avc1.4D401E, 25fps, video only
87913a33-63f8-4d73-b280-3fd89d3dd42c webm 1280x720 DASH video 712k , w
ebm_dash container, vp9, 25fps, video only
9ba5de7f-0208-430f-8bba-7a007524ed68 mp4 1280x720 DASH video 762k , m
p4_dash container, hvc1.1.6.L93.90, 25fps, video only
8f8bff13-effb-408c-9a67-5da680d5446f mp4 1280x720 DASH video 801k , m
p4_dash container, avc1.4D401F, 25fps, video only (best)
Provided you're using a fairly recent build of FFmpeg, it'll have no issues merging vp9/hevc into the MP4 container (although I consider myself vp9/hevc inside MP4 as a sort of a "Chimera" 😉 ) ... If you prefer a traditional MP4 file with h264+aac, then the following cmd worked for me:
youtube-dl --referer "https://vidalytics.com/video/0TdguiZ2jRVjKEXR" -f "8f8bff13-effb-408c-9a67-5da680d5446f+e2992025-4615-450d-81d9-da9de1bedf17" "https://quick.vidalytics.com/video/5SwBVaqN/0TdguiZ2jRVjKEXR/9060/4595/stream.mpd" -o "Vidalytics_Demo_720p.mp4"
=>
[generic] stream: Requesting header
WARNING: Falling back on generic information extractor.
[generic] stream: Downloading webpage
[generic] stream: Extracting information
[dashsegments] Total fragments: 278
[download] Destination: Vidalytics_Demo_720p.f8f8bff13-effb-408c-9a67-5da680d544
6f.mp4
[download] 100% of 60.41MiB in 08:45
[dashsegments] Total fragments: 278
[download] Destination: Vidalytics_Demo_720p.mp4.fe2992025-4615-450d-81d9-da9de1
bedf17
[download] 100% of 12.57MiB in 05:11
[ffmpeg] Merging formats into "Vidalytics_Demo_720p.mp4"
Deleting original file Vidalytics_Demo_720p.f8f8bff13-effb-408c-9a67-5da680d5446
f.mp4 (pass -k to keep)
Deleting original file Vidalytics_Demo_720p.mp4.fe2992025-4615-450d-81d9-da9de1b
edf17 (pass -k to keep)
If you're more fond of the Matroska container, then to create an .mkv file with hevc+aac, issue:
youtube-dl --referer "https://vidalytics.com/video/0TdguiZ2jRVjKEXR" -f "9ba5de7f-0208-430f-8bba-7a007524ed68+e2992025-4615-450d-81d9-da9de1bedf17" "https://quick.vidalytics.com/video/5SwBVaqN/0TdguiZ2jRVjKEXR/9060/4595/stream.mpd" --merge-output-format mkv -o "Vidalytics_Demo_720p.hevc.aac.mkv"
=>
[generic] stream: Requesting header
WARNING: Falling back on generic information extractor.
[generic] stream: Downloading webpage
[generic] stream: Extracting information
[dashsegments] Total fragments: 278
[download] Destination: Vidalytics_Demo_720p.hevc.aac.mkv.f9ba5de7f-0208-430f-8b
ba-7a007524ed68
[download] 100% of 60.00MiB in 10:00
[dashsegments] Total fragments: 278
[download] Destination: Vidalytics_Demo_720p.hevc.aac.mkv.fe2992025-4615-450d-81
d9-da9de1bedf17
[download] 100% of 12.57MiB in 02:41
[ffmpeg] Merging formats into "Vidalytics_Demo_720p.hevc.aac.mkv"
Deleting original file Vidalytics_Demo_720p.hevc.aac.mkv.f9ba5de7f-0208-430f-8bb
a-7a007524ed68 (pass -k to keep)
Deleting original file Vidalytics_Demo_720p.hevc.aac.mkv.fe2992025-4615-450d-81d
9-da9de1bedf17 (pass -k to keep)
Format : Matroska
Format version : Version 4
File size : 72.6 MiB
Duration : 18 min 27 s
Overall bit rate : 550 kb/s
Writing application : Lavf58.45.100
Writing library : Lavf58.45.100
ErrorDetectionType : Per level 1
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main@L3.1@Main
Codec ID : V_MPEGH/ISO/HEVC
Duration : 18 min 27 s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Writing library : HEVC Coding
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : A_AAC-2
Duration : 18 min 27 s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
In conclusion, there's nothing wrong with yt-dl
here, which, I suspect, can't be said about your own yt-dl
setup...
Regards
Any update on this? Is anyone working on adding this?
Please follow the guide below
x
into all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --version
and ensure your version is 2016.09.27. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-v
flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):
Description of your issue, suggested solution and other information
Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible. If work on your issue requires account credentials please provide them or explain how one can obtain them.
Seems like youtube-dl does not support m4s container for MPEG DASH streams.
Sample manifest.mpd from http://tvcom-live1.service.cdn.cra.cz/tvcom/fotbal-cfl62/manifest.mpd: