HLS, M3U8 and DASH
HLS vs M3U8 vs DASH: one table answers it
The three names get used as if they compete, and they don't. HLS is a protocol, M3U8 is the playlist file that protocol uses, and DASH is the other protocol, with MPD as its manifest.
Once that's separated, the rest of the questions answer themselves: which extension you get, which content type the server should send, and which platform needs which one.
The short version
HLS (HTTP Live Streaming) is Apple's protocol for delivering video as a sequence of small files over ordinary HTTP. It is what your CDN caches and what a player fetches segment by segment. Its manifest is an M3U8 playlist.
DASH (Dynamic Adaptive Streaming over HTTP) is the open-standard equivalent, standardised by MPEG and used widely in browsers and on Android. Its manifest is an MPD file written in XML.
An M3U8 file therefore isn't a format that competes with HLS: it's the part of HLS you can open in a text editor. Saying "m3u8 stream" is shorthand for "HLS stream whose playlist I can see".
The same stack at four levels
| What you are looking at | HLS | M3U8 | DASH | MPD |
|---|---|---|---|---|
| What it is | Streaming protocol | HLS playlist file | Streaming protocol | DASH manifest file |
| Owner | Apple, published as an RFC | Apple, part of the HLS spec | ISO/IEC MPEG | ISO/IEC MPEG, part of DASH |
| File extension | n/a | .m3u8 | n/a | .mpd |
| Media segments | .ts or fragmented .mp4 | lists them | .m4s or .mp4 | lists them |
| Content type | n/a | application/vnd.apple.mpegurl | n/a | application/dash+xml |
| Native playback | Safari, iOS, tvOS, most TVs | n/a | Limited, usually via dash.js | n/a |
| DRM signalling | EXT-X-KEY and EXT-X-SESSION-KEY | in the playlist | ContentProtection elements | in the manifest |
What an m3u8 file contains
A playlist is a list of lines, most of them tags that start with #EXT. The tags that matter when something won't play are the ones describing duration, the end of the stream, encryption and byte ranges, because a player reading them wrong produces exactly the failure the viewer sees.
A minimal master playlist, annotated
Two quality variants, both pointing at their own media playlist. A player reads the BANDWIDTH attribute to build its adaptive ladder before it fetches anything else.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360,CODECS="avc1.4d401e,mp4a.40.2"
360p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720,CODECS="avc1.4d401f,mp4a.40.2"
720p/index.m3u8
Tags that explain most playback failures
| Tag | What it does | What goes wrong without it |
|---|---|---|
| #EXTINF | Duration of the next segment, in seconds | Seeking and the timeline are wrong |
| #EXT-X-TARGETDURATION | Longest segment duration, rounded up | Strict players reject the playlist |
| #EXT-X-ENDLIST | Marks the stream as VOD | A finished stream is treated as live and never ends |
| #EXT-X-KEY | Encryption method and key URI | Playback stops at the first encrypted segment |
| #EXT-X-MAP | Initialisation segment for fMP4 | A fragmented MP4 stream is undecodable |
| #EXT-X-PART and SERVER-CONTROL | Partial segments and LL-HLS hints | Low-latency playback falls back to normal latency |
The content type matters more than people expect
A playlist served as text/plain looks fine in a browser and can still fail in a player, because the client checks the response type before parsing the body. Send application/vnd.apple.mpegurl for M3U8 and application/dash+xml for MPD, and check what the CDN returns rather than what the origin was configured to return. A CDN rule that rewrites content types is a common cause of a stream that plays from the origin and not through the edge.
The playlist inspector shows the content type it actually received alongside the parsed playlist, which is faster than guessing.
Why Safari needs both, and Chrome needs both
Safari and iOS decode HLS natively and have no DASH support, so an HLS package is the only route to an Apple device. Chrome, Edge and Firefox have no native HLS either, but they do expose Media Source Extensions, which is what hls.js and the Bradmax player use to play HLS and DASH alike.
That's why most operators publish both manifests from the same source: HLS for Apple and television platforms, DASH where it is cheaper to package for the devices that only accept it. A player that handles both keeps that decision in the manifest rather than in your application code.
Native playback by platform
| Platform | HLS native | DASH native |
|---|---|---|
| Safari, iOS, tvOS | Yes | No |
| Chrome, Edge, Firefox desktop | No, needs hls.js | No, needs dash.js |
| Android Chrome and Android TV | No, needs hls.js | No, needs dash.js |
| Samsung Tizen and LG webOS | Usually, model dependent | Rarely |
| Roku, Fire TV | Yes | Model dependent |
Where to go next
Frequently asked questions
Is M3U8 the same thing as HLS?
Not quite. HLS is the protocol: the rules for splitting a stream into segments and playing them over HTTP. M3U8 is the playlist file that HLS uses to describe those segments. Every HLS stream has an M3U8 playlist, but "M3U8" alone says nothing about how the video is encoded or where it is served from.
Is an M3U8 file a video file?
No. It's a text file, usually a few kilobytes, that lists other files. A master playlist lists the quality variants and their bandwidths, and each variant is another playlist listing the actual segments with their durations. Open one in a text editor and you can read every line.
Which is better, HLS or DASH?
HLS has the wider device coverage, because Apple platforms play it natively and the rest of the market follows. DASH is an open standard with more flexible DRM signalling and is common in browsers through dash.js. In practice most operators package both from the same mezzanine file and let the player pick, so the question is packaging cost rather than one format being better.
What content type should an M3U8 be served with?
application/vnd.apple.mpegurl is the registered type for an HLS playlist, and application/x-mpegURL is the older alias that still works. A DASH MPD is application/dash+xml. Serving a playlist as text/plain is a real cause of players refusing to load it, because some clients check the type before they parse the body.
Can I convert an M3U8 to MP4?
Only by downloading the segments and remuxing them, which is a different job from playing the stream. ffmpeg can read an HLS URL directly and write an MP4, and the ffmpeg command generator shows the flags. Note that an encrypted HLS stream can't be converted without its keys.