December 9 2022

What is HLS, the HTTP Live Streaming Format?

Let's see the advantages of the HLS format, its pros and how it works.

This blog focuses on HLS, or HTTP live streaming, which is one of the most popular protocols used today for streaming video. The HLS format is a bitrate-adaptive live video streaming protocol. Originally developed by Apple for use on iOS devices, Mac OS and Apple TV, HLS streaming has become the most widely used live video protocol.

This article will look at the pros and cons of HTTP live streaming. We will also compare it to some alternative formats. We will also look into the history of the HLS format and ask where it came from and why.

How HTTP Live Streaming (HLS) works.

HLS video is delivered over the HTML5 web communication protocol, the latest online standard for web content. HTML5 video players support online video delivered over a variety of protocols. These include HTTP Live Streaming (HLS) and MPEG-DASH.

You can think of the streaming protocol as the method that defines what format the video uses, how it is compressed, the size of the blocks sent, and so on.

HLS was developed to provide an alternative to Flash video. Technically speaking, it uses H.264, AAC or MP3 video compression for audio compression and transmits streams using the MPEG-TS container format.

Video streaming via HLS works by cutting an MP4 video stream into short video blocks of approximately 10 seconds. Streams are described using M3U8 playlists created by the HTTP server. This playlist, also called a manifest file, indexes video blocks.

Advantages of using the HLS protocol

In recent years, the HLS format has become a standard protocol for web video, and with good reason. HLS capture is pretty easy to set up, it's free, and it's supported on a variety of devices. Let's look at some of the benefits of using the HLMS protocol for video streaming.

Benefit no. 1: Deliver on all devices

First, HTTP Live Streaming supports video on almost all devices. Although originally created for use on Safari and iOS devices, the HLS format is now supported on all modern web browsers: mobile, desktop, tablet, and so on.

If you and your viewers access content on a smartphone, tablet, desktop or laptop, smart TV, set-top box, or any other device, the HLS video will play. Most web browsers also support the main alternative, MPEG-DASH, but iOS and Safari don't. This is a big plus. For this reason, HLS remains the de facto standard.

By using HTML5, developers no longer worry about which browser or which extension their visitors are using.

Advantage #2: Excellent quality

The HLS video format uses a method called Adaptive Bitrate Streaming. This method measures the Internet speed available to each viewer of a particular video. Hence, the quality of the videos that are served is adjusted dynamically.

For example, you might start watching a video at home, where you have a fast Wi-Fi connection. Then, you can leave the house and get in the car with a friend and continue watching the video with a mobile connection. This internet connection may be slower. You may also cross areas with limited bandwidth availability. Even a dedicated home or work Internet connection can have a significant variation in Internet speed.

Adaptive streaming technologies share several critical aspects. First, they produce multiple files from the same source file to distribute to viewers watching on different devices powered by different connection speeds. Second, they distribute files adaptively, modifying the delivered stream to match changes in actual throughput and available CPU cycles on the playback station.

Third, they all work transparently to the user, so that the viewer clicks one button (rather than multiple buttons as with the movie trailer experience where users select the bitrate and video quality) and all the flow switching happens behind the scenes. The viewer may notice a slight change in quality as the streams change, but no action is required from him.

All technologies also share similar operational characteristics, although there are some key differences. For example, all adaptive streaming technologies monitor factors such as the state of the video buffer to evaluate actual throughput and CPU usage, and dropped frames to evaluate the processing power available at the playback station. This information is used to determine when to switch streams.

For example, if the video buffer is full and CPU usage is low, the adaptive streaming technology may switch to a higher quality stream to improve the viewing experience. If the buffer falls below certain levels or CPU usage exceeds certain thresholds, the technology may switch to a lower quality stream.

The main implementation difference between the technologies is the involvement of a streaming server. Specifically, some technologies require a streaming server and constant communication between server and player. If a stream switch is needed, the server implements it by sending a different stream to the viewer.

Other technologies work without a streaming server. The different quality streams are sent to different addresses on a web server or multiple web servers. The player monitors operational heuristics such as CPU usage and buffer status, decides when a stream switch is needed, and starts catching up data from a different stream when appropriate.

Either way, adaptive streaming technologies allow producers to deliver exceptional quality streams at the high end of the bandwidth/power spectrum because they also serve the low end. Without adaptive streaming, most manufacturers would deliver a single average quality file that appears below average in the optimal viewing configuration, or create multiple files and force the viewer to select the desired configuration.

Video delivered using the HLS format, when configured correctly, will dynamically provide you with the best possible video quality with minimal buffering and lag. This approach leads to a superior user experience. The video will try to continue playing as much as possible. The quality will increase as long as your internet connection is fast enough to handle the load.

Benefit #3: Cost Efficient

Another big advantage of the HLS format is its lower cost. As we said, the format is supported by almost all devices through HTML5 and Media Source Extensions. You don't need to use a specific device to watch the content. Standard web servers can handle HLS delivery without problems (depending on load and other factors).

For example, the NGINX web server that we use in the company natively supports HLS support also in the Free and Open Source version.

Cons of using the HTTP Live Streaming protocol

No protocol or technology is perfect and HTTP Live Streaming is no different. There are some disadvantages to using the HLS format. Let's look at one of the most common problems: latency.

Latency

Latency refers to the time between when an event occurs in the real world and when viewers can see it. Essentially, it's the time it takes for video to be recorded by a camera, processed by an HLS encoder, transmitted over the Internet, distributed to "edge" servers, and decoded for viewing.

Note that latency does not take into account slowdowns due to internet speeds and bottlenecks; these are largely separate issues.

HLS was designed to maximize quality, not minimize absolute latency. Its keyframe interval, packet size, and playback buffer requirement are simply not suited for super-fast live streaming. Therefore, it usually adds a 20-60 second delay to your stream. These live streaming software platforms offer integrated low latency solutions and those are the ones to consider.

This is usually only an issue for a small subset of live streamers, especially gamers and sports fans. In these situations, speed matters. However, most users can easily ignore the small latency of hosting an HLS stream as it will have no impact on viewer satisfaction or experience. For nearly all viewers, high-quality video that can be watched anytime, on any device, is more important than latency.

Solutions to the latency problem

Flash video provided low latency live streams. But with the decline of Flash, Internet video is in a period of transition. There are no fantastic solutions to the HLS latency problem yet. But many different companies are working on it, including top-tier CDN provider Akamai. Replacements for HLS are in the works (like fragmented MP4), but devices aren't ready to play them yet. The next round could still be in a few years.

 

 

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds owns the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Facebook, Inc. owns the rights to Facebook®; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV This site is not affiliated, sponsored, or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a registered trademark at European level by MANAGED SERVER SRL Via Enzo Ferrari, 9 62012 Civitanova Marche (MC) Italy.

Back to top