It's amazing to notice that live stream sites like doitlive.tv can deliver videos on very low bandwidth (as low as 25kbps) home connection. Could someone explain me the technology behind such sites and how they managed to deliver under such low bandwidth?
4 回答
最近,我一直在与几家大公司就这个问题密切合作。首先,正如其他答案中已经提到的,内容交付网络用于提供最佳分发。
CDN 基本上是一个全球性的服务器集群,其中包含单个资源的多个副本。因此,当您从纽约市请求该资源时,您将获得物理上最接近纽约的版本。关于CDN的工作原理有很多很好的解释。
您关于带宽的问题涉及一种称为自适应比特率流的技术。假设您有一个直播流到网络。在流式传输时,有一种称为分段器的技术将整个文件分块成小数据包,以后可以将它们拼凑在一起。每个段都被编码为各种分辨率和功能。因此,当您作为客户端请求文件时,CDN 可以判断连接的强度。如果它很低,自适应比特率流式传输会为您提供较低分辨率的文件。你有没有注意到当你开始在线观看视频时,它的质量很低,但随着时间的推移会有所改善?这是这项技术的一个完美例子。随着您的连接缓冲更远且速度更快,您将获得更高质量的“段”。
这是一篇关于自适应比特率流的文章。
内容交付系统,并减少文件大小。
第一个允许他们将文件存储在世界各地数据中心的服务器中,从而降低用户的传输和存储成本。这意味着更快的下载/流式传输。
第二个有多种形式。最明显的是降低分辨率、调整比特率和使用高级编解码器。如果将 640x480 分辨率的视频缩小到 320x240,则需要大约 1/4 的空间来存储它。同样,使用较低的比特率会使视频更块,但精度的损失也是文件大小的损失。最后,更高级的编解码器(如 h.264)可以以相同的视觉质量压缩相同的视频,比旧的或更简单的编解码器(如 MPEG1 或 DivX)更小。
One simple approach that was used in the past, but may or may not be used today would be to use UDP instead of TCP. UDP has lower overhead. For things like a pdf or a program you need every byte, lose a few or a few packets worth and the whole thing is useless. For video and audio this is not the case, we tend to forgive or perhaps not notice dropped frames or some missing audio. UDP does not have the guaranteed reliability that TCP has, but for streaming that is okay, speed is more important than reliability, so long as it is good enough.
The most important reason for the ability to stream video today is the compression technology. Each new technology (h.264) or version (mpeg1, mpeg2,...) demands better quality video at the same bitrate or lower bitrates for the same quality or both, better quality at lower bitrates. The algorithm trades bandwidth for computation power both on the encoder and decoder. Ideally the bulk of the work is on the encoding side so that the decode algorithm can be simple. If you have ever tried to encode a good quality mpeg2 or h.264 or other type video it often takes significantly longer to encode the video than it does to play the video.
Add to that other networking tricks like the Content Delivery Network/System described in other answers to this question. The long and short of that is reducing the number of hops between you and a system with the content as well as spreading the overall delivery bandwidth of the content across many servers.
如果是关于 Flash 流媒体,则有 Adobe Flash Media Server、Wowza 和开源 Red5 等媒体服务器。
这些用于通过网络流式传输录制或实时流。
带宽使用取决于视频和声音编解码器。
您可以在此处查看 Adobe Flash 对编解码器的支持。您也可能想查看这篇 Wikipedia 文章。
这些可能会给你一个想法。