My first HLS video stream delivered on CDN

Video Video Video!

I’ve been learning video stuff in the last two weeks. Video is now more accessible and people are talking about 3-Screen (TV, PC, mobile device) or TV Everywhere. Most of us watch video on our computing devices without any interest in understanding the underlying technology. Well, at least me in the past.

Where to start? streamingmedia.com is an excellent resource. First of all there are two major types of video content on Internet:
Video-on-demand (VOD) – pre-recorded video content
Live video streaming – video of live event. Because it is live so there is no “pre-recording”

In the past there were different technologies for VOD and streaming. Streaming technologies can carry VOD traffic but VOD technologies cannot be used for live. In a null shell, streaming technology enables
-the video server to send video content, live or pre-recorded, to video player (client). The player will play the video and then discard the video content.
-the video player to communicate with video server so that the video server can send different quality video to the player based on the performances of the player Internet connectivity and CPU loading of the device the player is running on. By doing so the player can provide the best viewing experience by minimizing video buffering and maximizing resources availability.
-the player to request server to send content at different portions of the video. So user can skip some parts of the video. Once the player stops playing video, server will not send video traffic to it and reduce unnecessary transmission and bandwidth usage.
-players are free in general but servers are expensive.
-beside cost, another major drawback is firewall blocking of streaming protocols

Leading vendors like Adobe and Microsoft develop different technologies and solutions:

Streaming Protocols Server Client
Adobe RTMP, RTMPE Adobe Flash Server Adobe Flash Player
Microsoft MMS Microsoft Media Server Microsoft Media Player

On the other hand, VOD technology lets player to download (e.g. via HTTP or FTP) the whole pre-recorded video file first and then play it. For long video the lengthy download time will frustrate user. Later on with HTTP Progressive Download, video file header notifies player to start playing the video if a specific amount of video content (buffer) is received by the player. HTTP Progressive Download improves user experience by reducing wait time. However, HTTP Progressive Download has two limitations:
-video content cannot be delivered dynamically to the player based on resource availability at client end. No adaption mechanism to reduce user frustration.
-waste of bandwidth since the whole video file will be downloaded to the player even the player stops playing the video.

The latest Cisco® Visual Networking Index (VNI) predicts Internet traffic will grow to 1.3 Zettabyte by 2016 and 54% will be video-on-demand or video streaming traffic. So what Internet protocols will carry most of video traffic? RTMP? MMS? HTTP?

The answer is HTTP.

A hybrid solution was evolved around year 2007 to mix the best of streaming and VOD technologies:
-use HTTP as the underlying transport layer
-divide the video content into small file segments/chunks and construct an index file to instruct the player to download different chunks based on a)different portion of the video is requested and b)resource availability

This solution is called HTTP Dynamic Streaming or Adaptive Bitrate Streaming. Benefits:
-firewall friendly
-more user-friendly. It is browser-based and therefore no need for another video player as long as browser supports it
-more economical because of using standard HTTP servers
-user can play different portions of video without much waiting and skip unnecessary file download, therefore better experience and bandwidth usage
-since it is HTTP content then CDN can be used to improve content delivery!

There are three leading vendors in HTTP Dynamic Streaming:
Apple: HTTP Live Streaming (HLS)
Adobe: HTTP Dynamic Streaming (HDS)
Microsoft: Smooth Streaming

There is a great article at streamingmedia.com about the HTTP Dynamic Streaming (in general, not just for Adobe HDS):
http://www.streamingmedia.com/Articles/ReadArticle.aspx?ArticleID=65749

I would like to learn HLS first because I am an Apple user. Moreover
-both iOS and Android support HLS
Apple owns 74% of smartphone web traffic, 95% of tablet traffic
Mobile Safari is the fastest growing browser
-there is a very good article from Priya Rajagopal: Generating HTTP Live Streaming Content for iOS Devices
-EdgeCast supports HLS
-encoding.com provides some free online encoding services (e.g. mp4 to HLS)
-drivehq.com provides some free ftp services. I can send encoding.com output via ftp

I would like to end this long article by sharing my first HLS video stream delivered on CDN. Please use your iDevice to click this URL:
[update 20160309] http://cloudfront.cheungwaikin.com/video/Count_on_me.m3u8

(The follow URL created on 20120603 is no longer functional
http://wpc.6AF4.edgecastcdn.net/006AF4/HLS/Count_on_me.m3u8
)

Sorry for the long URL because it is a CDN URL~ It is for testing purpose.

It is a 3min 16sec MTV. Count on me like one, two, three… there are twenty-one .ts segment files listed in the .m3u8 index file.


2 Comments on “My first HLS video stream delivered on CDN”

  1. luguen says:

    Hi,
    thank you for this article !
    I’d like to test the test file at the end of the article, is it possible to enable the CORS (http://enable-cors.org/server.html) ?
    Thanks again !


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.