HTTP Live Streaming (HLS) Format – The Pros, Cons and How it Works
This blog focuses on HLS, or HTTP live streaming, which is one of the most popular protocols used to stream video today. HLS format is an adaptive bitrate live-streaming video protocol. Originally developed by Apple for use on iOS, Mac OS, and Apple TV devices, HLS streaming has become the most widely used live video protocol.
This article is going to take a look at the pros and cons of HTTP live streaming. We’ll compare it to a few alternative formats as well. We’ll also look at the history of the HLS format, and ask where it came from, and why.
Table of Contents:
- How HTTP Live Streaming (HLS) works
- HLS Adaptive Bitrate Streaming Explained
- HLS Security Features
- Pros of Using the HLS Protocol
- Cons of Using the HTTP Live Streaming Protocol
- HLS Compatibility with HTML5 and Browser Support
- Solutions to the Latency Problem
- HLS vs. Other Streaming Protocols
- HLS vs RTMP: The Fall of Flash
- HLS vs MPEG-DASH: The Newer Open-Source Alternative
- What is Low-Latency HLS?
- Use Cases for HLS Format
- HLS with CDN Integration
- HLS Encoder and Player Requirements
- HLS and Mobile Streaming
- The Evolution of HLS: Historical Context and Future Developments
- How Does Dacast’s Direct HLS Low Latency Streaming Solution Work?
- Conclusion
How HTTP Live Streaming (HLS) Works
HTTP Live Streaming (HLS) is a popular streaming protocol designed to facilitate seamless delivery of live and on-demand content across various devices. HLS divides video files into smaller, manageable segments, which allows for efficient and adaptive streaming. Each video segment is stored in an MPEG-TS container format, ensuring compatibility with a wide range of devices, from mobile to desktop.
When a stream starts, the server generates an HLS M3U8 manifest file—essentially a playlist that lists each video segment, including its available quality options. This manifest file enables HLS players to adjust playback quality in real-time, ensuring smooth viewing experiences even under fluctuating network conditions. Each segment may further be divided into smaller “chunks” to optimize buffering, making playback more responsive. A Content Delivery Network (CDN) then distributes these segments globally, which helps deliver high-quality streams without latency or interruptions.
Technical Components of HLS
HLS was originally developed as an alternative to Flash, using modern standards to ensure smooth, secure streaming. It uses H.264 compression for video, AAC or MP3 for audio, and relies on the HTML5 protocol for web-based delivery. The HLS protocol breaks down MP4 video streams into short, ~10-second chunks. Streams are described using M3U8 playlists that are created by the HTTP server. This playlist also called a manifest file, indexes the video chunks. These chunks are organized in the M3U8 manifest file, which enables players to locate and retrieve each segment efficiently.
HTML5 video players support HLS alongside other streaming protocols like MPEG-DASH, broadening compatibility across platforms and providing an accessible solution for streaming in most modern browsers.
Security and Monetization
For content creators and broadcasters, securing live streams is crucial, particularly if the content is monetized. HLS provides robust security options through M3U8 links, which include security tokens embedded in the manifest file. These tokens help enforce security measures like password protection or geographic restrictions by requiring regular check-ins with the streaming server. This feature is critical for monetized content, as it prevents unauthorized access while providing a seamless experience for authorized viewers.
When combined with M3U8 files, HLS offers a flexible, efficient, and secure way to deliver high-quality live and on-demand content and ensures all backlinks are retained. Its compatibility with HTML5 and adaptive streaming capabilities make it a reliable choice for broadcasters looking to optimize performance and protect their revenue-generating streams.
HLS Adaptive Bitrate Streaming Explained
Adaptive bitrate streaming (ABR) is a key feature that contributes to the popularity of HLS (HTTP Live Streaming). What is HTTP Live Streaming? It’s a streaming protocol that allows video content to be delivered over the internet efficiently. The HLS streaming format works by creating multiple video files of varying quality. This way, the player can adjust the video quality in real-time based on the user’s available bandwidth.
During an HLS live stream, the player continuously monitors network conditions and switches between different quality streams as needed. For example, if the network connection is strong, the player may use a high-quality stream. If bandwidth decreases, the player automatically switches to a lower-quality stream to ensure uninterrupted playback. This dynamic adjustment helps minimize buffering and provides a smoother viewing experience.
In essence, what does HLS mean? It means smarter streaming, allowing viewers to enjoy high-quality video without interruptions. The HLS full form emphasizes its role in delivering seamless content across various devices and network conditions.
HLS Security Features
In HLS video type streaming, encryption and secure key exchange are essential for protecting content. One common method is AES-128 encryption, which secures video files during playback. When a viewer accesses an HLS feed, the HLS player requests encryption keys from the server.
These keys are shared securely through TLS/HTTPS, ensuring only authorized players can decrypt the content. This secure key exchange protects the HLS video stream from unauthorized access, maintaining privacy and integrity.
By combining AES-128 and TLS/HTTPS, HLS delivers both a high-quality viewing experience and strong security, making it a trusted option for video providers aiming to protect their content across the web.
Pros of Using the HLS Protocol
Over the past few years, the HLS format has become a standard protocol for web video, and with good reason. HLS ingest is pretty simple to set up, it’s free to use, and it’s supported on a wide range of devices. Let’s take a look at some of the pros of using the HLMS protocol for video streaming.
1. All-Device Delivery
First, HTTP Live Streaming supports video on just about every device. Although it was originally created for use on Safari and iOS devices, the HLS format is now supported on every modern web browser—mobile, desktop, tablet, etc.
Whether you and your viewers are accessing content on a smartphone, tablet, desktop, or laptop, smart TV, set-top box, or any other device, HLS video will play. A majority of web browsers also support the leading alternative—MPEG-DASH—but iOS and Safari don’t. That’s a major advantage. For this reason, HLS remains the de facto standard.
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 given video. Then, the video quality they are being served is adjusted dynamically.
For example, you may begin watching a video at home, where you have a fast Wi-Fi connection. Then, you may leave home and get in a car with a friend, and continue watching the video with a mobile connection. This internet may be slower. You may also pass through areas of limited bandwidth availability. Even a dedicated home or work internet connection can have a significant variation in internet speeds.
Video delivered using the HLS format, if configured properly, will dynamically provide you with the best possible video quality while minimizing buffering and lagging. This approach leads to a superior user experience. The video will attempt to continue playing as much as possible. Quality will scale up as long as your internet is fast enough to handle the load.
3. Cost-Efficient
Another major advantage of the HLS format is its lower cost. As we’ve said, the format is supported by just about every device via HTML5 and Media Source Extensions. There’s no need to use a specific device to watch the content. Standard web servers can handle HLS delivery with no problem (depending on load and other factors).
4. Privacy and Security
The final benefit of HLS that we’ll highlight here is privacy and security. Compared to Flash, HLS simply provides a more secure browser for your viewers—both when they’re watching your content, as well as afterward.
Cons of Using the HTTP Live Streaming Protocol
No protocol or technology is perfect, and HTTP Live Streaming is no different. There are a few cons to using the HLS format. Let’s take a look at one of the most prevalent issues: latency.
1. Latency
Latency refers to the elapsed time between when an event occurs in the real world, and when viewers can see it. Essentially, it’s the time that it takes for a video to be recorded by a camera, processed by an HLS encoder, transmitted across the internet, distributed to “edge” servers, and decoded for viewing.
Note that video latency doesn’t account for slowdowns due to internet speed and bottlenecks; these are largely separate issues.
2. Internet Speed
HLS was designed to maximize quality, not to minimize absolute latency. Its keyframe interval, packet size, and playback buffer requirement simply aren’t suitable for super-rapid live streaming. Therefore, it usually adds a delay of 20-60 seconds to your stream. These live-streaming software platforms offer integrated low-latency solutions, and those are the ones to consider.
Slow internet speeds are only a problem for a small subset of live streamers—notably, video gamers and sports fans. In these situations, speed is important. 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 almost all viewers, a high-quality video that is watchable anytime, on any device, is more important than latency.
3. Increased Processing Load
HLS divides video content into small, chunked segments. This segmentation can lead to an increased processing load on both the server and client devices. As each segment needs to be encoded and decoded separately, it may require more resources. This can affect performance, especially on less powerful devices.
4. Server Overhead
The need to manage multiple segments can result in higher server overhead. Each segment must be stored, indexed, and served to users, which can strain server resources. This may require more powerful servers or additional infrastructure to handle increased requests and data management.
5. Segment Caching Requirements
To optimize performance, HLS often requires segment caching at multiple locations. This means that each video segment needs to be cached on various servers to ensure quick access. Managing this caching can add complexity to the overall system, potentially leading to inconsistencies and increased latency if not properly configured.
HLS Compatibility with HTML5 and Browser Support
HLS (HTTP Live Streaming) is a popular streaming format that works well with HTML5. This makes it ideal for delivering video across various devices and browsers. It was developed by Apple but HLS is now widely supported on most modern browsers and devices, including iOS, Android, and desktop browsers like Chrome, Safari, and Edge.
With HTML5, video playback is smoother, and there’s no need for plugins. This makes HLS integration more seamless. However, not all browsers natively support HLS (e.g., Firefox lacks full native support), so developers often use JavaScript libraries like hls.js to ensure consistent playback across platforms.
Using HLS with HTML5 allows for adaptive bitrate streaming, which adjusts video quality based on the user’s internet speed, providing a better viewing experience with fewer interruptions. This compatibility makes HLS a solid choice for online video delivery.
Solutions to the Latency Problem
Flash video provided low latency live streaming. But with the decline of Flash, internet video is in a transition period. There aren’t any fantastic solutions to the HLS latency issue yet. But many different businesses are working on it, including top-tier CDN provider Akamai. Replacements for HLS are in the works (such as fragmented MP4), but devices aren’t yet ready to play them. That next shift may still be a few years out.
To reduce latency in HLS streaming, several techniques can be used. Low-latency HLS (LL-HLS) improves latency by shortening segment durations and enabling partial segment delivery, bringing stream delays down to nearly real-time. This is achieved by delivering smaller, partial segments as soon as they’re available rather than waiting for the entire segment to be complete.
Also, chunked transfer encoding allows data to stream in smaller chunks, enabling faster delivery. HTTP/2 improves efficiency through multiplexing, speeding up load times for the HLS manifest and HLS file format. Together, these techniques create a smooth, low-latency streaming experience
Here at Dacast, we’re offering a low-latency HLS streaming solution for our Premium plans and above. This solution lowers latency to the range of 10 seconds or less. It meets modern browser security standards via HTTPS delivery and still allows you to reach all mobile devices.
HLS vs. Other Streaming Protocols
HLS is a popular video HLS protocol developed by Apple. It’s used for delivering high-quality content via the HLS streaming protocol. HLS uses the HLS m3u8 stream format, which breaks video into small HLS media file segments, making it reliable for high-quality, adaptive streaming.
When comparing HLS to other protocols, WebRTC stands out for its ultra-low latency, which is ideal for real-time communication like video conferencing. While HLS works well for broadcast-quality streaming, WebRTC offers instant interaction, making it more suitable for video calls or gaming.
CMAF (Common Media Application Format) merges HLS with MPEG-DASH. This reduces latency and increasing compatibility across platforms. This makes it valuable for low-latency, broad-reach applications.
And RTSP (Real-Time Streaming Protocol) is often used for IP cameras. While RTSP can handle low latency, it lacks adaptive streaming, making HLS feeds better for dynamic, high-quality streaming needs.
So you can better understand the pros of HLS, let’s take a closer look at HLS vs. other streaming protocols—notably RTMP and MPEG-DASH.
Before Flash was discontinued, RTMP and HLS were popular picks for delivering streaming video to viewers. Now that Flash is gone, MPEG-DASH is arguably HLS’s biggest competitor. MPEG-DASH is the newer kid on the block and has positively pushed HLS to improve and address past shortcomings like lower video quality.
With that said, let’s dive deeper into both comparisons.
HLS vs RTMP: The Fall of Flash
RTMP as a delivery protocol is mainly phased out, but RTMP is not dead. Let me explain.
Macromedia developed RTMP to work with Adobe Flash player early when the internet became widely used. The merging of Adobe and Macromedia in 2005 gave RTMP a huge reach. Consider that at its peak, about 99% of desktop browsers in the West had the Adobe Flash Player plug-in installed.
RTMP and Flash worked very closely together, so many people confused the two as the same thing, but they’re not. In other words, although Flash is dead, RTMP is not.
So what caused the downfall of Flash (and RTMP as the top delivery protocol)?
Steve Jobs addressed most of Flash’s shortcomings in a letter called Thoughts on Flash. In the letter, Jobs explained why Flash would not be allowed on Apple devices. In the letter, Jobs explained why Flash would not be allowed on Apple devices. In his letter, Steve Jobs talked about how Flash was a closed system and how it had a lot of issues. That’s why you may have heard people joking that Steve Jobs killed Flash, and there’s some truth to it.
Ultimately, Flash’s death resulted from being unable to fix its performance, battery, and security issues in line with competition like HTML5.
So technically speaking, it no longer makes much sense to compare HLS and RTMP as a delivery protocol, and this will become even more true as time passes. But, let’s pretend we’re back in the days of Flash for a second. As you might recall, RTMP was powerful because it achieved very low latency. Even after Flash’s end-of-life on December 31, 2020 (RIP), the world is still working on a solid low-latency replacement for RTMP.
Because RTMP is powerful, it still lives on, just not how it used to.
HLS Ingest vs. RTMP Ingest
With most browsers dropping support of RTMP delivery after Flash’s end-of-life announcement, anything to do with RTMP delivery/streaming (or Flash delivery/streaming) is practically nonexistent. However, RTMP largely lives on through RTMP Ingest, which actually works with HLS quite well.
For that reason, nowadays, it’s more appropriate to compare RTMP Ingest vs. HLS Ingest rather than RTMP vs. HLS for delivery/streaming.
If you need a refresher, ingest is the technology in charge of transmitting video files from the live stream encoder to the streaming platform. Basically, to use RTMP Ingest, you need an RTMP encoder, and to use HLS ingest, you need an HLS encoder, which leads us to our first benefit for RTMP Ingest.
At the moment, RTMP encoders are far more common than HLS encoders. However, this isn’t really a problem if you’re intentional about looking for HLS-compatible encoders since there are plenty of options out there. Another thing to note is that popular social media sites like Facebook support RTMP ingest and not HLS Ingest yet.
Compared to HLS, RTMP is optimized for latency, which is a top reason RTMP Ingest is still very popular compared to HLS Ingest. However, HLS ingest is capable of providing higher quality video and scalability. It’s likely HLS will come out on top in time, but for now, RTMP is going strong.
HLS vs MPEG-DASH: The Newer Open-Source Alternative
As far as delivery/streaming, HLS vs MPEG-DASH is more of a modern comparison compared to HLS vs. RTMP, so let’s dive in.
HLS is Apple’s proprietary solution and about a decade ago, most of its competition also consisted of other proprietary streaming protocols. For that reason, an alternative adaptive bitrate streaming protocol started to be worked on. MPEG-Dash is an open-source standard developed as a coordinated effort between more than 50 organizations, including giants like Apple and Microsoft.
So, one top thing you should know about MPEG-DASH compared to HLS is that it’s an international standard. But, MPEG-DASH’s major downfall is that the mobile Safari browser doesn’t support it, and if you’ve ever owned an iPhone or iPad, you know that Safari is the default browser. Considering there are about 1.8 billion active Apple devices globally, this is certainly a huge con for DASH.
Other comparisons between the two have changed over time. For example, DASH arguably delivered better quality in the recent past, but not anymore.
For a more detailed comparison, review our blog post comparing MPEG-DASH versus HLS streaming protocols.
What is Low-Latency HLS?
Originally, Apple developed HLS streaming to favor reliability over latency. As you now know, an advantage of RTMP over HLS is its lower latency.
To address this shortcoming, Apple announced low-latency HLS, which enables low-latency video streaming and is an extension of the HLS protocol. When it was first announced in 2019, low-latency HLS was an entirely separate protocol from HLS, but now Apple has merged both, and it’s become one protocol.
One goal of merging the two protocols was to speed up adoption. Since it’s relatively new, vendor support across the video delivery ecosystem has been lacking. The technology is super promising though.
Low-latency HLS can reach 2 seconds or less of latency, which is amazing. To put that in perspective for you, latency for HLS live streams generally tends to be between 15-30 seconds.
Use Cases for HLS Format
The HLS stream format (HTTP Live Streaming) is versatile, making it ideal for many industries. For live broadcasting of news and sports, for example, HLS supports real-time, high-quality streaming that scales. This ensures viewers experience minimal buffering. OTT streaming platforms rely on HTTP video streaming to reach audiences on various devices, from smartphones to smart TVs, enhancing accessibility and viewer engagement.
In e-learning, HLS offers smooth streaming for lectures and interactive courses, allowing students to watch content seamlessly on many devices. Corporate communications also benefit from HLS, as it supports secure video sharing for company updates, training, or events across global teams.
Also, HLS is compatible with adaptive bitrate streaming. This adjusts video quality based on internet speed. This adaptability and compatibility make HLS an essential format for reliable, high-quality streaming across different sectors and use cases.
HLS with CDN Integration
Integrating HLS with CDNs creates a powerful solution for delivering video content efficiently. CDNs enhance HLS streaming by caching video segments at edge servers, closer to viewers. This reduces latency and enables faster playback, improving the viewing experience. By distributing segments across the CDN’s network, HLS can quickly scale to meet high traffic demands, making it ideal for large-scale live-streaming events where many users watch simultaneously.
The synergy between HLS and CDNs is found in the ability to optimize video delivery for viewers, regardless of location, without overloading the origin server. With edge caching, CDNs minimize buffering times and bandwidth usage, providing reliable streaming even under heavy loads. This integration provides smooth, high-quality videos for audiences everywhere.
HLS Encoder and Player Requirements
For streaming with HLS, both a compatible encoder and player are important. An HLS encoder is responsible for converting live video into HLS format, breaking it into small segments that can be streamed to users.
Popular HLS-compatible encoders include OBS Studio* which is free and open-source, Wowza Streaming Engine, known for robust streaming capabilities, and professional hardware encoders such as Teradek and AJA. These options cater to different needs, from simple streaming to complex, high-quality broadcasts.
For playback, an HLS-compatible player is required. Some popular choices include JW Player, a widely-used solution for professional streaming, Video.js, an open-source player with customizable options, and THEOplayer, which is known for seamless HLS playback across devices. These players support smooth delivery and adaptive bitrate streaming, optimizing user experience. With the right HLS encoder and player, you can deliver reliable, high-quality streams on various platforms.
HLS and Mobile Streaming
HLS is highly effective for mobile streaming, designed originally by Apple with mobile devices in mind. This format works especially well on mobile networks by using adaptive bitrate streaming to adjust video quality based on network conditions. This means users get smooth playback with less buffering, even when network speeds vary. This is a great benefit as mobile video consumption continues to grow.
For mobile-first businesses, HLS offers a big advantage over older protocols. It’s optimized for performance on mobile networks, meaning it delivers high-quality streaming with efficient data use. This helps in preserving battery life and improves user experience. With more viewers watching on mobile, HLS ensures that video content loads quickly and smoothly, making it a powerful choice for businesses focused on mobile-friendly streaming and reaching today’s mobile-centric audiences.
The Evolution of HLS: Historical Context and Future Developments
HTTP Live Streaming was developed by Apple back in 2009 as a response to the declining use of Flash for video delivery. Originally designed for mobile devices, HLS aimed to provide a robust solution that offered adaptive streaming capabilities.
Over the years, it’s become the industry standard for delivering video over the internet because of its ability to adjust video quality based on users’ bandwidth, ensuring smooth playback across various devices.
As HLS continues to morph and improve, future developments look to include Low-Latency HLS, which significantly reduces buffering time and improves real-time streaming experiences. This improvement is particularly beneficial for live events and interactive broadcasts.
However, HLS faces growing competition from open-source alternatives like MPEG-DASH and CMAF. These technologies offer similar adaptive streaming features and appeal to developers seeking more flexible solutions. Despite this competition, HLS remains a cornerstone of video delivery, and its ongoing advancements will likely keep it relevant in an ever-changing streaming landscape.
How Does Dacast’s Direct HLS Low Latency Streaming Solution Work?
We were the first online video platform to offer a low latency HLS live stream encoder for free. This encoder is based on the open-source encoder OBS Studio meaning it includes all the benefits that make OBS Studio so popular.
It’s compatible with Mac and Windows. Something you should know is that unlike many other encoders, it only requires a small amount of CPU processing power and memory.
When we compared HLS vs. RTMP, we mentioned that RTMP-Ingest is still popular. However, that doesn’t mean it’ll be popular forever. Dacast’s Direct HLS Low Latency Streaming Solution uses HLS Ingest instead, although RTMP Ingest is still the default.
By using HLS ingest, Dacast’s Direct HLS Low Latency Streaming Solution is HLS end-to-end. So instead of HLS streaming starting with RTMP Ingest and then converting to HLS, it starts and ends with HLS. This gives viewers much lower latency, and we’re talking 10 seconds or less of latency. It also meets modern browser security standards, which means it can still reach all mobile devices.
Conclusion
HLS is a powerful technology that’s become one of the industry standards. Hopefully, this article has educated you on the basics of this live streaming technology, how it works, and what its upsides and downsides are.
Any questions about the HLS format? You can do your first live stream today with the Dacast HLS video streaming software. If you’re ready to try it today, you can take advantage of our free 14-day trial. No credit card is required.
For exclusive offers and regular live streaming tips, you’re also invited to join our LinkedIn group.
Finally, do you have further questions, thoughts, or feedback about this article? We’d love to hear from you in the comments below, and we will get back to you.
Thanks for tuning in, and good luck with your live streams!