Understanding HLS.js: Guide and Best Practices
The ultimate guide to HLS.js, with in-depth explanation of working principles, use cases, advantages and disadvantages, code examples, and solutions to common issues.
Read More →Learn MPEG-DASH from scratch and master the core technology of adaptive bitrate streaming
DASH (Dynamic Adaptive Streaming over HTTP) is an internationally standardized adaptive bitrate streaming technology. Developed by the MPEG organization, its official name is MPEG-DASH (ISO/IEC 23009-1), and it is one of the most important technical standards in the streaming media field today.
Unlike traditional streaming media protocols, DASH splits video content into a series of small, HTTP-based file segments, each containing a short period of media data. Players can dynamically select segments of different bitrates based on current network conditions, thereby achieving a smooth playback experience.
To understand how DASH works, you need to approach it from two aspects: its core components and its working process.
The MPD (Media Presentation Description) is the core configuration file of DASH, equivalent to the M3U8 file in HLS. It is an XML format file that describes the organizational structure of the entire media content.
DASH splits video content into multiple small segments (typically 2-10 seconds), each being an independent file. At the same time, the same content is encoded into multiple versions with different bitrates and resolutions, allowing players to choose based on network conditions.
DASH players include an adaptive bitrate (ABR) algorithm that dynamically selects the most appropriate bitrate based on the following metrics:
DASH and HLS are the two most mainstream adaptive bitrate streaming technologies today, each with its own advantages and disadvantages.
| Comparison | DASH | HLS |
|---|---|---|
| Standards Body | MPEG (International Standard) | Apple Inc. |
| Manifest Format | MPD (XML format) | M3U8 (text format) |
| Codecs | H.264/H.265/VP9/AV1, etc. | Mainly H.264/H.265 |
| Segment Format | MP4/WebM/TS | TS/fMP4 |
| iOS Support | Native support in iOS 16+ | Native support in all versions |
| DRM Support | Widevine/PlayReady/FairPlay | Primarily FairPlay |
| Low Latency | LL-DASH standard | LL-HLS |
| Ecosystem Maturity | Mature, widely used | Very mature, most widely used |
For playing DASH content in web pages, the most commonly used solution is the dash.js library. It is an open-source DASH player implementation maintained by the DASH Industry Forum.
If you just want to quickly test a DASH video stream, you can directly use our MPEG-DASH Online Player without writing any code.
If you need to integrate DASH playback into your own website, you can use the dash.js library.
Include the dash.js library via CDN:
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
Add a video element to the page:
<video id="video" controls playsinline></video>
const video = document.getElementById('video');
const mpdUrl = 'https://example.com/stream.mpd';
const player = dashjs.MediaPlayer().create();
player.initialize(video, mpdUrl, true);
player.updateSettings({
streaming: {
abr: {
autoSwitchBitrate: {
video: true,
audio: true
}
},
buffer: {
stableBufferTime: 30,
bufferTimeAtTopQuality: 60
},
lowLatencyEnabled: false
}
});
Shaka Player is another excellent DASH player developed by Google, also open-source and free:
const video = document.getElementById('video');
const player = new shaka.Player(video);
player.load('https://example.com/stream.mpd');
The most commonly used tools for generating DASH content are FFmpeg and GPAC (MP4Box).
The following command can convert an MP4 file to DASH format:
ffmpeg -i input.mp4 \
-map 0 -map 0 -map 0 \
-b:v:0 800k -s:v:0 640x360 \
-b:v:1 1500k -s:v:1 854x480 \
-b:v:2 3000k -s:v:2 1280x720 \
-b:a 128k \
-use_timeline 1 -use_template 1 \
-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
-f dash output.mpd
GPAC's MP4Box is another powerful DASH packaging tool:
MP4Box -dash 4000 \
-rap -frag-rap \
-profile dashavc264:live \
-out output.mpd \
video_360p.mp4 video_480p.mp4 video_720p.mp4 audio.mp4
There's no absolute "better" — it depends on the specific scenario. DASH is an international standard, more flexible, and supports more codec formats; HLS has a more mature ecosystem and better compatibility with Apple devices. Most commercial platforms provide both formats.
Modern browsers don't natively support DASH playback directly, but through JavaScript libraries like dash.js or Shaka Player, DASH playback can be achieved using the MSE (Media Source Extensions) API. Major browsers like Chrome, Firefox, and Edge all support MSE.
Yes. DASH supports both live streaming and video on demand modes. For low-latency live streaming scenarios, you can use the LL-DASH (Low Latency DASH) standard, which can reduce latency to 1-2 seconds.
MPD is DASH's manifest file, using XML format with a more complex structure but more powerful features; M3U8 is HLS's manifest file, using plain text format, which is simpler and easier to read. Both have similar functions, describing the organizational structure of media content.
The DASH standard itself is DRM-agnostic, but it supports common DRM systems including Google Widevine, Microsoft PlayReady, Apple FairPlay, etc. Which DRM systems are specifically supported depends on the player implementation.
As an internationally standardized adaptive bitrate streaming technology, DASH occupies an important position in the streaming media field with its flexibility, codec agnosticism, and powerful features. With native DASH support in iOS 16+, DASH use cases will become even more widespread.
If you want to quickly experience DASH playback, you can directly use our MPEG-DASH Online Player — no code required to play DASH video streams in your browser.
More great articles and useful tools
The ultimate guide to HLS.js, with in-depth explanation of working principles, use cases, advantages and disadvantages, code examples, and solutions to common issues.
Read More →A beginner's guide that teaches you how to watch FLV and RTMP live streams through a web player, including live streaming principles, step-by-step tutorials, and screenshot tips.
Read More →Comprehensive coverage for PC, mobile, and web. Recommends solutions like VLC, PotPlayer, and web-based online players, with troubleshooting methods for common issues.
Read More →Use our free MPEG-DASH Online Player — no code required, play DASH video streams directly in your browser
Try It Now ➡