HTTP Live Streaming (HLS): Why It’s the Best Protocol for Video Streaming

Written by imgix | Published 2023/03/10
Tech Story Tags: video-streaming | video-optimization | web-performance | web-development | hls | front-end-development | good-company | adaptive-bitrate-streaming

TLDRIf you host longer-form videos, bespoke videos, or just post videos in unique channels like native apps or games, it's best to have control over video delivery and end-user experience. HTTP Live Streaming (HLS) is a great way to encode, stream and manage for the best streaming quality while controlling the viewing experience.via the TL;DR App

Imagine seeing a photo of a tropical beach resort on a travel website. Enticing? How about a video — the gentle waves wash ashore as the camera pans and zooms in on a vacationer sipping a Mai Tai? The sounds and the motions would make it even more irresistible.

While images continue to be vital for online businesses, videos’ popularity is growing exponentially:

  • Consumers are now watching almost twice as much video than they did in 2018, according to Hubspot.

  • 96% of consumers have watched an explainer video to learn more about a product or service.

With the proliferation of content from brands, it’s no surprise that users demand an excellent viewing experience: uninterrupted video streaming at the highest possible resolution on any device, anywhere.

Why You Shouldn’t Use YouTube

Many websites use YouTube as a free hosting service for their videos because of its broad reach, user-friendly interface, and analytics.

However, this approach has downsides:

  1. For example, after watching your video, visitors might see your competitors' videos or other unrelated content, which can negatively impact your conversion rate.
  2. Additionally, when your video plays on a free video player or site like YouTube, your brand's watermark or logo competes with the host's, which can harm your brand equity.
  3. Finally, YouTube is designed to generate as many views as possible for a wide variety of content, and your video is just one stepping stone on a path to someone else's content. To achieve your goals of keeping visitors on your website, experiencing your branding, and making a purchase, it's best to avoid using free services like YouTube for hosting your videos.

https://youtu.be/W1Ksk4uWa8I?t=230&embedable=true

Enter Adaptive Bitrate Streaming (ABS)

The key technology to achieve better video streaming is adaptive bitrate streaming (ABS). Adaptive streaming is about recognizing the connection speed at any given moment and responding accordingly — sending less data when the connection is slow and more data when the connection is fast. This recognition and response is the magic of ABS and is a key to the optimal viewing experience, regardless of the viewer's environment.

It’s superior to Progressive Download in many ways:

  • Better user experience: By adjusting the quality of the video stream based on the viewer's internet connection speed and device capabilities, ABS ensures the viewer gets the best experience, without buffering or interruptions.
  • Lower latency: The video player can quickly switch to a lower bitrate stream when the viewer's internet connection slows down.
  • More efficient use of bandwidth: Adaptive bitrate streaming uses only as much bandwidth as is necessary to deliver the video stream, whereas Progressive Download requires the entire video file to be downloaded before playback can begin.
  • Support for multiple devices and screen sizes.

HTTP Live Streaming (HLS): The Gold Standard for Adaptive Bitrate Streaming

If ABS is the leading category for video streaming, HTTP Live Streaming (HLS) is the leading protocol within this category.

HLS takes care of ABS and delivers a lot more:

  • Most modern operating systems support HLS, meaning it works with virtually every smartphone, tablet, laptop, desktop TV, and connected device on the market.
  • Its HTML5 compatibility means it’s easy for developers to integrate new apps and features.
  • Because it’s the de facto standard, site visitors don’t need to invest in different devices and apps to watch content, and providers can use off-the-shelf web servers. It is, by far, the most cost-effective streaming protocol available. For these reasons, HLS is now the most common and many developers’ favorite streaming protocol on everything from mobile apps to 4K TVs.

https://www.youtube.com/watch?v=QDOBiyan1HE&t=12s&embedable=true

The History of HLS

Apple came out with the HLS protocol, a method for transmitting video content between web servers and client devices, in 2009 after it decided to move away from Flash. The new protocol became the default for iOS, Mac OS, and Apple TV. It was entirely compatible with HTML5, and although its acronym includes “live” streaming, it worked for any video on demand. Given these characteristics, it does not surprise it slowly but surely became the global standard in video streaming protocols.

How Does HLS Work Exactly?

Web servers typically use the HTTP protocol to serve content over the internet, and HLS works by breaking video files into short chunks delivered over HTTP.

Here’s a step-by-step of what’s involved:

  1. When the user starts to stream a video, the web server responds by lining up the media file for transcoding.
  2. The encoder reformats and compresses the video file into small chunks, typically a few seconds long, as needed to support the target device.
  3. Using the HLS protocol, the web server segments the video file into short chunks and creates a manifest file that lists the available segments.
  4. The web server creates a manifest (playlist) of all the segments.
  5. HLS creates multiple files of the segments for Adaptive Bitrate Streaming, each for a different resolution quality: SD, HD, 4K, etc.
  6. Ideally, a content delivery network (CDN) pushes cached segments to request devices. The CDN typically uses a worldwide network of servers to enable a geographically-close source for faster downloads.
  7. The requesting device's player uses the manifest file to request the appropriate video segments for the selected quality and puts them together for display.

The Future of Video Streaming

It might be a cliché, but 5G is truly going to change everything. Where there’s coverage, 4K videos will download in a snap with speeds more than 10x faster than existing 4G. And 5G is what brings out the potential of edge computing by bringing the most powerful processing capabilities closer to the end user.

You might have some time before the experiences of the future become a fact, but when it comes to high-quality video streaming, the time to act is now. Think about it: if one picture is worth a thousand words, one video is worth an untold number of static images. And online consumers want the richest user experience possible. Your audience demands an excellent user experience: uninterrupted video streams at the best possible resolution on any kind of device. That’s why working with a robust image and video processing solution like imgix is imperative to delivering this type of experience.

Check out the following resources to learn more about video streaming and see how imgix can help you manage, optimize, and deliver all your visual media:


Written by imgix | imgix transforms, optimizes, and delivers your visual media for faster pages, higher engagement, and a simpler workflow.
Published by HackerNoon on 2023/03/10