HLS vs WebRTC: Comparing Two Video Streaming Protocols

Streaming video has become an integral part of our daily lives, from watching our favorite shows on Netflix to live concerts on Amazon Prime to shoppable videos and watching the ponies run in real-time.

When it comes to streaming video content, there are a variety of protocols and technologies available. Two popular options are HLS (HTTP Live Streaming) and WebRTC (Web Real-Time Communication). Both have their own strengths and weaknesses, and understanding the differences between them can help you determine which is the best fit for your streaming needs.

In this article, we'll compare HLS and WebRTC streaming, looking at their features, use cases, history and performance to help you make an informed decision.

 

Table of Contents

  1. HLS vs WebRTC
    1. What is HLS?
      1. How does HLS work?
      2. Pros & Cons of HLS
    2. What is WebRTC?
      1. How does WebRTC work?
      2. Pros & Cons of WebRTC
    3. What is Phenix ITP?
      1. How does Phenix ITP work?
      2. Pros & Cons of Phenix ITP
    4. Use Cases for Phenix ITP, HLS and WebRTC
      1. Phenix ITP Use Cases
      2. HLS Use Cases
      3. WebRTC Use Cases
  2. Performance Comparison
    1. Latency
    2. Scalability
    3. Adaptability
    4. Monetization
  3. WebRTC vs HLS: How They Differ
    1. HLS
    2. WebRTC & Phenix ITP
  4. Conclusion

 

 

HLS vs WebRTC

HLS, the pioneer in the streaming world, made its debut in 2009, followed by the release of WebRTC in 2011. Despite their frequent comparison, these two technologies were created for entirely different purposes. And to this day, the trade-off between scale and low-latency remains a crucial consideration in the streaming industry.

Considering their unique origins and initial purposes, it comes as no surprise that HLS and WebRTC deliver audio, video, and data in fundamentally different ways.

What is HLS?

HLS is an adaptive streaming protocol developed by Apple for delivering live and on-demand video content over the internet. It uses HTTP to deliver video segments, making it compatible with most web servers and content delivery networks (CDNs).

HLS boasts a robust infrastructure that ensures quality for every viewer, but this comes at the expense of latency. Latencies for HLS streams typically range from 15 to 90 seconds, which was acceptable in the past when there was no alternative, but becomes increasingly problematic as technology advances.

How Does HLS Work?



HLS works by breaking video content into small segments, typically between 2-10 seconds in length. These segments are then delivered to the viewer's device via HTTP requests. The video player on the device then reassembles the segments to play the video seamlessly.

HLS also uses a manifest file, called a “m3u8” file, which contains information about the video segments and their URLs. This allows the player to request the appropriate segments and switch between different quality levels based on the viewer's internet connection.

Pros and Cons of HLS

Pros:

  • Compatible with most devices and browsers
  • Easy to implement and integrate with existing web infrastructure
  • Supports adaptive streaming for a better viewing experience
  • Can handle high traffic and scale easily with CDNs
  • Can be used for both live and on-demand streaming

Cons:

  • High latency
  • Not suitable for real-time applications
  • Not a suitable choice for interactivity and two-way communication

What is WebRTC?

WebRTC, on the other hand, was designed as a real-time, ultra low latency video streaming solution for web-based video conferencing, and data sharing, without the need for additional downloads. It is an open project that developers can customize to their needs. However, when WebRTC ventures into the realm of HLS, scale and quality become challenging to achieve.

WebRTC is an open-source technology that enables real-time communication between browsers and mobile applications. It was developed by Google and is now supported by all major browsers, including Chrome, Firefox, and Safari.

How Does WebRTC Work?

WebRTC allows for both client to server and client to client (aka peer to peer, or P2P) connections between the viewer's device and the streaming server or video conferencing peer. This allows for low latency and real-time communication, making it ideal for applications where interactivity is required such as video conferencing and online gaming.

Pros and Cons of WebRTC

Pros:

  • Low latency for real-time communication
  • Suitable for interactive applications
  • Can be used for both peer-to-peer and server-based streaming

