• 15 November 2024
hls

In the past, Adobe Flash video technology was the primary method of delivering video over the Internet, but in recent years, there has been a significant change in the world of online video. Today, online video is widely replaced by protocols such as HLS Streaming by HTML5 video players. This change is a positive approach for both visiting users and people who play videos.

HTML5 and HLS have open specifications; users can change them according to their needs, and anyone can access them without cost. In addition, the new HTML5 and HLS protocols are more secure, reliable, and much faster than previous technologies.

HTML5 and HLS live streaming have many benefits for content producers. However, they still show some disadvantages in the field of content production. For example, replacing old systems and technologies with new standards, which may not work the same on all streaming platforms, takes time and effort.

What Is HLS Streaming?

HLS actually 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 first launched the HTTP Live Streaming (HLS) protocol in the summer of 2009 and introduced it simultaneously as the first iPhone 3. It was initially developed to be used on the company’s products, but gradually it found widespread and universal application. Previous iPhone models experienced many problems with online media streaming. These problems arose because older devices switched streams between Wi-Fi and cellular networks.

Before the release of HLS, Apple used QuickTime Streaming Server as standard. Although QuickTime was a robust service, it used non-standard ports for data transfer, and firewalls often blocked its RTSP protocol. Of course, the initial test of QuickTime in video streaming technology never reached a broad audience due to the low speed of the Internet, but finally, HTTP Live Streaming was created after major modifications and revisions in QuickTime.

In reports based on streaming latency in 2019, more than 45% of participants stated that they use the HLS protocol for content distribution. The popularity of HLS over its alternatives can be guaranteed by its streaming compatibility and quality of experience. All Mac, Android, Microsoft, and Linux devices can play streams provided using HLS.

One of the advantages of the HLS protocol is that all devices connected to the Internet support HTTP, which makes its implementation easier than protocols that require special servers. Another advantage of an HLS-based stream is that the quality of the video being played can be decreased or increased based on the quality of the Internet, so there would be no interruption in the playback.

Most Common Streaming Protocols

Today there are several video streaming protocols. Some of them are old standards still in use in some cases, while others are rapidly evolving, especially thanks to the open-source community. 

Meanwhile, a few others are relatively new and need improvements to have a strong presence in this area, which naturally takes time but have a lot of potential to change the way we consume video content in the future. Not all video streaming protocols support the same codecs either. Here we describe some of the most common ones that are considered.

Dynamic Adaptive Streaming over HTTP (MPEG-DASH)

MPEG-DASH is one of the latest streaming protocols developed by the Moving Image Specialist Group (MPEG) as a replacement for the HLS standard. This protocol is being developed as an open source that can be customized for any audio or video codec.

Like HLS, MPEG-DASH supports adaptive bitrate playback, allowing viewers to receive the best video quality their network can handle.

WebRTC

WebRTC is an open-source project that aims to provide live audio and video. Originally developed for chat-based applications and VoIP use, WebRTC became popular for use in video chat and conferencing applications after being purchased by Google. Some of today’s most popular consumer apps like Google Meet, Discord, Houseparty, Gotomeeting, WhatsApp, and Messenger all use WebRTC.

WebRTC’s reliance on peer-to-peer, or P2P, streaming is unique. This protocol is also very important for video conference platforms.

Real-Time Messaging Protocol (RTMP)

RTMP is a protocol that was used for a short time. This program was designed by Macromedia (now better known as Adobe) to transfer audio and video files between a streaming server and Adobe Flash Player.

But with Flash being phased out in 2020, it has been used less and less to deliver content to viewers and more to bring live streaming to the platform via RTMP-enabled encoders. This means the video is sent to the streaming platform via the RTMP protocol before being delivered to the end user via the shared HLS protocol.

RTSP

RTSP is another older protocol developed for the entertainment industry. Although it is similar to the HLS protocol, it does not support data transfer independently. RTSP servers must work with RTP and other protocols to perform their broadcast tasks.

While this protocol supports low-latency streaming, RTSP-based streaming may not be compatible with most common devices and browsers. Think of RTSP as a protocol that can deliver a low-latency stream from a dedicated server to a small audience.

Because most IP cameras still support RTSP, it remains the standard for surveillance and CCTV systems.

How Does the HLS Protocol Work?

