使用exoplayer(DASH)将youtube直播视频流式传输到Android应用 [英] Streaming a youtube live video to android app with exoplayer (DASH)

查看:550
本文介绍了使用exoplayer(DASH)将youtube直播视频流式传输到Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个可以将实时YouTube视频流式传输到我的应用的应用。我想使用exoplayer。我浏览了exoplayer的演示应用程序,他们在短信流中使用的网址是这样的:



uri: http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear, fmp4_sd_hd_clear& sparams = ip,ipbits,expire,source,id,as& ip = 0.0.0.0& ipbits = 0& expire = 19000000000& signature = 51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E& key = ik0



这是有效的。



我不知道如何获得这样的网址。我最终在这里 https://github.com/google/ExoPlayer/issues/48



这是否意味着即使视频是我自己的,我也无法从youtube流式传输?(特别是直播视频)
如果我可以,我怎么能得到我的视频的这个网址是什么?

解决方案

我了解到DASH网址实际上是Google内部的网址,您可能需要使用解码器来获取你的URL。



为此,你可能想尝试Karim Abdell Salam给出的以下解决方案 SO帖子



< blockquote>


  1. 首先你需要调用这个网址: http://www.youtube.com/get_video_info?&video_id=v1uyQZNg2vE 并且不要忘记更改目标的最后一个ID。

  2. 现在你会注意到o下载一个名为 get_video_info 的文件,没有extesion。

  3. 尝试使用记事本等打开此文件。

  4. 现在您拥有正确的数据,但由于其编码您无法读取它您需要HTML解码器才能读取此数据。使用这个: http://meyerweb.com/eric/tools/dencoder/ 。只需粘贴您的数据并按几次解码以确保解码良好

  5. 最后,搜索名为 dashmpd 的密钥并享受网址


您可能还想查看这些链接以获取更多有用的信息和更新:





最后,您可以选择尝试播放实时视频droid版本4.2.2,无需使用本文中提到的ExoPlayer SO帖子


i am making an app that can stream a live youtube video to my app. I want to use exoplayer. I went through the demo app of exoplayer and the url they use in dash streaming is somthing like this :

"uri":"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0"

This is working.

i dont know how to get such a url. and i end up here https://github.com/google/ExoPlayer/issues/48

does that mean i cant stream from youtube even if the video is my own??(Especially Live videos) if i can how can i get such a url of my video?

解决方案

I have learned that DASH URLs are actually something that are internal to Google and you might need to use decoder to be able to get your URL.

For this, you may want to try the following solution given by Karim Abdell Salam in this SO post:

  1. First you need to call this url: http://www.youtube.com/get_video_info?&video_id=v1uyQZNg2vE and don't forget to change the last id with the target one.
  2. Now you will get notice to download a file called get_video_info with no extesion.
  3. Try to open this file using notepad and so.
  4. Now you have the right data but you can't read it because its encoded You need HTML decoder to read this data. Use this one: http://meyerweb.com/eric/tools/dencoder/. Just paste your data and press decode a several times to ensure it decoded well
  5. Finally, search for a key called dashmpd and enjoy your URL

You may want to also check these links for more helpful information and updates:

Lastly, you may opt to also try playing live videos on android version 4.2.2 without necessarily using an ExoPlayer as mentioned in this SO post.

这篇关于使用exoplayer(DASH)将youtube直播视频流式传输到Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