Restreaming an MPD to HLS takes one command with m314dl, an open source downloader for HLS and DASH. It turns a DASH .mpd into a live HLS .m3u8 and decrypts with the key you already hold. There's no re-encode, and no ffmpeg runs on the HLS path:
Then open http://localhost:8314/live.m3u8 in VLC, mpv, hls.js or any other HLS player.Code:m314dl -serve :8314 -key KID:KEY https://example.com/manifest.mpd
Why "mpd to hls" kept getting workaround answers
I keep seeing the same question in this section: I have a DASH manifest (an .mpd, often with keys I already hold) and I need it as an .m3u8 so VLC, a set-top box or an HLS web player can play it.
These are the answers I've seen:Here is one of those threads from 2021 where the live case never got a working answer.
- "Not possible, the formats are different."
- "Download it with yt-dlp, decrypt with mp4decrypt, join with mkvtoolnix." That gets you a file on disk, but the question was about a stream.
- "You need a server running custom software."
DASH and HLS carry the same fMP4 segments. Only the manifest is different, so a packager can take the segments a DASH feed delivers and list them in an m3u8 instead. The hard part has always been the encryption. Every segment has to be decrypted before a player will show it. Doing that per segment with mp4decrypt in a shell loop and then feeding the result to ffmpeg is where the scripts and the babysitting come from.
How the DASH to HLS restream works
Live and VOD both work:
- m314dl downloads the DASH segments like a normal downloader.
- It decrypts each fragment in RAM as it arrives. It supports cenc, cbcs, cens and cbc1, written from the ISO spec and checked byte for byte against mp4decrypt.
- It republishes the segments as an HLS playlist with fMP4 segments and an EXT-X-MAP init segment.
- Nothing is re-encoded or remuxed, so the segments are byte-identical to the source.
- The source is fetched once. Every viewer is served from one shared window with Range and ETag support, so ten viewers don't mean ten pulls from the origin.
- Live MPD: you get a rolling live HLS window, which is what channel restreaming needs.
- VOD MPD: you get a growing playlist that you can seek in while it downloads. It gets EXT-X-ENDLIST when the download finishes.
MPEG-TS and DASH output
It's the same command with one more flag:
TS output from an fMP4 source is the only case that uses ffmpeg. A single long-lived ffmpeg process copies the already-decrypted tracks into TS. It's a stream copy, not a transcode, unless you ask for one with -serve-transcode. One process runs for the whole stream. Its input is already clear, so you don't get the memory growth people run into when they point ffmpeg at encrypted input.Code:# one continuous MPEG-TS at /live.ts, for VLC, set-top boxes and anything that wants a plain TS m314dl -serve :8314 -serve-format ts -key KID:KEY https://example.com/manifest.mpd # live DASH at /live.mpd (dash.js, Shaka, ExoPlayer), for example to publish a clear copy m314dl -serve :8314 -serve-format dash -key KID:KEY https://example.com/manifest.mpd
Picking tracks and passing headers
- -list: prints what the manifest offers.
- -sv / -sa: select video and audio (best, worst, a resolution or codec regex, a language).
- -H: adds a header. Or use -curl to paste a "copy as cURL" command from the browser.
Many channels from one process
In -worker mode a single process holds several channels. You start and stop them over a small HTTP API, and each one is served at /{id}/live.m3u8:
Code:m314dl -worker :7001 -worker-secret mytoken curl -H 'Authorization: Bearer mytoken' -X POST http://server:7001/api/channels \ -d '{"id":"news","url":"https://example.com/manifest.mpd","format":"hls","keys":["KID:KEY"]}'
What it does not do
- It does not get keys. It has no Widevine or PlayReady CDM and makes no license requests. You pass the content key you already have with -key, the same KID:KEY you would give mp4decrypt.
- It doesn't serve subtitles yet.
- It can't turn a TS source into DASH output yet. TS to HLS and TS to TS both work.
Install
Binaries for Linux, macOS and Windows are on the releases page. You can also install it with one of these:
Source and README: m314dl on GitHubCode:brew install m314dev/tap/m314dl scoop bucket add m314dev https://github.com/m314dev/scoop-bucket && scoop install m314dl go install github.com/m314dev/m314dl@latest
Every flag and the exact URLs each output serves are in the restream section of the README.
Short answers to the questions I see most
Q: Can you convert mpd to hls without re-encoding?
A: Yes, when the source is fMP4, which is what DASH delivers. The segments are copied as they are. Only the playlist is new.
Q: Do you still need mp4decrypt?
A: No. m314dl decrypts in memory, one fragment at a time, using the same KID:KEY you would give mp4decrypt.
Q: Does it work for live channels?
A: Yes. A live MPD is republished as a live HLS window, or as one continuous MPEG-TS at /live.ts for players that want that.
Q: Does it need ffmpeg?
A: Only for MPEG-TS output from an fMP4 source. HLS and DASH output never start ffmpeg.
----------
I am the author. If it breaks on one of your streams, open an issue on GitHub with the -v output and I'll take a look. Questions about where to get keys for a service will be closed, as the README says.
+ Reply to Thread
Results 1 to 2 of 2
-
-
Thank you for sharing! It is extremely useful and works great.
Suggestion: It would be great if you could add support for customizing the segment duration (#EXT-X-TARGETDURATION) manually,
rather than just relying on the source's duration. This would help eliminate low-latency stream buffering.
Similar Threads
-
Is there a script/program like O11 that converts .mpd + keys to HLS (.m3u8)
By Allisallow in forum Video Streaming DownloadingReplies: 14Last Post: 28th Oct 2026, 08:34 -
ClearPlayer - DASH/MPD and HLS player for iOS, with ClearKey
By Sampras0 in forum Video Streaming DownloadingReplies: 0Last Post: 30th Aug 2026, 10:25 -
restreaming to non-drm m3u8 from drm mpd
By grabyea in forum Video Streaming DownloadingReplies: 1Last Post: 8th Aug 2022, 01:35 -
Mpd to hls m3u8 panel
By Anonymous149484 in forum Video Streaming DownloadingReplies: 1Last Post: 12th Jun 2022, 10:44 -
DASH mpd restream and Convert to m3u8 HLS
By thegeek in forum Video Streaming DownloadingReplies: 9Last Post: 18th May 2022, 23:38


Quote