Skip to content

Releases: m314dev/m314dl

v0.3.6

Choose a tag to compare

@github-actions github-actions released this 16 Oct 13:22

Changelog

  • e3a6704 Move the module to github.com/m314dev/m314dl
  • 9d6812c Release with goreleaser on tag push, rewrite the README
  • 7679c0d dash: split on-demand SegmentBase files by their sidx (#8)
  • f99002d docs,bench: rewrite README and add hot-path benchmarks
  • bc7caea docs: restore the detailed README, reorganized
  • 2fa4437 engine: don't log every in-flight fetch as failed on stop
  • 7cc8e1b engine: prune the feeder's seen-map to the live window
  • 01f52e9 engine: strip fake image headers after AES-128 decrypt, not before
  • fd76844 feat: added m3u downloader
  • 83ea6ee mp4,bbts: drop per-block/per-sample allocations in the decrypt hot loops
  • 34bb6c2 mp4: fix cbcs decryption for the skip=0 (no-skip) pattern
  • c5693d4 pick: numeric width/height bounds with nearest-rendition fallback
  • a444ed6 restream: O(1) segment lookup and cached manifest/playlist bodies
  • 366482c restream: fix DASH VOD that downloads but never plays (#8)

v0.3.5

Choose a tag to compare

@mohaanymo mohaanymo released this 04 Sep 12:49

v0.3.5

A restream-focused fix release. If you use -serve or -worker, upgrade —
several failures reported against v0.3.4 are fixed here.

Fixed

  • DASH restream of a VOD now starts immediately. A still-downloading VOD was
    served as a dynamic MPD whose segment availability is gated by wall-clock time,
    but m314dl spools the asset far faster than real time, so a compliant player
    saw the already-downloaded segments as "not yet available" and never started.
    The manifest's availabilityStartTime is now back-dated so every spooled
    segment is immediately playable and seekable (and it still finalizes to a
    static, fully-seekable MPD on completion).

  • Restream no longer runs the machine out of memory on a large VOD. Segments
    were spooled under the system temp dir, which is tmpfs (RAM) on most Linux
    hosts — so a big asset (e.g. a long 4K stream) filled memory and was
    OOM-killed. Spooling now goes to real disk by default (the current working
    directory), with a new -spool-dir <path> flag to choose the location and
    a warning if the chosen directory is RAM-backed.

  • Multi-trun fragments decrypt correctly. A fragment whose traf carried
    more than one trun kept only the last run's sample map while the encryption
    info covered all samples, decrypting the rest to garbage. Single-trun
    fragments (the common case) are unchanged and remain byte-exact against the
    reference tools.

  • Trick-play tracks are no longer offered as normal video. DASH trick-mode
    (I-frame-only) representations marked with the DASH-IF EssentialProperty are
    now excluded from selection instead of appearing as ordinary renditions.

Notes

Decryption still requires you to supply the content key; the tool performs no
license/CDM handshake. In -worker/-serve on a host where /tmp is tmpfs,
point -spool-dir at a real-disk path for large VODs (the default already does
the right thing).

v0.3.4

Choose a tag to compare

@mohaanymo mohaanymo released this 03 Sep 06:23

v0.3.4

A big feature release: new source formats, a general file downloader, and a
rewrite of how restreaming serves on-demand content — plus fixes for the restream
issues reported against v0.3.3.

New

  • Smooth Streaming (MSS). Point the tool at a Microsoft Smooth Streaming
    manifest (.ism/Manifest, .isml/Manifest), VOD or live, and download,
    decrypt, or restream it like HLS and DASH. MSS ships no init segment, so one is
    synthesized from the manifest's CodecPrivateData; PlayReady is handled the
    same way as the tool's other DRM — the KID is read from the ProtectionHeader
    and you supply the key with -key KID:KEY. H.264 + AAC covered.

  • HLS SAMPLE-AES decryption. SAMPLE-AES streams (AAC + H.264) now decrypt
    in-process with a supplied key, alongside the existing CENC / cbcs / AES-128
    support. No license handshake — you provide the key.

  • Plain-file downloads (aria2c-style). Give it a direct file URL — .mp4,
    .mkv, .zip, .iso, anything — and it downloads over many byte-range
    connections at once, with the same resume, retries, and adaptive concurrency as
    the stream pipeline. Falls back to a single connection when the server won't do
    ranges, keeps the real filename and extension, and skips ffmpeg (the file is
    already complete).

  • Paste a curl command (-curl). For a URL that needs specific request
    headers, hand the tool a browser's "Copy as cURL" instead of retyping each
    -H: a file path, - for stdin, or the command inline. It takes the URL and
    every header (folding -A/-e/-b into User-Agent/Referer/Cookie); an
    explicit URL or -H still overrides.

  • Update check. Once a day the tool checks GitHub for a newer release and
    prints a one-line notice if you're behind. It never blocks the download; turn
    it off with -no-update-check or M314DL_NO_UPDATE_CHECK=1.

  • Seekable VOD restreaming. A finite (VOD) source served over -serve /
    -worker is now presented as a proper seekable video — the whole timeline
    is scrubbable — instead of a live window. Segments spool to disk, so memory
    stays flat regardless of the asset's length, and the HLS playlist gains
    EXT-X-ENDLIST once the source completes. Live sources still roll a bounded
    window (a live stream has no full timeline to seek).

Fixed

  • MPEG-TS restream cut viewers off after a few seconds (-serve-format ts),
    live sources included. The fan-out dropped a viewer by counting publish units,
    but the remux path emits tiny pipe-sized chunks, so the buffer was worth under a
    second and any burst kicked everyone. It now measures by bytes, primes a joining
    viewer for instant start, drains the queued tail when the stream ends instead of
    cutting mid-play, and aligns remux output to TS packet boundaries.

  • VOD restream stopped after the initial buffer and kept growing memory. A
    finite source was presented as a live stream that snapshotted mid-download and
    stopped; it is now the seekable, disk-spooled VOD described above — playback
    follows through to the end and memory stays flat.

  • Latent byte-range corruption on the shared segment path. A ranged request
    answered with a whole-object 200 used to be written as if it were the
    requested slice, misplacing bytes; it is now refused (a file download retries on
    a single connection), and a short 206 retries for the remainder instead of
    committing a truncated chunk.

Notes

Decryption still requires you to supply the content key; the tool performs no
license/CDM/FairPlay handshake. MSS AC-3/E-AC-3 and HEVC-over-TS are not decrypted
yet (they're reported clearly rather than passed through scrambled).

v0.3.3

Choose a tag to compare

@mohaanymo mohaanymo released this 31 Aug 01:12

Restream fixes. Pace finite (VOD) sources to real time and cap the in-memory VOD window: fixes MPEG-TS viewer freezes (-serve-format ts, #4) and the OOM container restart on long manifests (#3).

v0.3.2

Choose a tag to compare

@mohaanymo mohaanymo released this 27 Aug 14:13

Fixes DRM output that failed to decode in v0.3.1 (trun data_offset). Adds a Dockerfile and README updates.

m314dl v0.3.1

Choose a tag to compare

@mohaanymo mohaanymo released this 24 Aug 04:39

m314dl v0.3.1

Fast HLS (.m3u8) and DASH (.mpd) video downloader in a single static binary,
with native in-process CENC decryption — no mp4decrypt, no shaka-packager.

Fixes since v0.3.0

  • Decrypted output is now a clean, unprotected stream. After CENC
    decryption the boxes still declared the stream encrypted (init typed its
    samples encv/enca with sinf/tenc/pssh; every fragment carried
    senc/saiz/saio), so a player or ffmpeg that trusted them tried to
    "decrypt" the already-plaintext samples and rendered a black picture. The
    init is now de-protected (codec fourcc restored from sinf→frma, sinf
    and pssh removed) and senc/saiz/saio are stripped from each fragment —
    correct for any mux target and for -no-mux.
  • Flags work in any order relative to the URL — m314dl -o out.mp4 URL -t 16
    and m314dl URL -o out.mp4 now behave identically (flags after the URL were
    previously ignored).

Core features

  • Native CENC / cbcs decryption, per-fragment as the stream downloads
    (byte-exact vs mp4decrypt). Supply the key with -key KID:KEY.
  • HLS + DASH, VOD and live; AES-128; BBTS; multi-period DASH; subtitles
    (first subtitle flagged default, or -sub-external sidecars).
  • Restream / live republish (-serve: hls/ts/dash), plus a
    multi-channel worker (-worker) and an RPC server (-rpc).
  • Kill-proof resume: segments stream to part files with HTTP byte-range
    resume, checkpointed on every commit — an interrupted download continues
    byte-exact, losing at most the segment in flight.
  • Fast on real networks: one HTTP/1.1 connection per in-flight request;
    adaptive concurrency, or a held -t N. Backs off from rate limits.
  • Local file input, page scraping, cookies, proxy, custom headers, -ffmpeg.
    Needs ffmpeg on PATH (or -ffmpeg) for muxing.

Downloads

Platform Archive
Linux x86-64 m314dl_v0.3.1_linux_amd64.tar.gz
Linux ARM64 m314dl_v0.3.1_linux_arm64.tar.gz
Linux ARMv7 m314dl_v0.3.1_linux_arm.tar.gz
macOS Intel m314dl_v0.3.1_darwin_amd64.tar.gz
macOS Apple Silicon m314dl_v0.3.1_darwin_arm64.tar.gz
Windows x86-64 m314dl_v0.3.1_windows_amd64.zip
Windows ARM64 m314dl_v0.3.1_windows_arm64.zip

Install (Linux/macOS)

tar xzf m314dl_v0.3.1_<os>_<arch>.tar.gz
sudo mv m314dl_v0.3.1_<os>_<arch>/m314dl /usr/local/bin/
m314dl -version

Verify downloads against SHA256SUMS.

m314dl v0.3.0

Choose a tag to compare

@mohaanymo mohaanymo released this 23 Aug 10:51

m314dl v0.3.0

Fast HLS (.m3u8) and DASH (.mpd) video downloader in a single static binary,
with native in-process CENC decryption — no mp4decrypt, no shaka-packager.

New since v0.2.0

  • Restream / live republish (-serve): republish the selected streams live
    instead of downloading to a file — hls (/live.m3u8), continuous ts
    (/live.ts), or dash (/live.mpd), with an optional ffmpeg transcode path.
  • Multi-channel restream worker (-worker) and an RPC server (-rpc)
    for running m314dl as a service (control API, bounded concurrency, auth token).
  • -ffmpeg <path> to point at an ffmpeg binary that isn't on PATH.
  • Default in-memory cookie jar so an auth cookie set on the manifest is
    carried to the segment requests that need it (no -cookies file required).
  • Robustness: a broken/optional subtitle track no longer sinks the whole
    download (warn + skip); WebVTT cue tags are stripped and entities decoded in
    the SRT path; an idle-connection watchdog retries a silently-throttled segment
    instead of stalling at 0 B/s.

Core features

  • Native CENC / cbcs decryption, per-fragment as the stream downloads
    (byte-exact vs mp4decrypt). Supply the key with -key KID:KEY.
  • HLS + DASH, VOD and live; AES-128; BBTS; multi-period DASH; subtitles
    (first subtitle flagged default, or -sub-external sidecars).
  • Kill-proof resume: segments stream to part files with HTTP byte-range
    resume, checkpointed on every commit — an interrupted or hard-killed download
    continues byte-exact, losing at most the segment in flight.
  • Fast on real networks: one HTTP/1.1 connection per in-flight request;
    adaptive concurrency, or a held -t N. Backs off from rate limits.
  • Local file input, page scraping, cookies, proxy, custom headers. Needs
    ffmpeg on PATH (or -ffmpeg) for muxing.

Downloads

Platform Archive
Linux x86-64 m314dl_v0.3.0_linux_amd64.tar.gz
Linux ARM64 m314dl_v0.3.0_linux_arm64.tar.gz
Linux ARMv7 m314dl_v0.3.0_linux_arm.tar.gz
macOS Intel m314dl_v0.3.0_darwin_amd64.tar.gz
macOS Apple Silicon m314dl_v0.3.0_darwin_arm64.tar.gz
Windows x86-64 m314dl_v0.3.0_windows_amd64.zip
Windows ARM64 m314dl_v0.3.0_windows_arm64.zip

Install (Linux/macOS)

tar xzf m314dl_v0.3.0_<os>_<arch>.tar.gz
sudo mv m314dl_v0.3.0_<os>_<arch>/m314dl /usr/local/bin/
m314dl -version

Verify downloads against SHA256SUMS.

m314dl v0.2.0

Choose a tag to compare

@mohaanymo mohaanymo released this 19 Aug 06:24

m314dl v0.2.0

Fast HLS (.m3u8) and DASH (.mpd) video downloader in a single static binary,
with native in-process CENC decryption — no mp4decrypt, no shaka-packager.

New since v0.1.0

  • First subtitle is flagged default in the muxed output, so a player turns
    subtitles on without the viewer picking a track.
  • BBTS decryption (-bbts-key) for iQiyi-style encrypted MPEG-TS segments —
    whole-segment AES with the per-segment IV read from the stream's SDT.
  • Idle watchdog: a silently-throttled connection that sends no bytes for 30s
    is abandoned and retried (resuming from disk) instead of stalling the whole
    download at 0 B/s.
  • Smarter stream scheduling: many streams run concurrently while each
    subtitle track is capped to a few workers, so 25 tiny-segment subtitle tracks
    no longer serialize into a latency tail after the video finishes.

Core features

  • Native CENC / cbcs decryption, per-fragment as the stream downloads
    (byte-exact vs mp4decrypt). Supply the key with -key KID:KEY.
  • HLS + DASH, VOD and live; AES-128; multi-period DASH; subtitles.
  • Kill-proof resume: segments stream to part files with HTTP byte-range
    resume, checkpointed on every commit — an interrupted or hard-killed download
    continues byte-exact, losing at most the segment in flight.
  • Fast on real networks: one HTTP/1.1 connection per in-flight request
    (not a single multiplexed HTTP/2 flow); adaptive concurrency, or a held -t N.
    Backs off from rate limits (honors Retry-After).
  • Local file input, page scraping, cookies, proxy, custom headers. Needs
    ffmpeg on PATH for muxing.

Downloads

Platform Archive
Linux x86-64 m314dl_v0.2.0_linux_amd64.tar.gz
Linux ARM64 m314dl_v0.2.0_linux_arm64.tar.gz
Linux ARMv7 m314dl_v0.2.0_linux_arm.tar.gz
macOS Intel m314dl_v0.2.0_darwin_amd64.tar.gz
macOS Apple Silicon m314dl_v0.2.0_darwin_arm64.tar.gz
Windows x86-64 m314dl_v0.2.0_windows_amd64.zip
Windows ARM64 m314dl_v0.2.0_windows_arm64.zip

Install (Linux/macOS)

tar xzf m314dl_v0.2.0_<os>_<arch>.tar.gz
sudo mv m314dl_v0.2.0_<os>_<arch>/m314dl /usr/local/bin/
m314dl -version

Verify downloads against SHA256SUMS.

m314dl v0.1.0

Choose a tag to compare

@mohaanymo mohaanymo released this 17 Aug 04:19

m314dl v0.1.0

Fast HLS (.m3u8) and DASH (.mpd) video downloader in a single static binary,
with native in-process CENC decryption — no mp4decrypt, no shaka-packager.

Highlights

  • Native CENC / cbcs decryption, per-fragment as the stream downloads
    (byte-exact vs mp4decrypt). Supply the key with -key KID:KEY.
  • HLS + DASH, VOD and live; AES-128; multi-period DASH; subtitles
    (WebVTT / TTML → SRT/VTT, or -sub-external sidecars).
  • Kill-proof resume: segments stream to part files with HTTP byte-range
    resume, checkpointed on every commit — an interrupted or hard-killed download
    continues byte-exact, losing at most the segment in flight.
  • Fast on real networks: one HTTP/1.1 connection per in-flight request (not a
    single multiplexed HTTP/2 flow), adaptive concurrency by default, or a held
    -t N. Backs off from rate limits (honors Retry-After).
  • Local .m3u8/.mpd file input, page scraping, cookies, proxy, custom headers.
  • Single static binary; needs ffmpeg on PATH for muxing.

Downloads

Platform Archive
Linux x86-64 m314dl_v0.1.0_linux_amd64.tar.gz
Linux ARM64 m314dl_v0.1.0_linux_arm64.tar.gz
Linux ARMv7 m314dl_v0.1.0_linux_arm.tar.gz
macOS Intel m314dl_v0.1.0_darwin_amd64.tar.gz
macOS Apple Silicon m314dl_v0.1.0_darwin_arm64.tar.gz
Windows x86-64 m314dl_v0.1.0_windows_amd64.zip
Windows ARM64 m314dl_v0.1.0_windows_arm64.zip

Install (Linux/macOS)

tar xzf m314dl_v0.1.0_<os>_<arch>.tar.gz
sudo mv m314dl_v0.1.0_<os>_<arch>/m314dl /usr/local/bin/
m314dl -version

Requires ffmpeg on PATH. Verify downloads against SHA256SUMS.