The Ins and Outs of HTTP Live Streaming Protocol (HLS)

HLS live streaming by brid.tv

When Adobe announced that they’d be killing Flash for good by the end of 2020, the entire world immediately started looking for alternatives. Their gaze slowly but surely zeroed in on Apple’s HTTP live streaming (HLS) protocol as the most suitable alternative.

We can’t say that it was surprising. Online video delivery has been straying from Flash and turning toward HLS live streaming and HTML5 video players for a few years now. That was primarily due to their technical superiority to Adobe’s product.

This shift has proven quite beneficial for both broadcasters and viewers for several reasons:

  • Both the HLS protocol and HTML5 are open specifications, allowing for higher customizability and accessibility.
  • They have higher security standards.
  • They are substantially faster and more reliable than Flash.

Luckily, HLS streaming has taken its roots in the online world even before Adobe’s announcement. That is why it has already managed to become a staple in the online video industry alongside other popular protocols like MPEG-DASH.

However, our focus here will be HLS exclusively, as this streaming protocol outshines its competitors in various regards. So if you’re looking for Flash alternatives or have already decided on settling for HLS but want to learn more about it, you’re in the right place! We’re going to answer all questions you might have about HLS in this article.

Here’s what we’ll cover:

Without further ado, let’s get right into it! 

What Is HTTP Live Streaming (HLS)?

HLS (short for HTTP live streaming) is an HTTP-based media streaming protocol used to deliver audio and video content across the internet.

Supported Audio Codecs:Supported Video Codecs:
AAC-LC
HE-AAC+ v1 & v2
xHE-AAC
Apple Lossless
FLAC
H.265
H.264

Apple created this protocol back in 2009 to replace its robust Quicktime Streaming Server service, which displayed an abundance of issues. Some of these problems included slow speeds and non-standard ports that firewalls often ended up blocking.

Luckily, Apple addressed these issues by introducing its HLS protocol, which soon revolutionized the online streaming industry.

How Does HTTP Live Streaming (HLS) Work?

We’ve already mentioned how HLS protocol plays an essential role in live streaming, but how does it work? For most devices and browsers, HLS streaming works as following:

With the above in mind, it should be clear that two crucial elements play an essential role in this process — a powerful video encoder and a reliable video hosting platform. That does make using the HLS protocol a bit more challenging than the Flash player, but not much if you know where to look for the right solutions. 

If you think your options are limited, you’re wrong. There are plenty of video platforms out there that actively support and improve their HLS streaming technology to ensure smooth content delivery and playback. The best part is that you can also find white-label video platforms that even support high player customization and allow branding. 

If you’re interested in a feature-rich, white-label HTML5 player and video platform solution that supports high-speed HLS streaming, check out TargetVideo. Sign up for a free trial and see our HLS live streaming protocol in action! 

The Technical Aspects of HTTP Live Streaming (HLS)

We now have the foundation on how HLS streaming works, but what hides below the surface? We’ll try our best to present the answer in the most intuitive way possible. Here’s what happens:

  • HLS protocol uses MPEG2 Transport Stream to cut MP4 video content into short segments (usually around 10-seconds long).
  • The HTTP server collects and stores those streams before delivering them to the viewers’ devices.
  • HLS will then play the encoded video.

“OK, the above seems straightforward, but how does HLS handle these video chunks?” you may ask. It’s quite simple — it uses an M3U8 playlist file to serve as an index for the said video chunks. In other words, HLS sorts the chunks into playlists so that the video player knows their correct order.

image illustrating how hls live streaming protocol cuts files into chunks and organizes them for playback

Do note that aside from the individual M3U8 playlist files, a master playlist file will also need to be created. The purpose of that master playlist (aka manifest file) is to instruct the player on how to navigate multiple different playlists. That will allow anyone delivering the stream to distribute the content. They will be able to do that by embedding the M3U8 reference URL or creating an app to download the file. 

Benefits of HTTP Live Streaming (HLS)

Now that you know how HLS protocol works, it’s only natural to ask, “But why should I settle for HLS?” The answer is straightforward — it’s not only superior to Flash, but it also has plenty of benefits over its competition. Here are the most notable ones:

  • This streaming protocol allows creators to offer multiple quality renditions of a single broadcast.
  • HLS supports closed captions, which allows creators to embed subtitles into their streams.
  • HLS supports adaptive bitrate streaming, allowing creators to send high-quality video and streams to users regardless of their processing power or bandwidth.
  • This protocol is highly scalable for delivering video files and streaming content through global content delivery networks (CDNs).
  • HLS has extensive DRM support.

As you can see, the above benefits alone are sufficient to prove the HLS streaming protocol’s domination over the media streaming market. These aspects are just some of the factors why HLS is superior to other popular streaming formats, with HDS, RTMP, MSS, MPEG-DASH, and RTSP being just some of the alternatives.

Attention: For an up-to-date list of browsers with native support for HLS, visit this site.

HLS Live Streaming and Latency

HLS protocol does have one disadvantage — latency with live video streaming. This lag time can be as high as 15–30 seconds long, which can significantly deteriorate user experience for some broadcasters. Luckily, this latency is not something we can’t combat nowadays.

One way to lower your HLS stream’s latency is to reduce the size of the video chunks (or segments) we talked about in one of the chapters above. These chunks usually last 2–6 seconds; however, since HLS needs to buffer 3–4 of these segments at a time, the latency can quickly add up to dozens of seconds. That is why cutting down on these segments’ size allows for speedier loading times, making the entire stream faster. 

Now that you are well informed about the benefits and downsides of HLS streaming, one question remains — is HLS right for you? Let’s see when you should and shouldn’t consider it!

When to Use HLS

HLS live streaming is undoubtedly the way to go for broadcasts where quality is essential, such as broadcasting sports events or asynchronous video.

Since we’ve mentioned video, HLS streaming is arguably the best streaming protocol to use with HTML5 video players. The primary reason is that HLS content tags are easily implementable into a website’s HTML code. Also, its ease of implementation and customizability for publishers and remaining free of charge for viewers are what set HLS apart from its alternatives.

Last but not least, HLS is the ideal choice when streaming to mobile devices. It is Apple’s native product, and the company is still a giant on the global mobile market, so consider that when deciding.

And if you do settle for HLS, trust us when we say — you’re not alone. HLS live streaming is the most popular streaming format currently, with as many as 45% of publishers using it! Here’s a visual representation of just how much it overshadows the competition:

graph representing streaming protocols by popularity (hls is the most popular)

When Not to Use HLS

HLS live streaming does have some flaws, so it’s not perfect for every situation. You’d be better off settling for a different streaming protocol in scenarios where you need near-instant delivery (<1 sec.). These may be situations like web conferencing, real-time remote control of cameras and drones, or scenarios requiring high situational awareness. Even a few seconds of delay could prove detrimental in any of these cases, so not even the most optimized and low-latency HLS protocol will fit the bill.

So if you’re looking for a streaming protocol for any of the above, you’d be wise to look for it elsewhere. If you need advice on a potentially decent solution, we suggest you try out something like the WebRTC for minimizing lag.

What Lies in the Future of HLS Live Streaming?

As we’ve mentioned before, with Adobe’s Flash shutting down by the end of the year, many publishers worldwide will look for an alternative solution. HLS will be the perfect alternative for most of them, with its vast scalability, variety of supported features, DRM, etc. So does that mean HLS will be the future of live streaming?

We can’t say that for sure. After all, who knows when the next piece of technology will come out that will surpass HLS by solving its few flaws? However, one thing is indisputable — HLS protocol is soon to become the present of live streaming.

Until next time!