HLS Streaming: Definition, Usage, Pros & Cons
The acronym HLS stands for HTTP live streaming. Use this tool, and you can deliver video and audio to a massive audience tapped in via the internet.
For example, during the 2021 March Madness basketball tournament, television streaming audiences increased by 85 percent compared to 2019. In essence, more people turned to Roku (which accepts HLS) instead of switching on a standard TV set.
HLS comes with fast speeds, low latency, and widespread acceptance. But you will need a bit of technical know-how (or a good third-party vendor) to ensure that your streams make it from your camera to your viewers.
What Is HLS Streaming?
If you use the HLS protocol, your video will be compressed, chopped into pieces, and transmitted over HTTP. HLS will reunite all of those parts into a playlist, and your viewer will see nothing but a steady stream of content.
In formal terms, HLS uses both video compression and audio compression, and it transmits the stream via the MPEG-TS container format. It chops the video into very short segments lasting about 10 seconds, and M3U8 playlists (also called manifest files) created by the HTTP server keep those bits in order.
Apple released HLS in 2009. Previously, users had to rely on programs like Flash. Unfortunately, hackers took advantage of the hunger for video and launched relentless attacks against Flash’s technology.
For example, people with Flash installed on their computers often see popups telling them to update their software. A big, pulsing button sits in the middle of these ads, and when victims click, harmful malware is installed and begins to take over.
HLS is different. Users don't need to download a program like Flash or Quicktime to see their videos. They just need to work with a device or browser that supports HLS streaming. And most devices and programs do work well with the technology.
How Does HLS Streaming Work?
Let's dig deeper into the nitty-gritty of HLS streaming and the coding environment it requires.
HLS streaming relies on two types of software:
- Encoders: Input comes from a camera, and encoders transform it into video files and audio files. That data is output into a MPEG file or transport stream.
- Hosting platforms: These systems accept encoded video, and the platform segments data and places it on a server.
In a typical process, HLS streaming involves:
- Input. A camera takes both audio and video files sends them to the encoder.
- Encoding. The encoder transforms the input into HEVC video and AC-3 audio.
- Output. An MPEG-4 file or MPEG-2 transport stream outputs the data.
- Segmenting. A tool breaks the stream into short media files and places them on the server.
- Indexing. The segmenting tool maintains a list of the media files.
- Publishing. The URL of the index file is published, and then client software can access it.
- Access. Viewers tap into the feed and see all the files in order, with no gaps.
Note: Some developers must take one extra step to publish an HLS stream. They must configure their encoders to deliver an RTMP stream. Some platforms, like Azure, also allow streams to publish in MP4 format. But some demand RTMP settings. It's crucial to check this step before the stream goes live.
When & Where Can You Use HLS Video?
When Apple first released HLS, people viewed the technology with suspicion or hostility. Developers weren't quite sure why they needed new video solutions when those they had seemed to work quite well. Now, the tides have shifted.
Most devices, including both Apple and Android, allow HLS streaming. And according to Mozilla, just one browser type (Opera 20+) won't work with the format. In essence, no matter what program you're running on, the device will work with HLS.
Use the technology for any kind of video you'd like to share live, as it happens. Games and other live events are obvious choices. But you could even live stream intimate events, like dinner parties, to allow people far from the action to join in.
Benefits & Drawbacks of HLS Video
Imagine that you have a live streaming option you love, and you're not sure if you should switch. What should you do? Let's dig into pros and cons to help you make a smart decision.
The benefits of HLS video include:
- Widespread acceptance. If you want to ensure that your video can be seen on as many devices as possible with few hitches, HLS video is a good choice.
- Responsive delivery. If your user hits a spot with low connectivity, the HLS streaming protocol will adjust. The film keeps moving, but the quality downgrades a bit. When the user gets back to a strong signal, the reverse happens. Your user doesn't need to do anything to stay connected.
- Plenty of perks. The HLS protocol includes support for closed captions, paid advertising, and synchronized playback of multiple streams.
Latency is a drawback. Users expect a live video to remain live, and they don't appreciate breaks in the action. At times, HLS video has had lag times of 15 seconds or longer. But a revision to the program in 2019 may have solved this problem.
Should You Start a Stream?
In 2020, we all learned about the benefits of live streaming. When we couldn't leave our homes to gather in person, we tapped into our devices to stay connected with one another in real time.
At Okta, we use live streaming regularly. For example, we record our keynotes and sessions from our Oktane conference and stream them. Did you miss out? Don't worry. We kept copies, and you can watch them here.
Roku: College Basketball Streaming Madness Increased 85 Percent. (March 2021). Media Play News.
Roku SDK Documentation: Audio and Video Support. (April 2019). Roku.
Adobe Flash Player Update Popup Scam. (January 2021). PC Risk.
Working with Channels That Receive Multibitrate Live Stream From On-Premises Encoders. (March 2021). Microsoft.
Introducing Low-Latency HLS. Apple.
Live Streaming Web Audio and Video. Mozilla.