Cons:

  • Limited support for older browsers and devices
  • Some features may depend on vendor specific implementations
    • Adaptive bitrate streaming
    • Ability to handle scale

 

Phenix Implementation of WebRTC

Recognizing the power of WebRTC to revolutionize interactive viewing experiences that drive engagement, Phenix has designed a cutting-edge video streaming architecture that guarantees broadcast quality and scalability without compromising on latency. 

How Does Phenix ITP Work?

Phenix's Interactive Transport Protocol (Phenix ITP) is Phenix's implementation of WebRTC and was designed from the ground-up to handle a scale that historically evaded WebRTC, while maintaining W3C WebRTC standard compliance.  Unlike the open source project spearheaded by Google for video conferencing applications, Phenix ITP was intentionally designed for broadcast media use cases at scale and has been optimized for quality, throughput, latency, and synchronization.

Phenix ITP offers a variety of features that extend beyond the boundaries of standard WebRTC, such as: Geoblocking, Token Authentication, Multi-Angle Sync, Global Audience Synchronization, Server Side Ad Insertion (SSAI), and Digital Rights Management (DRM).  

Phenix manages complete audience synchronization through its patented Phenix SyncWatch™ technology; supports adaptive bitrate (ABR) streaming to broadcast-quality streams to the player, without latency or caching; and employs dynamic forward-error correction (FEC) when communicating with compatible endpoints.

As Phenix continues to innovate, the company's newest feature includes the industry's first available server side ad insertion (SSAI) delivered in real-time without sacrificing latency. 

Pros and Cons of Phenix ITP

Pros:

  • Real-Time, ultra low latency for real-time interactivity
  • Supports adaptive streaming for a better viewing experience
  • Highly scalable with proven production deployments of 500,000 concurrent viewers
  • Advanced AI adjusts for loads to accommodate rapid join rates
  • Monetization with real-time SSAI 

Cons:

  • Limited support for older browsers and devices
  • Not suitable for Video On-Demand

Use Cases for Phenix ITP, HLS and WebRTC

Phenix ITP, HLS and WebRTC have different strengths and are better suited for different use cases. Let's take a look at some common scenarios where each protocol excels.

Phenix ITP Use Cases

  • Live streaming: Phenix ITP is ideal for live streaming events like sports and concerts, which drive next-gen fan engagement with less than ½  second video latency.
  • Interactive streaming: Phenix ITP allows for two-way communication, making it suitable for interactive streaming applications, such as live shopping and multi-angle viewing.

HLS Use Cases

  • Video on demand (VOD) services: HLS is ideal for delivering on-demand video content, such as movies and TV shows, to a large audience.
  • Live streaming where latency is not important.  For example FAST channels of VOD assets such as sitcoms and other kinds of pre-recording content.

WebRTC Use Cases

  • Real-time for Small Group: Traditional WebRTC implementations are perfect for applications that require low latency for smaller audiences, such as video conferencing.
  • Peer-to-peer streaming: WebRTC's P2P connection makes it ideal for streaming to a small group of viewers without the need for a central server.

Performance Comparison

When it comes to video streaming, performance is a crucial factor to consider. Let's compare the performance of Phenix ITP, HLS and WebRTC in terms of latency, scalability, and adaptability.

Latency

Latency refers to the delay between when a video is captured and when it is displayed on the viewer's device. Lower latency means a shorter delay, resulting in a more real-time viewing experience.

  • Phenix ITP and WebRTC have latencies of <½ second, making it ideal for real-time video streaming and interactive streaming applications.
  • HLS has a higher latency compared to WebRTC, with an average delay of 10-90 seconds. This makes it less suitable for real-time applications, where low latency is crucial.

Scalability

Scalability refers to a streaming protocol's ability to handle high traffic and scale to a large number of viewers. This is an important factor to consider for popular live events or large-scale streaming services.

Phenix's ITP is WebRTC compliant, but was designed and built for broadcast scale.  Rather than using open source components, Phenix built something designed for broadcast scale.  Fully autonomous scalable infrastructure with 34 points of presence (PoPs) can reach millions of concurrent viewers globally and brings proven experience delivering video to 500,000 concurrent viewers.

