What Is HLS (HTTP Live Streaming)? All You Need To Know
HLS (HTTP Live Streaming) is a patented streaming format which was once used only on Apple devices. Now, HLS streaming is supported by many other devices, including Android-powered smartphones.
HLS allows you to conveniently deliver audio and video (live and on-demand) to your audience no matter what device they are using. It is actually based on the very protocol that has also been used to build the web, i.e. HTML.
If you want to deploy content using conventional delivery networks and web servers that are used for everything else, then it’s time to look into HLS.
What is HLS?
HLS, meaning HTTP Live Streaming is a powerful adaptive bitrate streaming communications protocol that is designed to be reliable and dynamic. With the ability to adapt to differing conditions based on the speed that is available on both wireless and wired connections, it can deliver an optimized playback experience.
HLS is widely supported across streaming media servers and browsers – such as Firefox and Google Chrome. But, an HLS player is still needed to watch HLS content.
Essentially, the HTTP Live Streaming protocol breaks the stream down to small pieces and sends them to the client through an extended M3U playlist which serves as a container. The pieces are encoded on varying bit rates to protect your stream while it’s traveling on the web. HLS uses a regular web server to dispense video content. It requires a particular type of software to create the appropriate format transmission in real-time.
Why Use HLS?
HLS streaming is one of the requirements for video apps on the App Store and circumvents network problems usually associated with other streaming protocols.
Other benefits include:
- Adaptive bitrate streaming
- Live playback
- Time-shifted playback
- Superior encryption
- Support for Digital Rights Management (DRM)
- Support for multi-language audio
HLS: Features And Capabilities
HLS has many useful features to get your streaming media to your clients. Besides live streams, it’s also being increasingly used for pre-recorded audio and video as it delivers a lot in terms of customization, security and usability.
The Mac Developer Library reveals the following qualities of HLS:
- Fast Forward and Reverse Playback capabilities thanks to an I-frame playlist
- Media is protected using sample-level encryption as content segments are independently encrypted, offering superior security
- Discontinuity markers let you insert advertisements during playback
- Support for subtitles and closed captions
- Multilingual support with alternate audio; different video renditions of the same event (e.g. different angles at a gaming event) also supported
- Timed metadata lets you insert names and album art etc. at specific points during the playback
How Does HTTP Live Streaming Work?
Internet users demand that video streaming work flawlessly on all devices and network types, even if they have slow mobile connections and are behind firewalls. HLS video can solve this dilemma since Apple introduced it keeping in view these challenges.
HLS streaming has quickly become the ultimate standard in adaptive bitrate video delivery.
Adaptive bitrate streaming is enabled by a combo of server and client software that identifies the bandwidth capacity, and regulates the quality of the video stream – adjusting the multiple bitrates and resolutions as it goes.
The results are much better than what we’d see when a static video file is delivered at a single bitrate. Additionally, the video experience is enhanced because the stream can be adjusted according to the client’s network speed.
This helps us avoid unnecessary delays and buffering that happens when the client’s network speed can’t support the video quality.
HLS works by splitting the content stream into small HTTP files that are then downloaded and played as a chunk of the overall – possibly limitless – transport stream. It’s important to note that this process can usually delay playback for up to 90 seconds during a live video.
As the stream plays, the client may select from a number of options (streams) that each contain the same content that is encoded at different data rates. This is how a streaming session adjusts to the available data rate without compromising on playback.
Streaming Formats Compared | ||||
Adobe HDS | Apple HLS | Microsoft Smooth | MPEG DASH | |
Works with standard HTTP servers | No | Yes | No | Yes |
International standards | No | No | No | Yes |
Multiple audio channels | No | Yes | Yes | Yes |
Flexible Content Protection with DRM | Yes | Yes | Yes | Yes |
Closed captions and subtitles | Yes | Yes | Yes | Yes |
MPEG-2 TS Segments | No | Yes | No | Yes |
Support for Multiplexed content (audio + video) | Yes | Yes | No | Yes |
Support for Non-Multiplexed content (Separate audio/video) | No | Yes | Yes | Yes |
Client failover | No | Yes | No | Yes |
HLS vs RTMP
RTMP is Adobe’s high-performance streaming protocol.
One of the advantages of HLS is that it is widely integrated across players and platforms. Another significant plus it can make way across firewalled corporate networks. On the other hand, RTMP-delivered flash videos don’t always have that privilege.
So if you don’t want the added complication of dealing with proxies and firewalls, HLS is your best bet. RTMP does have an advantage over HLS, namely that it offers multicast support. If you want to deliver a stream to multiple users over a network, then RTMP is right for you.
The cost of implementation is perhaps the most crucial aspect of HLS – it doesn’t need specialized skills or servers, unlike RTMP. HLS also has better traffic and that means an overall reduced cost of ownership compared to RTMP.
HLS vs MPEG-DASH
DASH is an open-source standard that, like HLS, employs an adaptive bitrate video method. Still, HLS remains the more powerful streaming video format.
There’s not much difference between the two when it comes to quality. MPEG-DASH is codec agnostic, but HLS is compatible with HEVC/H.265, so the quality is on par.
HLS also supports 4k resolution for videos; both protocols support High Dynamic Range (HDR) and can deliver good tonal condition.
Note that MPEG-DASH is not supported by the Safari browser, so it won’t work on iPad, iPhone etc. This means that billions of iOS users will not be able to use this format.
Since all other browsers support HLS, it is the choice for publishers who want a broad and diverse audience for their content.
Let’s also quickly go over the MPEG_TS vs HLS debate here. MPEG_TS is not a new solution, but it is not as exceptional as HLS. For example, it cannot support Adaptive Bit Rate control. It does, however, have outstanding compatibility and pretty much all devices support it, so this may be a good option as well.
How To Stream With HLS
As we explained earlier, HLS streaming sends a number of different content streams to the client. These contain audio/video, but the difference is that each stream has been encoded at a different data rate; in this way, clients get non-stop playback from an HLS stream.
Now that we know what HLS is, it’s interesting to note that since it is an HTTP-based technology, it doesn’t need special streaming servers at all.
The player is responsible for adjusting the data rates to ensure optimum playback speeds.
And since this switching logic is the player’s responsibility, you must have a quality live streaming platform to help your HLS videos broadcast correctly.
What Encoder Do You Need?
HLS streaming is an exceptional technology that is genuinely adaptive in every sense of the term. When content is encoded into multiple files for varying internet speeds and resolutions, the encoding is done using the mpg2_ts codec.
The streams are sent to the client in a .M3u8 index file that moves from the HLS encoder to the online video platform in RTMP format. It is the streaming platform’s responsibility to transcode this video to HLS.
The video codec h.264 is used to do this job; there may also be an option for x.264 in the hardware or software you use for encoding. Don’t worry, though, This is simply another form of the same protocol.
For the audio codec, you can look into AAC or AAC-LC.
The HTML5 Video Player
The HLS vs RTMP vs RTSP debate ends at the HTML5 video player.
HTML5 is an easy way to integrate native video within a browser and it supports HLS hands down, no matter the browser or OS.
Most modern browsers support HTML5 APIs that enable you to make a JavaScript application to take care of the streaming.
What you need is an HTML5 player with Flash fallback so even older devices can watch your video stream. Together with the adaptive streaming capabilities of HLS, you can deliver high-quality videos, both live and on-demand. What’s more, it can also be customized for mobile devices to reach a wider audience.
How Much Bandwidth Is Necessary?
The necessary bandwidth is determined by what you are trying to stream live and at what resolution. In general, the higher the resolution/quality, the more HLS bandwidth you will need.
Think about it like so: a low-quality 240p live video will require approximately 400 kbps. On the other hand, a full-HD 1080p video stream will need 4 to 8 Mbps to display correctly.
Our experts recommend the following bitrates at different resolutions:
- 240p: 300 – 500 kbps
- 360p: 500 – 800 kbps
- 480p: 800 kbps – 2 Mbps
- 720p: 1.5 – 4 Mbps
- 1080p: 3 – 6 Mbps
It’s simpler to figure out the audio rates; for 240p video resolution, set 64 kbps as the audio bitrate. At a higher rate, 360p or even 480p, the audio bitrate can be increased to 96 kbps. If you are streaming at 720p or above, then 128 or 192 kbps should do nicely.
Please remember that these are just suggestions. If you’re streaming a recital or a concert, it might be better to highlight sound quality even if the video streams are low quality. It’s really your decision!
In A Nutshell
HLS is quite possibly the best protocol to use if you want to stream live media in 2024 and beyond.
Remember, one third of all online activity involves viewing videos and businesses know that this medium of communication is extremely important for their marketing and operations.
Overall, note that HLS streaming offers all the features that you need, along with the flexibility and compatibility that you simply can’t ignore.
References & Further Reading
- Multi-Bitrate HLS Live Video Streaming
- The 9 Best Live Streaming Platforms For Business
- HTTP Live Streaming: Send audio and video to iOS, tvOS, and macOS devices
- HTTP Live Streaming (HLS-VOD)
- Live Streaming Setup Guide
- Live Streaming Equipment
We Offer Full Support For HLS Streaming
Try It Free
DON’T MISS OUT
Get updates on new articles, webinars and other opportunities: