YoutubeExplode icon indicating copy to clipboard operation
YoutubeExplode copied to clipboard

How to get mpd url?

Open Tommy92708 opened this issue 7 years ago • 9 comments

How do I get the mpd url to pass into a mpeg-dash capable player to play? TIA.

Tommy92708 avatar Feb 11 '19 02:02 Tommy92708

MediaStreamInfo.Url

var client = new YoutubeClient();
var streamInfoSet = await client.GetVideoMediaStreamInfosAsync("bnsUkE8i0tU");

var streamInfo = streamInfoSet.Muxed.WithHighestVideoQuality();
var mpd = streamInfo.Url;

SlowLogicBoy avatar Feb 11 '19 09:02 SlowLogicBoy

I think he's taking about Dash manifest. There's no public way to access it. It's also not consistent.

Tyrrrz avatar Feb 11 '19 10:02 Tyrrrz

Thanks Tyrrrz, yup the dash manifest is what I'm talking about. I'm wondering how the YouTube html player got a hold of the mpd if that link isn't on the html page itself? Maybe it has a back channel communication w/ the YT server?

The reason why having an MPD link is important is because most muxed streams have SD quality. To get HD/4K quality, you will have to do the audio muxing yourself, which can be difficult to do it "live".

Tommy92708 avatar Feb 16 '19 17:02 Tommy92708

What do you mean by "doing it live"?

Tyrrrz avatar Feb 16 '19 19:02 Tyrrrz

Say I have a web player that takes in a YouTube URL and hit Play to play it. This web player has no time to download all the streams and mux them together. It has to play when the user hit the Play button.

Tommy92708 avatar Feb 22 '19 17:02 Tommy92708

Yeah, that's why you use GetMediaStreamAsync

Tyrrrz avatar Feb 22 '19 19:02 Tyrrrz

Yea but for HD video quality, the audio stream isn’t present so some muxing has to be done manually, no?

Tommy92708 avatar Feb 22 '19 23:02 Tommy92708

If you only need to play it, you can simply play audio and video streams simultaneously. That's what YouTube is doing.

Tyrrrz avatar Feb 22 '19 23:02 Tyrrrz

any bot or repo for getting mpd url ?? plz help me out

Devansh20055 avatar Jan 17 '22 15:01 Devansh20055