Introduction to MPEG-DASH and HLS
Two protocols carry most adaptive streaming on the web: MPEG-DASH (Dynamic Adaptive Streaming over HTTP) and HLS (HTTP Live Streaming). Both deliver segmented video over HTTP, but they differ in segment format, codec support, and platform reach. This guide covers how each works, how they compare on latency and efficiency, and how to choose between them — and how CMAF unifies both into one segment set.
Brief History and Purpose
MPEG-DASH was developed by the Moving Picture Experts Group (MPEG) to create a universal format for streaming video content over the web. It is designed to be device-agnostic, ensuring compatibility across a wide range of devices and platforms. The protocol uses HTTP to deliver video segments and is highly flexible, supporting various codecs and container formats.
HLS was developed by Apple and initially launched with the release of iOS devices. It quickly became a standard for streaming live and on-demand video content. HLS uses HTTP to deliver video segments and has become widely adopted across different platforms and devices, especially for iOS and macOS.
A key aspect of both DASH and HLS is how they handle video segments. These segments are smaller parts of the video stream that are delivered independently to the client, allowing for adaptive bitrate streaming.
DASH segments are typically encoded in the ISO Base Media File Format (ISOBMFF), which is also used for MP4 files. This format allows for efficient random access and streaming over HTTP. The segments are usually named with a .mp4 extension and are organized in a directory structure that includes an MPD file.
HLS segments are usually encoded in the .ts (MPEG-2 Transport Stream) format, although newer versions of HLS also support .m4s (Fragmented MP4) segments. These segments are grouped into a playlist file (.m3u8), which provides the client with information about the available segments and their locations.
Manifest Structure
The manifest file is crucial for both DASH and HLS, as it contains metadata about the video content and the available segments.
The MPD file for DASH is an XML document that provides metadata about the video presentation, including information about the video and audio streams, segment URLs, and timing information. Here is a simple example of an MPD file:
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
mediaPresentationDuration="PT0H1M24S"
minBufferTime="PT1.5S"
profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"
type="static">
<Period start="PT0S">
<AdaptationSet>
<SegmentTemplate timescale="1000" media="segment-$Number$.mp4" initialization="segment-0.mp4" />
<Representation id="rep1" bandwidth="1000000" codecs="avc1.42c015" width="640" height="360">
<SegmentList>
<SegmentURL media="segment-1.mp4"/>
<SegmentURL media="segment-2.mp4"/>
<SegmentURL media="segment-3.mp4"/>
</SegmentList>
</Representation>
</AdaptationSet>
</Period>
</MPD>
m3u8 for HLS
The m3u8 file for HLS is a text file that lists the segments and their URLs. It can also include metadata about the stream, such as the codec and bitrate. Here is a simple example of an m3u8 file:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10.000,
segment_00000.ts
#EXTINF:10.000,
segment_00001.ts
#EXTINF:10.000,
segment_00002.ts
#EXT-X-ENDLIST
Codec Support
Both DASH and HLS support a wide range of codecs, but there are some differences in terms of compatibility and support.
Common Codecs
- H.264: Widely supported by both DASH and HLS.
- AAC: Commonly used for audio in both protocols.
- VP9: Supported by DASH but less common in HLS.
- HEVC (H.265): Supported by DASH but less common in HLS, especially on older devices and platforms.
Codec Compatibility
DASH is more flexible in terms of codec support, as it can handle a wider range of codecs and container formats. HLS has historically been more restrictive, especially when it comes to newer codecs and container formats, although this has improved with the introduction of HLSv4 and Fragmented MP4 segments.
Adaptive Bitrate (ABR)
Adaptive bitrate streaming is a key feature of both DASH and HLS, allowing clients to switch between different quality levels based on network conditions.
ABR in DASH
In DASH, the client uses the MPD file to determine the available bitrates and segment URLs. The client can then switch between different representations (bitrates) based on network conditions. The MPD file defines the different representations, and the client can dynamically choose the best representation based on the available bandwidth.
ABR in HLS
In HLS, the client uses the m3u8 file to determine the available bitrates and segment URLs. The client can switch between different streams (bitrates) based on network conditions. The m3u8 file includes a list of available streams and their bitrates, and the client can dynamically choose the best stream based on the available bandwidth.
Both DASH and HLS are designed to provide efficient and low-latency streaming, but there are some differences in terms of performance.
Latency
End-to-end latency depends mainly on segment duration, encoder/packager settings, and low-latency extensions (for example LL-HLS or chunked CMAF), not on the three-letter acronym alone. Traditional HLS deployments often used 6–10s segments, which adds glass-to-glass delay; DASH is frequently packaged with shorter segments but can be configured either way. Modern fMP4 HLS and proper player tuning can achieve similar latency to DASH when settings match.
Bandwidth Usage
Both protocols use adaptive bitrate ladders; efficiency comes from codec choice, segment size, and CDN caching, not from DASH vs HLS labels. MPEG-TS HLS carries slightly more mux overhead than fMP4; compare real manifests rather than assuming one protocol is always “more efficient.”
Adoption and Market Presence
The adoption of DASH and HLS varies across different platforms and devices, and market trends are constantly evolving.
Current Market Trends
DASH is gaining traction due to its flexibility and wide codec support, while HLS remains a popular choice, especially on iOS and macOS. Many platforms and devices support both protocols, and the choice often depends on specific use cases and requirements.
Adoption Rates
- DASH: Increasingly adopted by streaming services and platforms that require wide codec support and flexibility.
- HLS: Widely adopted by Apple and other platforms, especially for live streaming and on-demand content.
Implementing DASH vs HLS
Implementing DASH or HLS requires careful consideration of the technical requirements and the specific use case.
Practical Steps for Implementation
DASH Implementation
- Prepare Video Content: Encode video content into multiple bitrates.
- Generate Segments: Use tools like FFmpeg to generate DASH segments.
- Create MPD File: Use a tool like MP4Box to generate the MPD file.
- Host Content: Upload segments and MPD file to a web server.
- Serve Content: Configure the server to serve DASH content over HTTP.
HLS Implementation
- Prepare Video Content: Encode video content into multiple bitrates.
- Generate Segments: Use tools like FFmpeg to generate HLS segments.
- Create m3u8 File: Use a tool like FFmpeg to generate the m3u8 file.
- Host Content: Upload segments and m3u8 file to a web server.
- Serve Content: Configure the server to serve HLS content over HTTP.
Comparison Table
| Feature |
DASH |
HLS |
| Codec Support |
Flexible, supports H.264, VP9, HEVC, etc. |
Supports H.264, AAC, limited support for newer codecs |
| Segment Format |
MP4 segments (ISOBMFF) |
MPEG-2 Transport Stream (.ts) or Fragmented MP4 (.m4s) |
| Manifest |
MPD file (XML) |
m3u8 file (text) |
| Latency |
Depends on segment length & low-latency packaging; not fixed by MPD alone |
Depends on segment length & LL-HLS / fMP4 setup; not fixed by m3u8 alone |
| Bandwidth Efficiency |
Depends on codec, ladder, and container; often fMP4 |
TS adds mux overhead; fMP4 HLS is common for new stacks |
| Adoption |
Increasingly adopted by streaming services |
Widely adopted by Apple and other platforms |
Conclusion
DASH and HLS are both mature, HTTP-based streaming protocols. DASH offers wider codec flexibility, while HLS has the broadest device and Apple-ecosystem support; latency and bandwidth efficiency depend on your segment settings and packaging, not the protocol name. Pick HLS for maximum reach, DASH for codec flexibility, and reach for CMAF plus low-latency extensions when glass-to-glass delay matters.