Android 不同设备的 YouTube 流媒体协议和端口号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11515445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:53:38  来源:igfitidea点击:

YouTube Streaming Protocol and Port numbers to Different Devices

androidvideostreamingwireshark

提问by kip2

I'm wondering if anyone knows whether YouTube uses different protocols and/or port numbers in streaming video to different clients. For example, is it possible that they use HTTP, Port 80 for Mozilla Firefox (or any other web browser) and something like say RTSP, port 53, to stream to the Android platform? I know that Android VideoView/MediaPlayer libraries supports HTTP streaming, but the answers at this SO threadsuggest that RTSP is possible.

我想知道是否有人知道 YouTube 在向不同客户端流式传输视频时是否使用不同的协议和/或端口号。例如,他们是否有可能使用 HTTP、Mozilla Firefox(或任何其他网络浏览器)的端口 80 以及诸如RTSP端口 53 之类的东西来流式传输到 Android 平台?我知道 Android VideoView/MediaPlayer 库支持 HTTP 流,但是这个 SO 线程的答案表明 RTSP 是可能的。

And more generally, are there any nice ways of determining what streaming protocols and ports video servers/providers like YouTube, Netflix, ESPN use? I've tried using Wireshark but I realize how cumbersome it is to associate specific IP addresses to host/domain names. In addition, Wireshark doesn't seem to differentiate between transport and application layer protocols (that is, for some 2 random packets with the same source IP address, for the first packet it lists that the protocol in use is TCP, for the second packet it says it's protocol is HTTP).

更一般地说,有没有什么好的方法可以确定 YouTube、Netflix、ESPN 等视频服务器/提供商使用的流媒体协议和端口?我尝试过使用 Wireshark,但我意识到将特定 IP 地址与主机/域名相关联是多么麻烦。此外,Wireshark 似乎没有区分传输层协议和应用层协议(也就是说,对于某些具有相同源 IP 地址的随机数据包,对于第一个数据包,它列出使用的协议是 TCP,对于第二个数据包它说它的协议是HTTP)。

回答by narced133

I think Wireshark is your best bet here. Based on captures I have around, I can say that Netflix and the Youtube app on Android 2.2, Android 4.0, iOS 4.3.3 and iOS 5.x communicate only using HTTP and HTTPS (ports 80 and 443). Not sure what versions of the respective apps this represents but all were captured in 2011 and 2012.

我认为 Wireshark 是您最好的选择。根据我周围的捕获,我可以说 Netflix 和 Android 2.2、Android 4.0、iOS 4.3.3 和 iOS 5.x 上的 Youtube 应用程序仅使用 HTTP 和 HTTPS(端口 80 和 443)进行通信。不确定这代表了各自应用程序的哪个版本,但都是在 2011 年和 2012 年捕获的。

To determine whether your captures have any packets that are not DNS, HTTP port 80 or HTTPS port 443 try using a filter like the one below. Replace 1.2.3.4with the ip address of the device you are using to test.

要确定您的捕获是否包含任何非 DNS、HTTP 端口 80 或 HTTPS 端口 443 的数据包,请尝试使用如下所示的过滤器。替换1.2.3.4为您用于测试的设备的 IP 地址。

ip.src==1.2.3.4 && not dns && tcp.dstport != 80  && tcp.dstport!=443

See this SO questionfor suggestions on getting started with wireshark.

有关开始使用 wireshark 的建议,请参阅此SO 问题