What is the HLS Streaming Protocol and How Does it Work?

Written by antmedia | Published 2021/05/13
Tech Story Tags: hls | streaming | live-streaming | live-streaming-video | good-company | video-streaming | video-streaming-platform | html5

TLDRvia the TL;DR App

So, What is HLS? HLS stands for HTTP Live Streaming. In short, HLS is a media streaming protocol for delivering visual and audio media to viewers over the internet. Apple launched the HTTP live streaming (HLS) protocol in the summer of 2009. Apple created the protocol to coincide with the release of the iPhone 3 due to issues with accessing streaming content.  The original iPhone and the iPhone 2 had issues accessing video content due to switching between Wi-Fi and mobile networks while people were watching video content. Before Apple released HLS, most of the early smartphones used Quicktime Streaming Server as their media streaming standard. Quicktime was an important tool; however, it used non-standard ports for data transfer, which resulted in firewalls blocking the RTSP protocol used for the Quicktime streaming server.  These limitations, combined with slow internet speeds in smartphones’ early days, resulted in the end of the Quicktime Streaming Server. HTTP Live Streaming protocol learned from the drawbacks of Quicktime Streaming Service, and the protocol was made so that it wouldn’t get blocked by a firewall. Due to this and many other features, HTTP Live Streaming has become one of the most used streaming protocols.
But, it is necessary to plan this change process well. Although HTML5 protocols are exciting technologies, the transition to HTML5 protocols requires time and effort. As we mentioned, HTML5 standards deeply affected the live streaming world.
In this blog post, you will find the answer to the question of what is HLS streaming, learn the advantages of HLS and its technical information, and at the same time, you will see why you should switch your live streaming solution to HLS.
Let’s dive into the definition of HLS!

What is HLS Streaming Protocol (HTTP Live Streaming)?

So, what is HLS? HLS stands for HTTP Live Streaming. HLS is an adaptive HTTP-based protocol used for transporting video and audio data from media servers to the end-user’s device.
HLS was created by Apple in 2009. Apple announced the HLS at about the same time as the legendary device iPhone 3. Earlier generations of iPhone 3 had live streaming playback problems, and Apple wanted to fix this problem with HLS.
Features of HLS video streaming protocol
  • Closed captions
  • Fast forward and rewind
  • Alternate audio and video
  • Fallback alternatives
  • Timed metadata
  • Ad insertion
  • Content protection

HLS Technical Specifications

  • Audio Codecs: AAC-LC, HE-AAC+ v1 & v2, xHE-AAC, Apple Lossless, FLAC
  • Video Codecs: H.265, H.264
  • Playback Compatibility: It was created for iOS devices. But now all Google Chrome browsers; Android, Linux, Microsoft, and macOS devices; several set-top boxes, smart TVs, and other players support HLS. It is now a universal protocol.
  • Benefits: Supports adaptive bitrate, reliable, and widely supported.
  • Drawbacks: Video quality and viewer experience are prioritized over latency.
  • Latency: HLS allows us to have 5-20 seconds latency, but the Low-Latency HLS extension has now been incorporated as a feature set of HLS, promising to deliver sub-2-second latency.

What is Low-Latency HLS?

Here’s how Apple explained Low Latency HLS:
Low-Latency HLS extends the protocol to enable low-latency video streaming while maintaining scalability. The new low-latency mode lowers video latencies over public networks into the range of standard television broadcasts.

How Does HLS Work?

Now that we’ve answered the question of what is HLS video streaming, we can go one step further. Before comparing HLS with other solutions, it would be better to learn how HLS works.
Image Source: Streaming Media
HLS works like all adaptive streaming technologies. Multiple files are created for distribution to the player, which can adaptively change streams to make the viewer’s experience “perfect”. Since it is an HTTP based technology, no streaming server is required, so all adjustments are made on the player device.
To distribute to HLS clients, the source is encoded into multiple files at different data rates and divided into short chunks(segments of data) which are usually around 10 seconds long. This process is also called segmented delivery. These are loaded onto an HTTP server along with a text-based manifest file with a .M3U8 extension that directs the player to additional manifest files for each of the encoded streams.
Segmented delivery allows the player to shift between different video qualities depending on available resources of viewers’ conditions, while also driving down latency.

RTMP

RTMP is a protocol, created by Macromedia and now owned by Adobe, that provides high-performance transmission of video, audio, and data between dedicated streaming servers and Adobe Flash Player across the internet. RTMP is created for high-performance transmission of media such as audio and video data.
Adobe will stoped updating and distributing the Flash Player. We said above that HLS is the most popular protocol. With the fall of RTMP, this popularity seems to increase even more. 

WebRTC

WebRTC(Web Real-Time Communication protocol) is an open-source standard for real-time communication supported by almost every modern browser, including Safari, Google Chrome, Firefox, Opera, and others. That support ensures that the WebRTC standard remains up to date and functional for the foreseeable future.
Thanks to WebRTC video streaming technology, you can embed the real-time video directly into your browser-based solution to create an engaging and interactive streaming experience for your audience without worrying about the delay. WebRTC provides sub-second delay – 0.5 seconds.
As a result, the HLS streaming protocol is a protocol that every broadcaster should have on one side of his/her mind. 

Written by antmedia | Ant Media provides a scalable and adaptive WebRTC based Ultra Low Latency Video Streaming Platform.
Published by HackerNoon on 2021/05/13