Low latency streaming has become one of the key criteria for the streaming companies to ensure quality streaming experience for the end users. The HTTP live streaming, widely known as HLS, was first introduced by Apple Inc. in 2009. HLS basically refers to an HTTP-based adaptive bitrate streaming communication protocol that plays a crucial role in ensuring the compatibility of the streaming content in diverse browsers, devices, streaming media servers, and media players, to name a few. Owing to its several advantages, the applications of HLS are today widespread in a broad range of industries and sectors.
As stated in a latest report, the HLS streaming usage in the leading industry verticals like art & entertainment, computer electronics & telecommunications, and games are respectively 6.84%, 4.93%, and 4.47%.
The popularity of HLS is growing fast around the globe, and if you are from the streaming industry, then you must have a proper idea on it, or precisely the relevance of low latency streaming with HLS.
Growing number of websites across the world are utilizing HLS more than ever –
If you too want to know why HLS is the go-to streaming protocol and its future, read on till the end of the article.
How Does HLS Work?
To put it simply, HTTP-based live streaming functions similar to adaptive streaming technologies. In adaptive streaming technology, the videos are streamed over HTTP networks while ensuring optimized streaming experience for the end users. In order to offer high quality streaming experience to its end users, it adjusts the video quality accordingly, so that the audience can have an optimized streaming experience irrespective of their device, internet connection, or geographic location.
The HLS streaming protocol can be referred to as a compact process that determines a video format, its compression techniques, and other factors, while it came into the picture as a quality alternative to flash videos. An MP4 video gets divided into shorter chunks of around 10 seconds, created and delivered over the HTTP server. The segmentation takes place after the encoding of the streaming content. This segmentation process is executed by a stream segmenter.
Once the segmentation process is completed, the segmented media is transmitted and received while maintaining a fixed time interval for each of the chunks. During this process, it generates a playlist file of metadata called .m3u8. Through the .m3u8, the segmented file can be accessed from the client devices. A .m3u8 playlist is crucial in indexing and accessing the video chunks.
There are at least three different types of TS files in MPEG-2 media format in the playlist file, which has the m3u8 file extension. A TS file refers to a specific kind of video stream file.
Users download an extended M3U playlist file that has many media file URIs (Universal Resource Identifiers) in it. Each and every media file must be in MPEG-2 TS format. The playlist must be updated with the creation of the MPEG-2 TS file and the generated URIs in order to provide ongoing live streaming.
HLS for Low Latency: A Complete Guide
One of the main reasons why the HLS protocol for streaming has garnered wide popularity is – it ensures a high level of reliability while delivering both on-demand and live videos. To optimize this protocol further, it can be utilized to offer low latency video streaming to your end-users. HLS allows for scalable low-latency video streaming. With the help of the new low-latency mode, broadcast-quality video latencies across open networks are now within reach.
At the live edge of the Media Playlist, HLS offers an alternative channel for delivering media. This channel chunks the media into a greater number of smaller files, like CMAF (Common Media Application Format) chunks. HLS Partial Segments are the name given to these smaller files. Each Partial Segment can be packaged, published, and placed to the Media Playlist considerably earlier than its Parent Segment because of how brief each one is.
Partial Segments, by contrast, can be as short as 200 milliseconds, while conventional Media Segments can last up to 6 seconds each. Only 200 milliseconds after the previous segment publishes, a first Partial Segment might follow, then 29 of its peers, and finally a regular-length, 6-second Media Segment with the same media as the concatenation of its 30 Partial Segments.
The Origin & Evolution of HLS
Apple released a Low Latency HLS protocol enhancement in 2019 that was afterwards known as LL-HLS. The extension provides an Apple-approved and Apple ecosystem-compatible solution to low latency using HLS while maintaining backwards compatibility with standard HLS. Players that do not comprehend the protocol expansion will lag more when playing back the same streams. The change was really pretty straightforward: segments can now be divided into smaller portions that can be downloaded as the larger segment is being built. The 1994-created MPEG-2 standard is intended to provide images of higher quality at larger bit rates. Since MPEG-2 streams at lower MPEG-1 bit rates, it won’t appear as good as MPEG-1, MPEG-2 is not always preferable to MPEG-1.
13818-1, ISO/IEC MPEG2 Transport Stream (MPEG2-TS) is a packet-based media container format for transferring video, audio, and programme data in environments where data loss is likely, such as digital video broadcasting (DVB). This test suite is designed to evaluate the stability and dependability of systems that can decode and handle MPEG2-TS, H.264 video, AC-3 audio, and other program-specific data. A file system interface is required for the test suite to function. It is unable to transmit or parse MPEG2-TS in real time. The necessity for HTTP/2 Push presented the most difficulties in this initial version of LL-HLS. Apple said that this criterion would be diversely accepted by CDNs (Content Delivery Networks) when the protocol update was announced. However, several HTTP/2 characteristics were required by the new protocol extension (including multi stream control, H2 push and H2 ping). Large scalability appeared to be a major concern for the majority of those in the industry because many of the main CDNs were not prepared for this. Additionally, it created new issues for use cases like SSAI (Server-Side Ad Insertion) and content replacement.
Apple revealed an update to the LL-HLS draft standard at the start of 2020. The upgrade eliminated the necessity for HTTP/2 Push and instead introduced a new tag to indicate future segments in response to industry concerns and conflict. The low latency L-HLS community version and the LL-HLS protocol are now extremely similar. Move Networks announced adaptive bitrate streaming (ABS), which is presently being developed and used by Adobe Systems, Apple, Microsoft, and Octoshape. Move Networks received a patent in October 2010 for their adaptive bitrate streaming technology. With adaptive streaming, you can detect the current connection speed and adjust accordingly to send less data when the connection is slow and more data when it is fast.
With ABS, the encoder will immediately alter what it is streaming as the situation changes. A 4K stream will be available to the viewer when they are near a cell tower. They will receive an HD stream as they go further away and so on. The stream adjusts itself constantly to the connection’s changing speed. The standard segment length was 10 seconds when Apple first released HLS. Apple opted to shorten it to 6 seconds since the majority of HLS implementers thought it was too long. By decreasing the segment size and the player’s buffer size, the overall latency can be decreased.
This, however, has significant drawbacks. Increased total bitrate, buffering, or jitter are a few of them for devices with poor network circumstances. The target audience should be taken into consideration while choosing the optimal segment length, which could range from 2 to 4 seconds. LL-HLS has HTTP/2 push set as a requirement on the server side for transmitting fresh data to clients when it was originally released. At the time, this feature was not widely supported by commercial CDN providers, which caused a lot of misunderstanding. Apple fixed this problem in a later release by substituting preload hints for the HTTP/2 push.
Reducing Latency in HLS: All You Need to Know
Now that you have a clear idea on the evolution of HLS, let’s walk you through the best practices to reduce latency in HLS.
Reducing the Segment Time
HLS-based streaming offers high flexibility to lower the latency, as it sends the video in chunks to the receiver. While by default the segment time is 2 sec, one can reduce it further to reduce the overall latency of video streaming.
Lowering the Keyframe Interval
Another effective way to reduce latency in HLS is to reduce the time interval for sending the keyframes. It is recommended to keep the keyframes sending interval at 2 seconds instead of sending it in longer time intervals like 5 or 10 seconds.
Increasing the Number of Video Chunks
You can significantly reduce the latency of your HLS-based streaming by increasing the number of video chunks to create a robust buffer so that even in any possible cases of connectivity issues, the end-users can have seamless streaming experience. You can increase the chunk count to 30 or even more based on the software you are using.
Announcing Segments Beforehand
The goal of this strategy is to lessen the latency that the buffer offset adds. One of the causes of this offset was the requirement for a player to first load the manifest before loading the segment itself in order to fill its buffer. As a result, a player should be as aware of the placement of a segment as possible.
A player can foresee which files need to be loaded by predicting the generation of segments and previously specifying the locations of upcoming segments. The player will know the next segment is accessible as soon as the previous segment has finished downloading since chunked transport allows it to stream out the previous section.
The Bottom Line
HLS-based streaming is quite relevant in the present streaming industry. And to unleash its potential and optimize your end-users’ streaming experience, a competitive live streaming platform like Muvi Live should be your go-to choice.
Not only it offers a compact solution for HLS-based live streaming, but also comes with a lot of other industry-grade live streaming solutions such as built-in customizable CDN, live stream recording, customizable online video player, social media integration, SEO-optimization tools, and many more.
Take a 14-day free trial now to live stream with Muvi Live (no credit card required)!