-->
Save your FREE seat for 流媒体 Connect this August. 现在注册!

什么是流媒体协议?

This is another installment in our series of “什么是...?" 文章, 旨在提供定义, 历史, 以及围绕在线视频行业的重要术语和问题的背景. 

选择一个 流媒体 technology involves multiple considerations, 包括对该技术使用的流媒体协议的优缺点的理解. 本文定义了一个流协议,然后讨论了当今领先的流技术所使用的协议的相对优点.

什么是通信协议?

通信协议 are rules governing how data is communicated, defining elements 就像 syntax of file headers 和 data, 身份验证, 错误处理. There are easily dozens of protocols involved in sending a simple data over the internet, 和 it’s important to underst和 how they work together.

简单来讲, International Organization for St和ardization (ISO) 创建了 开放系统互连 model which defines seven logical layers for communications functions. All 流媒体 protocols are in the application layer, 这意味着它们可以使用它下面的任何一层来传输数据包之类的管道功能. This enables protocols within each layer to focus on a particular function, rather than having to recreate the entire stack of functions.

OSI模型

例如, 实时流协议(RTSP) 应用程序级流协议是否可以在传输层中使用多个协议来传输其数据包, 包括 通用数据报协议(UDP)传输控制协议(TCP). 有时,应用程序级协议是专门为特定的传输协议编写的, 就像 实时传输协议(RTP), which is typically built on UDP transport.

希望, 这个简短的概述将帮助您了解流协议的位置以及它们如何与其他流协议交互, 低级协议. 这是我们所能得到的技术,伙计们,所以从现在开始,应该会一帆风顺.

In the Beginning there was HTTP, 和 it Was Good

有了这个背景, let’s start examining the application-layer protocols used to stream video, starting with the gr和daddy of them all, HTTP. 你们可能知道, HTTP st和s for Hypertext Transfer Protocol, which is the lingua franca for the web. HTTP管理web服务器和浏览器之间的通信,是用于将网站上的所有内容分发给远程查看者的协议, 包括HTML文本, GIF和JPG图形, PDF files 和 other web-based (as opposed to FTP)下载.

早期通过HTTP传输视频的实验不太令人满意,原因有很多, 其中最重要的是当时28/56Kbps调制解调器的有限带宽. 第一个发布在网络上的视频文件是通过下载和播放的方式传递的, which mean they had to be fully downloaded before playback began. 然后 苹果 开创了 渐进式下载, where the video could start to play as it was downloaded, 这有点帮助, but didn’t provide functionality like lookahead seeking or r和om access.

http传输视频的另一个大缺点是成本和服务质量问题. HTTP delivery is accomplished as fast as available b和width will allow. If a viewer connected via a high-speed connection, the entire video file was sent as quickly as possible. 如果观众在几分钟后停止观看,那么大部分转移就被浪费了.

此外,这种传送模式很难同时服务于多个观看者. 当观看者A点击视频时,服务器开始以最快的速度发送视频. 当观众B, C, D, E点开了视频, 在向观看者A的传输完成之前,出站带宽可能不足以为它们提供任何视频.

流媒体协议的兴起

As 流媒体 media increased in importance, several 流媒体 protocols were created to address these issues, 包括前面提到的RTSP, 微软媒体服务(MMS)Macromedia’’然后 Adobe’s) 实时消息协议 (RTMP). At a high level, these protocols shared several common elements.

First was the existence of a 流媒体 server, or a software program charged solely with delivering 流媒体 content. 这些流媒体服务器与传统的HTTP服务器一起工作,这样当浏览者点击HTTP服务器上的链接时, 它启动了流媒体服务器和播放器之间的连接,直到观看者停止观看. 因为这种联系, these protocols are considered “stateful,,与HTTP相比, which is stateless 和 has no connection between server 和 player. 

This connection addressed most of the negatives of HTTP delivery. Streaming protocols enabled seeking to r和om points in the video file, 自适应流媒体, 多个编码文件可以根据可用带宽和CPU能力分发给播放器. 服务器可以及时测量视频流到播放器上, 所以如果观众停止观看, 额外的带宽很少被浪费. Because the outbound flow was metered, a 流媒体 server could more effectively serve multiple users, improving overall quality of service.

HTTP -回到未来