HLS is an important protocol for live streaming. The live streaming process, which is compatible with a large number of devices and browsers, is roughly similar to the following steps:

  • Recording devices (camera, microphone, etc.) record the content.
  • The content is sent from the recorder to a video encoder.
  • The encoder transmits the content to the video hosting platform via RTMP.
  • The video hosting platform uses HLS to deliver content to an HTML5 video player.

This process requires two main software: HLS live video encoder and a powerful video hosting platform. If you choose to stream with HLS, you should ensure both software offer the protocols and features mentioned. HTML5 video players offered by HLS are perfect for reaching the largest audience as they are ubiquitous worldwide.

HLS Technical Overview

First, the HLS protocol or live stream MP4 video content with the file extension ts. or MPEG2 Transport Stream into short (10-second) segments. Then, an HTTP server stores the streams, and HTTP serves these short clips to viewers on their devices. HLS plays video encoded with H.264 or HEVC/H.265 codecs. Codec is made up of two words coder and decoder. Video codecs are software that compresses and decompress digital videos. A codec takes uncompressed video and converts it to a compressed format, so it takes up less space on your hard drive.

The HTTP server also creates a file containing the M3U8 playlist (in this file, there are addresses and links to access the streaming files), which serves as a source for accessing the video fragments. This way, even if you intend to watch a video with only one quality, the access link to that file will be on this list.

An important question is how playback quality works with HLS video playback. With this protocol, user-specific video player software (such as HTML5) detects worsening or improving network conditions. If either happens, the player software first reads the original playlist and determines which video is playable in ideal quality. The software then loads the file with a specific quality to determine which part of the video corresponds to the point the viewer is watching.

Although this may sound technically complex, the whole process is done quite seamlessly and it  runs in the background. This is just a quick explanation to help you understand what’s happening while watching a video stream.

Which Transport Protocol Is Used By HLS?

It is worth mentioning that TCP and UDP are transport protocols, which means they are responsible for delivering content over the Internet. TCP has the advantage of delivering data more reliably than UDP. However, UDP is much faster, even though some data may get lost.

Since UDP is faster than TCP, some streaming protocols use UDP instead. HLS, on the other hand, makes use of TCP for several reasons:

  • HLS is generally delivered over HTTP, and the HTTP protocol was designed to work with TCP.
  • Internet connectivity was much more reliable and efficient in the early days of streaming than it is nowadays. Today, users are experiencing greatly improved connectivity worldwide, especially with their mobile devices. Therefore, users can receive all of the video frames that they desire.
  • With adaptive bitrate streaming, you can reduce the likelihood of data delivery delays for all TCP packets
  • In contrast to videoconferencing, HLS does not provide a “real-time” experience. For instance, a few seconds of lag before an image becomes visible will not negatively affect the user experience.

Advantages of HLS streaming

Here are some significant advantages associated with HLS streaming:

  • Broadcasters can provide audio or video streams to their viewers most efficiently and conveniently as possible through the adaptive bitrate process supported by HLS that ensures the best quality stream for everyone regardless of their internet connection.
  • The viewer has the option to change the bitrate version at any time.
  • The HLS streaming technology can be accessed using a variety of client software, including iPhones, iPads, iPod touches, Chrome, Safari, and Microsoft Edge platforms for iOS and Android, Linux and Microsoft, as well as macOS.
  • Generally, MPEG DASH is supported by most clients, but some clients, such as Apple Safari and iOS devices, do not support it. Therefore, HLS is the better choice in those cases.

Platforms Supporting the HLS Protocol

HLS was initially limited to iOS devices such as the iPhone, iPad, and iPod but is now supported by other devices and browsers. Here we have listed many platforms that support HLS for you:

  • All Google Browsers
  • Safari Browser
  • Microsoft Edge
  • iOS Devices
  • Android Devices
  • Linux Systems
  • Microsoft Systems
  • macOS Platforms

Therefore, we can say that HLS is a universal protocol.

Comparison of HLS with Other Video Streaming Protocols

Several companies have developed various streaming solutions using media streaming protocols. Each of these solutions generally represents an innovation in video streaming. However, there may be competition among these technologies.

HLS is currently the best choice for streaming media protocols, but it hasn’t always been and won’t be forever. Let’s review several past and current streaming protocols to better understand the innovations the HLS streaming protocol offers today.

Adobe HTTP Dynamic Flash Streaming (HDS)

HDS is specifically designed to be compatible with the Adobe Flash video browser plug-in. Therefore, the overall adaptability of HDS is relatively lower compared to HLS.

Real-Time Messaging Protocol (RTMP)

