Contrary to popular belief, Flash is no longer the preferred format for streaming video. For quite a while now HLS streaming has dominated the market offering an open and HTML5 native format for broadcasting content. This is important to know whether you want to build the next Netflix, YouTube, or just want to incorporate video into your workflow. We recommend HLS streaming for it’s wide stream adoption and efficiency. Not only that, but HLS is a far more secure and much faster when compared to Adobe’s Flash.

In this article we’ll explore the technology behind the HLS streaming protocol and why streamers of all sizes will want to use this format for their broadcasts.

HLS Streaming Explained

HLS Streaming, short for HTTP Live Streaming is based on HTTP communications protocol. Apple originally developed HLS to improve data usage and consumption on cellular networks. Initially released in 2009, HLS uses an adaptive bitrate technique, breaking down the overall stream into a sequence of small HTTP-based file downloads. This feature is important, especially for iOS Devices, which can only stream about 10 minutes of continuous video when connected to a cellular network. By breaking down long streams into a succession of HTTP-based downloads, iOS devices can circumvent this limitation. Additionally, the server can offer the client request the same video in varying levels of bitrate and resolution quality, adapting on the fly depending on the client’s bandwidth and available processing power.

The benefits of using an adaptive bitrate technique for streaming are all too familiar: one minute you have a nice, crisp high resolution streaming video with great quality, and the next minute your network gets crowded with traffic and the quality plummets. In the bad old days the video would pause to buffer or even worse, the server would simply disconnect you completely and you’d have to start the stream all over again from the very beginning.

A dropped stream??!
Anatomy of an .m3u8 playlist file via Streaming Media

When a video is encoded with HLS, multiple files are created, with each file outputting at various resolutions, and optimized for specific download speeds. HLS works by breaking down the stream into chunks of MPEG2-TS files. These video chunks are indexed and referenced by the .M3U8 playlist file. If you want to learn more about what bitrates and resolutions to offer for your video files, I recommend you check out this Best Practices Technote written by the developers at Apple. Looking at this document, we to understand just what makes HLS streaming so good at what it does (but more on that later).

HLS also comes standard with an encryption mechanism, great news if you’re a content producer or distributor. All videos streamed in the HLS communications protocol can be secured using AES and a secure-key distribution using HTTPS. You can use a single key for all your streams, a different key for each stream, or a series of randomly generated keys that change at intervals during a stream. Keys are further protected by the requirement for an initialization vector, which can also be set to change periodically.

The HLS Architecture in Depth

HLS Streaming Architecture Overview

Videos prepared for HLS streaming are encoded in the H.264 format. This video is then segmented to generate video fragments and the .m3u8 index file. The segmenter encapsulate the video by MPEG-2 Transport Stream. MPEG-2 Transport stream is a standard digital container format and widely used throughout various broadcast systems such as ATSC, DVB, and IPTV.

The reason HLS is so good at delivering online video, is that video encoding and preparation is all done server side. This is great news for content creators and distributors as server side encoding significantly lowers cost. It also allows for easy distribution via HTTP to just about any device. HLS video will play on smartphones, laptops, web browsers, desktops, smart TVs, and even set-top boxes.

When to Use HLS Streaming

When should you use HLS Streaming? In short, always. If your clients operate on a wide variety of networks (cellular, wifi, high bandwidth for example) then HLS is for you. The same could be said if you want to optimize video distribution for a variety of platforms and devices. Remember, is native to HTML5 and baked into iOS as well as Android. This feature also helps lower CDN costs by distributing video at the optimal bandwidth. By using an adaptive bitrate technique HLS streaming lets the content distributor avoid the typical extra costs involved with a progressive streaming format. Along with all of this great tech is built in security that is leagues ahead of Flash.

Getting started with HLS Streaming

Now that you’ve learned about HLS Streaming in depth, it’s time to take it for a test ride. There are plenty of options out there, but I think ours is the easiest to get started with. Our api easily integrates into any workflow with only a few lines of code. Developers and product managers are often under overwhelming time constraints. We can help you get up and streaming quickly and easily. Best of all, our cloud infrastructure is GDPR compliant, meaning there are no regulatory hoops to jump through. Check out our documentationor send us a message.