HTTP Live Streaming, also known as HLS, is an adaptive bitrate streaming protocol originally created by Apple. HLS is one of the most popular methods to stream videos online.
HLS adjusts video quality in real time depending on the strength of the network connection. HLS does this by breaking video files into small, two to twelve-second long segments. The video player can access these segments from the HTTP server throughout the duration of the video stream. The player also keeps a buffer of segments in case it loses network connection, minimizing disruptions for the viewer.
Watch this video for a quick overview of HTTP Live Streaming (HLS). View more definitions in the Mux video glossary.
In this guide, we’ll cover:
- History of HLS video streaming
- An overview of the HLS format
- Top 5 advantages of HLS
- Using HLS video streaming for live content
- Using HLS video streaming for on-demand content
- Latency considerations for HLS
- HLS video streaming compatibility
- How to scale HLS video streaming
History of HLS video streaming
Apple first launched HTTP live streaming (also known as HLS) in 2009. Originally, HLS was developed for iOS and macOs devices. Now HLS is the go-to format for streaming online videos and supported by other platforms outside of the Apple landscape.
Today, platforms like Hulu TV and Twitch use HLS to decrease downtime and create a positive viewer experience. In this blog post, the Twitch engineering team talks about using HLS to scale their live stream content across “tens of thousands of concurrent live video streams.”
An overview of the HLS format
HLS playlists can be found in text files using the .m3u8 file extension. These playlist files describe which renditions are available for a given stream, like different resolutions of the same source media. They also provide details about the individual video segments, their duration, and where the URLs they can be found at.
Transport stream (.ts) files are usually used for packaging the individual video segments which are joined back together by a player on the front-end. The video is usually encoded with H.264 or H.265 for the video and AAC for audio.
Commonly, these .ts files are distributed across a CDN (content delivery network) so that they can be cached as close to the viewer as possible.
Top 5 advantages of HLS video streaming
HLS format and adaptive bitrate streaming have many advantages, but here are the top five:
- Compatibility across devices: HLS is compatible across a range of devices, including iOS, macOS, and Android devices.
- HLS players are available on major platforms: HLS is an industry-standard format and can play almost everywhere. Some examples of HLS web players are Mux hls-video element, HLS.js, and Plyr.io.
- Uses existing video formats: HLS uses existing video formats like MP4, TS, codecs like H.264, and AAC.
- Improved user experience: HLS adjusts the video quality based on a viewer’s internet connection instead of lagging or interrupting a stream.
- More scalable: HLS works over HTTP, which means no special servers are necessary, making it more scalable than other protocols.
Using HLS video streaming for live content
HLS is a reliable streaming protocol that is compatible with most devices and platforms, so it makes sense that it is the preferred format for live, high-profile events. Adaptive bitrate streaming protocols like HLS can support many different network conditions, so engineering teams choose HLS for streams that will be viewed by people across multiple regions or countries.
Examples of HLS for live content:
- FIFA World Cup on BBC iPlayer or Fubo.tv
- eSports like Dota 2 on Twitch
- Video game streamer channels on Twitch.tv
- Live online auctions from Sothebys on YouTube
Using HLS video streaming for on-demand content
HLS is the main standard for on-demand video streaming due to its stream reliability and its compatibility across platforms, browsers, and devices. Unlike live video streaming, with video-on-demand (VOD), viewers can choose when they want to watch a video on platforms like Netflix, Hulu, or YouTube. Because HLS can adapt video quality based on network connectivity, the viewer experience is consistent across mobile devices. According to Statista, almost 70 percent of digital video content is viewed on mobile phones, so a quality streaming experience is expected, regardless of whether a viewer is in their house or on the go.
Examples of HLS for on-demand content:
- Music videos on YouTube
- TV series posted on Amazon Prime Video
- Online classes on MasterClass.com
- Video posted to news sites like NBC, BBC, or CNN
Latency considerations for HLS
Scalable protocols like HLS and DASH (Dynamic Adaptive Streaming over HTTP) prioritize stream reliability over latency, which means these streams tend to be more consistent, but slower.
Apple recognized the need to reduce latency for HLS streams, so they introduced an extension called Low-Latency HLS (LL-HLS), also known as Apple Low Latency HLS (ALHLS), which is now integrated into one protocol. When building video, engineering teams typically reduce latency in their HLS streams by using multiple proprietary low-latency services.
Mux, on the other hand, supports LL-HLS for low-latency live streaming without the need to hack together a variety of systems. Mux’s API is also built on open standards, so it will work with any compliant player.
HLS video streaming compatibility
HLS’s compatibility across devices—including iOS, macOS, and Android—and every major browser is one of the reasons it is so popular. In the table below, HLS-supported browsers and devices are listed alongside their associated platforms.
Platform | HLS support |
---|---|
Web | Every major browser, either using HTML5 video player like Video.js or HLS.js, or via native playback support in Safari. HLS is supported by Safari, Google Chrome, Firefox, and more. |
iOS | Natively supported |
Android | Supported through the Google Exoplayer project |
TV | Supported on Roku, Apple TV, Xbox, Amazon Fire TV, PS4, Samsung, LG, etc |
How to scale HLS video streaming
Video consumption continues to increase and streaming now accounts for over 38 percent of overall video viewing time, according to Statista. Scaling HLS video can carry some challenges, including higher latency and higher cost of delivery.
Developers often use content delivery networks (CDNs) to scale low-latency video across countries and devices, while reducing costs. Because HLS is delivered over HTTP, engineering teams can leverage traditional CDN networks to scale HLS delivery in the same way they would use CDNs to cache images, HTML, CSS and JavaScript.
Learn more about HLS
Read these additional resources to learn more about HLS:
- HLS vs. DASH
- How to convert MOV video to HLS with ffmpeg
- How to convert MP4 video to HLS format with ffmpeg
- Low-Latency Video Streaming: A Complete Guide
- howvideo.works - an informational site created by Mux explaining how video on the internet works