For decades past, RTMP was the default method of streaming video on the Internet. But with the growth of HLS, we have seen a decrease in the use of RTMP. Even today, most video streaming hosting services work with RTMP encoders to receive live streams via HLS. In other words, broadcasters deliver their streams to their video platform of choice in the RTMP streaming format. 

Finally, OVPs (short for Online Video Platforms) usually provide streams to viewers via HLS. Even in recent years, RTMP streaming has been waning, and more and more CDNs (Content Delivery Networks) refuse to support it.

Microsoft Smooth Streaming (MSS)

This streaming protocol is from Microsoft and is called MSS (Microsoft Smooth Streaming) protocol. Smooth Streaming consists of a live-streaming protocol. It also uses Adaptive Bitrate and provides the best available quality at the moment.

MSS was first introduced in 2008 and was one of the first protocols using adaptive bitrate to be released publicly. The MSS protocol helped broadcast the 2008 Summer Olympics, and the most widely used MSS platform today is the Xbox One. However, MMS is still less popular than HLS.

Dynamic Adaptive Streaming over HTTP (MPEG-DASH)

Finally, the newest streaming protocol format is MPEG-DASH. DASH actually stands for Dynamic Adaptive Streaming over HTTP. MPEG-DASH has several advantages and is the first international standard HTTP-based streaming protocol. This important feature has accelerated the process of widespread adoption of it.

One of the main advantages of MPEG-DASH is that it is a “codec agnostic” protocol. This means that media or video files sent through MPEG-DASH can use various encoding formats.

These encoding formats include extensive support for standards such as H.264 (similar to HLS) and next-generation video formats such as HEVC/H.265 and VP10. Like HLS, the MPEG-DASH protocol is a bitrate-adaptive video streaming method.

When to Use HLS for Online Streaming

The most widely supported and advanced protocol for streaming media on mobile devices is HLS, which is therefore required when streaming media on these devices. You cannot cast media on mobile devices without it. In addition to being the most widely used protocol for streaming media, HLS can be used in the following scenarios:

  • When Streaming to Mobile Devices

HLS ensures the video is played back as quickly as possible across all mobile devices and tablets. Because mobile devices account for approximately 75% of all Internet traffic, HLS is essential to any video streaming service.

  • When Streaming with an HTML5 Video Player

Since native HTML5 videos are not compatible with RTMP or HDS, you will need an HLS player to play native HTML5 videos using these services. These considerations and the ability to view content on mobile devices suggest that HLS is the standard.

  • When Faster Playback Is Required

Not only does the HLS player deliver flawless and robust audio and video quality, but it also supports other live-streaming formats full-time. In summary, HLS streaming technology can offer many benefits, such as adaptive streaming methods that are compatible with multiple platforms and high-speed streaming that can be easily installed on desktops and mobile devices.

Low Latency Streaming with HLS

One major disadvantage to HLS streaming is its relatively higher latency compared to some of the other protocols. This means that HLS streams aren’t quite as “live” as the term implies

A video streamed using HLS can sometimes suffer from delays of up to 30 seconds before it reaches viewers, so they can see the content as closely as possible to what it appears to be live. Therefore, you will need 30 seconds before the video reaches your audience if you stream it.

Since you may be broadcasting a sporting event where people may comment on it, you should avoid a large delay between what is taking place and what viewers will see when they watch the video. Despite this, most broadcasters do not find this an issue with live streams such as a graduation ceremony or a conference, which can usually be handled with a delay of at least a few seconds.

It is possible to reduce latency when streaming HLS video using the Low-Latency CMAF for DASH protocol. Despite delays of this magnitude, this protocol can handle them without causing dissatisfaction among users. It compensates for the poor performance of HLS streaming by utilizing a content delivery network and HTML5 player in conjunction with the protocol.

You may want to consider it, particularly if you broadcast live sports or other events where you do not want to experience a long delay in the video. HLS video streams have some disadvantages, but these tools can solve some of them.

Conclusion

HLS has gained widespread adoption in modern environments because of its high-quality and dynamic audio and video. You should now be more familiar with HLS streaming technology, its operation and mode, and its compatibility with streaming devices. So you can make informed decisions regarding how to up-scale your hybrid and virtual streams using this technology.

If you are interested in learning more about other streaming protocols, you can read Related Posts on this page.

ArvanCloud Video Platform supports the most popular streaming protocols. Visit the page for more information about the platform and sign up for a FREE package of this product.