HLS is highly scalable, thanks to its use of CDNs. This allows for efficient distribution of video segments to a large number of viewers, making it suitable for high traffic events.

Conventional WebRTC using open-source libraries and media servers are typically not as scalable as HLS. The open source projects are mostly built for small scale video conferencing use cases and don't scale up well to broadcast scale interactive media use cases because they rely heavily on peer-to-peer (P2P) networking.

Adaptability

Adaptability refers to a streaming protocol's ability to adjust video quality based on the viewer's internet connection. This is important for a smooth viewing experience, especially for viewers with slower internet speeds.

Phenix has a patented approach to real-time adaptive bitrate transcoding that continuously monitors network conditions and dynamically inserts keyframes as needed for faster and more intelligent switching between resolutions and bitrates to maintain broadcast quality video on a global scale. 

HLS supports adaptive streaming, allowing for seamless switching between different quality levels based on the viewer's internet connection. This ensures a better viewing experience for all viewers, regardless of their internet speed. Switching layers in the multi-bitrate ladder can only happen on fragment boundaries, typically every 2-10 seconds. However, with a large local buffer and 10-90 seconds of end-to-end latency this granularity is not a problem.

WebRTC doesn't have any built-in mechanism for adaptive bitrate video streaming.

Monetization

In industries like Media and Entertainment, the ability to generate revenue through advertising is table stakes. With its extensive viewership, loyal audience, and potential for profitable advertising income, the distribution rights for live sports and entertainment have become a valuable asset within the media and entertainment sector. Let's compare the monetization strategies available when using Phenix ITP, HLS and WebRTC.

Phenix ITP

Phenix ITP is able to insert server-side ads while maintaining video streaming latency of less than ½ second.  Their patent protected approach supports the industry-standard VAST protocol to deliver personalized ad content decisions and ad reporting information.

HLS

HLS is able to insert server side ads with the typical video streaming latency for HLS.

WebRTC

Conventional WebRTC implementations do not have the ability to insert ads. 

WebRTC vs HLS: How They Differ

HLS

HLS divides streaming data into "chunks," typically ranging from 2 to 10 seconds, which are then transmitted to and received by the end user. This enables an HLS stream to have varying qualities for each individual chunk: your first 10 seconds may come in 720p HD, but your connection gets worse so your second chunk may get delivered in 360p. 

Each chunk can change based on different variables, often leading to a better viewing experience for the end user.  However, viewers are starting to find the latency of HLS streams to be increasingly unacceptable.



Feature

HLS

WebRTC

Chunk or Packet duration

2 to 10 sec.

1 frame, typically about 1/30 second.

Bitrate adaptation time

2 to 10 sec.

Less than 100ms.



WebRTC & Phenix ITP

On the other hand, WebRTC takes a different approach by sending packets instead of chunks. These packets can be thought of as very tiny chunks, with each packet having a maximum size of 1200 bytes. 

A smaller client-side buffer allows for a much faster stream startup time and requires an ABR algorithm that can operate at a much higher frequency that traditional ABR algorithms. The use of packets and frame-based video delivery rather than small video files is a crucial aspect of what enables WebRTC to deliver real-time communication. 

Conclusion

In conclusion, both HLS and WebRTC have their own strengths and are better suited for different use cases. HLS is ideal for on-demand video streaming, while WebRTC is better suited for real-time communication and interactive streaming. Phenix ITP is best suited for use cases where interactivity and a fully-synchronized viewing experience are important.

When it comes to performance, HLS has higher latency but is highly scalable and supports adaptive streaming. Traditional WebRTC, on the other hand, has lower latency but is less scalable and may require additional infrastructure for large-scale streaming.

Phenix ITP was developed to maximize the advantages of both HLS and WebRTC. It offers real-time video streaming with less than ½ second latency to broadcast-sized audiences and was designed as part of an overall architecture intentionally designed and built for real-time video streaming at broadcast scale.

Ultimately, the best choice for your streaming needs will depend on your specific use case and requirements. By understanding the differences between Phenix ITP, HLS and WebRTC, you can make an informed decision and choose the best streaming protocol for your needs.