Friday 1 August 2014

Adaptive bitrate streaming

Adaptive bitrate streaming is a technique used in streaming multimedia over computer networks. While in the past most video streaming technologies utilized streaming protocols such RTP with RTSP, today's adaptive streaming technologies are almost exclusively based on HTTP and designed to work efficiently over large distributed HTTP networks such as the Internet.
It works by detecting a user's bandwidth and CPU capacity in real time and adjusting the quality of a video stream accordingly. It requires the use of an encoder which can encode a single source video at multiple bit rates. The player client switches between streaming the different encodings depending on available resources. "The result: very little buffering, fast start time and a good experience for both high-end and low-end connections.

More specifically, and as the implementations in use today are, Adaptive bitrate streaming is method of video streaming over HTTP where the source content is encoded at multiple bit rates, then each of the different bit rate streams are segmented into small multi-second parts. The streaming client is made aware of the available streams at differing bit rates, and segments of the streams by a manifest file. When starting, the client requests the segments from the lowest bit rate stream. If the client finds the download speed is greater than the bit rate of the segment downloaded, then it will request the next higher bit rate segments. Later, if the client finds the download speed for a segment is lower than the bit rate for the segment, and therefore the network throughput has deteriorated, then it will request a lower bit rate segment. The segment size can vary depending on the particular implementation, but they are typically between two (2) and ten (10) seconds.


Traditional HTTP and Progressive Download

Ø  Traditional HTTP: Early experiments with delivering video via HTTP were less than satisfactory for a number of reasons, not the least of which was the limited bandwidth available in the 28/56Kbps modems of the day. The first video files posted on the web were delivered via download and play, which mean they had to be fully downloaded before playback began.


Ø  Progressive Download: Progressive Download is the most widely used video delivery method by far (in part because it's what YouTube uses). It's also easiest to implement: just put a video on your webserver and point your player to the URL. Once a user hits play, the player immediately starts downloading the file. The player will start video playback as soon as it has enough data to do so, but it will continue to download until it has received the whole file (hence the progressive) 



In most cases (Flash needs a small server module), it is possible to seek in a player to a not-yet- downloaded part of the video. At that point, the player re-downloads the video, starting at the seek offset instead of at the beginning. We call that feature pseudo-streaming.

What is Streaming media?


·         Streaming media is video or audio content sent in compressed form over the Internet and played immediately, rather than being saved to the hard drive.

With streaming media, a user does not have to wait to download a file to play it. Because the media is sent in a continuous stream of data it can play as it arrives. Users can pause, rewind or fast-forward, just as they could with a downloaded file, unless the content is being streamed live.

RTMP/RTSP Streaming:  This method uses specialized webservers that only deliver the frames of a video the user is currently watching. No data is downloaded in advance and data a user has seen is immediately discarded.
·         RTMP can do live streaming, so people can watch your video while it is being recorded.
·         RTMP can do dynamic streaming, where the video quality (i.e. adaptive bitrate) automatically adjusts to changes in bandwidth.
·         Players can seek to later parts in a video, which is particularly useful for files > 10 minutes.
·         Players maintain a tiny buffer, instead of downloading a video during playback, saving bandwidth.



Disadvantages
·         RTMP uses different protocols and ports than HTTP, which makes it vulnerable to getting blocked by (corporate) firewalls. This issue can be prevented by streaming in RTMPT (tunneling over HTTP), which comes at a server performance cost. 

·         RTMP data is streamed to the player, which means the bandwidth of the connection must be larger than the data-rate of the video. If the connection drops for a couple of seconds, the stream will stutter. This issue can largely be prevented by using dynamic streams that include a low-quality file.