随着时间的推移, as Flash video rose to dominate the 流媒体 video l和scape, RTMP became the dominant 流媒体 protocol, 至今仍被广泛使用. 然而, with the introduction of 微软’s HTTP-based 光滑的流 和苹果的 HTTP直播(HLS), HTTP-based 流媒体 technologies began a resurgence for multiple reasons, 两者都与RTMP的负面影响和HTTP技术的创新有关,这些创新解决了RTMP的许多负面影响.

Perceived shortcomings in RTMP include:

  • RTMP 包s may be blocked by certain firewalls, 但如果遇到这些问题,Adobe Media Server有解决方案.
  • RTMP数据包不能利用isp网络中可用的标准HTTP缓存机制, 公司, 以及其他组织, which can improve distribution efficiency 和 quality of service.
  • The persistent server to player connection means increased costs, 因为流媒体服务器要花钱.
  • 与基于http的流相比,所需的服务器也可能限制可伸缩性, since there are many more HTTP servers than RTMP.

我说"感知"," because as this article is being written (August 2012), RTMP仍然被像 彭博街上.com,这往往会让人怀疑RTMP无法通过防火墙严密的查看器. ESPNMTV also use RTMP, which makes you question the scalability 和 cost issues.

抛开这些疑虑, 技术专家普遍认为,基于http的技术在交付高质量流方面更有效. 另外,Adobe引入了 HTTP动态流(HDS) 在2010年,为那些寻求基于http的流式传输到桌面的用户提供了一个基于flash的替代方案. 突然之间, changing to HTTP-based online video delivery no longer involved a seismic shift to a totally new technology; Flash users could continue to leverage their investment in Flash development 和 infrasture 和 leverage the benefits of HTTP流媒体.

如前所述,HTTP流的一些创新也解决了该技术以前的限制. 像之前一样, there is no persistent connection between the server 和 the player; the video resides on any HTTP server 和 the technology remains stateless. 然而, now all HTTP-based streams are broken into chunks, either separate files or segments within a larger file. Rather than retrieving a single large file with a single request, 基于http的技术根据需要检索连续的短块.

这有很多好处. First, there’s little waste because the video is delivered as it is watched. This effectively meters out the video, enabling a single HTTP server to efficiently serve more streams. Seeking is no problem; if the viewer drags the playhead forward, the player can just retrieve the appropriate chunks. These technologies also enable the efficient switching between streams, so all the listed technologies (光滑的流, HLS, 和HDS)自适应流.

由于这些技术是通过HTTP交付的,因此它们回避了RTMP所面临的问题. 基于HTTP的技术是防火墙友好的,并且可以利用HTTP缓存机制. Because no 流媒体 server is required, 它们的实现成本更低,并且可以更便宜、更有效地扩展以服务可用用户.

最后点

同样,RTMP分发仍然被许多网站广泛而有益地使用. 然而, while there may be little impetus for some sites to change, at this point if you’re considering a 流媒体 technology, the overwhelming sentiment is to deliver via HTTP. Of course, for adaptive delivery to 苹果 devices (和 Android 3.0 和 higher), HLS is your only option.

认识到大多数视频内容都是通过普通的HTTP渐进式下载传递的,这一点也很有用. 确定, 有局限性, 比如缺乏自适应流媒体, but you can’t say it’s worked out too badly for YouTube该公司大约70%的视频都是通过网络传输的,而且完全是渐进式下载. 然而, this approach prevents YouTube from deploying the 数字版权管理 通过HDS提供的技术, 光滑的流, 和HLS来保护他们的视频, which is a key reason sites with br和ed content use these technologies.

Finally, the focus of this article has been general internet 流媒体. Particularly for intranet use, 流媒体-server-based protocols like IP多播 像这样的应用 点对点传输 provide lots of value 和 even more promise. So don’t throw out the baby with the bathwater; 流媒体 servers aren’t “bad” 和 HTTP isn't "good." Rather, choose the best tool for the job.

流媒体覆盖
免费的
合资格订户
现在就订阅 最新一期 过去的问题
相关文章

什么是HLS (HTTP 在线直播)?

苹果的HTTP直播(HLS)协议是用于向iPad和iPhone等苹果设备传输视频的技术. Here's a primer on what HLS is 和 how to use it.

什么是自适应流?

看看什么是自适应流, 主要技术提供者, 以及在选择自适应流媒体技术时应该考虑的因素

什么是HTML5?

An explanation of HTML5 和 HTML5 Video, 包括历史, 专利问题, 以及苹果目前的使用情况, 微软, 谷歌, Adobe, 和其他人.