HLS and DASH are both adaptive bitrate streaming protocols, which means they break down video files into small segments, adjusting the video quality to match the viewer’s network conditions.
You might be wondering why someone would choose one protocol over another. The answer depends on your use case. This article will cover key differences and similarities between the protocols so you can make an educated decision as you build your video streams.
In this article, we’ll cover:
- What is adaptive bitrate streaming?
- What’s the difference between HLS and DASH?
- Comparing HLS and DASH: Pros and cons
- Playback support
What is adaptive bitrate streaming?
Adaptive bitrate streaming (ABR) is a technique used for streaming video, intended to create a better viewer experience. Both HLS and DASH are adaptive bitrate streaming protocols.
ABR adjusts the video properties—like resolution and video quality—based on factors like the viewer’s network connection or device type. In short, ABR creates multiple versions of a video with different resolutions and bitrates. It then serves up the version of the video that aligns with their network conditions, while maintaining the best user experience possible with less buffer time or interruptions.
What’s the difference between HLS and DASH?
Although both HLS and DASH both take a similar approach with adaptive bitrate streaming, there are a few key differences:
HTTP Live Streaming (HLS), is the most common format for streaming video. HLS was originally created by Apple, but is also supported on all major devices, operating systems, and browsers. Its low-latency option, low-latency HLS (LL-HLS) is seen as the standard for low-latency live streaming, particularly for large, distributed audiences.
Dynamic Adaptive Streaming over HTTP (DASH), also known as MPEG-DASH, has a few subtle differences to HLS. MPEG-DASH was created by the company Moving Pictures Expert Group (MPEG). It uses XML as a manifest format instead of the text-based m3u format. The specifics of how the DASH manifest tells the player where to find each segment file is a little different. Instead of linking to each segment specifically, the DASH manifest supplies a "SegmentTemplate” value that tells the player how to calculate the specific link for each segment. DASH is not supported on Apple devices or Apple browsers. It also relies on different codecs and takes a different approach to low latency with low-latency DASH (LL-DASH).
If you've made it this far, you might be interested in the Mux Video API to utilize HLS.
Learn more about Mux VideoTechnical specifications: HLS vs. DASH
Feature | HLS | Dash |
---|---|---|
Developed By | Apple | MPEG (Moving Picture Experts Group) |
Standardized By | IETF | IETF |
Release Date | 2009 | 2011 |
File Extension | .m3u8 (playlist), .ts (transport stream segments) or .m4s (fragmented mp4) | .mpd (manifest), .m4s/.mp4 (segments) |
Transport Protocol | HTTP | HTTP |
Adaptive Bitrate | Yes | Yes |
Codec Support | H.264, H.265, AAC, AC-3, E-AC-3 | Any codec, commonly H.264, H.265, VP9, AV1, AAC |
Encryption | AES-128, FairPlay | AES-128, Widevine, PlayReady, FairPlay, ClearKey |
Latency | Typically higher (6-30 seconds) | Lower latency achievable (2-10 seconds) |
Compatibility | iOS, macOS, tvOS, Android natively. Modern browsers with inclusion of javascript libraries like Hls.js and Http-streaming. | Android natively Modern browsers with the inclusion of a javascript library like Dash.js |
Manifest Format | Text-based (.m3u8) | XML-based (.mpd) |
Segment Format | MPEG-TS or Fragmented MP4 | ISO BMFF (Base Media File Format) |
Live Streaming | Supported | Supported |
Time-shifted Viewing | Supported | Supported |
Subtitles/Closed Captions | WebVTT, CEA-608 | WebVTT, TTML, CEA-608 |
Ad Insertion | Client-side and server-side | Client-side and server-side |
DRM Support | FairPlay | Widevine, PlayReady, FairPlay, ClearKey |
Comparing HLS and DASH: Pros and Cons
When choosing between HLS or DASH, it’s helpful to review the pros and cons for each protocol. While the protocols are very similar, there are some nuances that could impact your specific use case.
Pros of HLS
- HLS players are available on major platforms: HLS is an industry-standard format and can play almost everywhere. Some examples of HLS web players are Mux video element, HLS.js, and Plyr.io.
- Uses common video formats: HLS uses existing video formats like MP4, TS, codecs like H.264, and AAC.
HLS is more scalable than other protocols: Because HLS works over HTTP, you don’t need to run special servers (unlike old-school RTMP or the newer WebRTC protocol), making it easier to scale.
Cons of HLS
- Higher latency: Historically, both Apple prioritized stream reliability over latency, which meant that streams were slower. When Apple introduced Low-Latency HLS (LL-HLS), Apple’s low-latency mode for HLS streams, this solution mitigated some of these concerns.
- Primarily uses FairPlay for digital rights management (DRM): This restricts the ability to convert your videos into other formats.
- Narrower codec support: HLS supports a shorter list of codecs, while DASH supports most codecs. If you want to leverage codecs like VP9 or AV1, you are better off using DASH.
Pros of DASH
- Wide codec support: DASH supports most codecs, giving engineering teams more flexibility and choice when it comes to building streams.
- Flexible manifest format: DASH uses a manifest file called Media Presentation Description (MPD), which provides detailed information about the video content. The player uses this information to select and display content at different bitrates.
- Broad DRM support: DASH has more native support for a variety of DRM systems, while HLS primarily uses FairPlay. This provides more flexibility to convert videos into other formats.
- Lower latency: Historically, DASH streams tend to have lower latency than HLS, but with the release of Low-Latency HLS (LL-HLS), DASH is no longer the clear winner in this category.
Cons of DASH
- Not supported natively by the Apple ecosystem: DASH is not supported by Apple devices or browsers, which means that it’s not supported by widely-used devices like iPhones and Macs, in addition to Safari. This means you miss out on a large share of users or you require using extra libraries to add support.
- More fragmented ecosystem: DASH is more customizable than HLS, but this comes at a cost. The ability to pick and choose codecs and video providers means that when things go wrong, there is not always a clear solution or documentation to guide you.
HLS and DASH playback support
Playback refers to how a player processes video data. Although HLS and DASH are both adaptive bitrate protocols, they approach playback slightly differently.
HLS
HLS playback is supported natively on Apple devices via Safari on Desktop, iPadOS and iOS and via AVPlayer for native iPadOS, iOS and TVOS applications. For other browsers HLS support requires extra Javascript such as Hls.js or http-streaming.
HLS playback is supported natively on Android applications via ExoPlayer and Media3.
DASH
Dash playback is supported natively on Android applications via ExoPlayer and Media3. Dash playback on iOS native apps requires a 3rd party library and Dash playback in all browsers requires extra Javascript such as dash.js.