← WORK
WORK / 2026 MEDIA BUILDING

Pangolin — Live Origin & DRM

Self-hosted live origin packaging + DRM — a self-hosted equivalent of AWS Elemental MediaPackage that emits standard HLS any CDN can front. All four components are deployed; work continues toward full MediaPackage parity.

GoHLSAES-128ffmpegDVR/ABR

Why

FAST channels need live origin packaging, DVR/time-shift, and key/DRM — the functions AWS MediaPackage + a CDN provide. The question was whether to rent that hot path from a managed cloud service or own it self-hosted.

The AES-128 key gateway already existed: it derives a per-stream, per-period key as a function of (master, streamID, period) and serves it to players through an authorization gateway. The packaging, though, was rented — a CDN “Third Party Key Server” form did the segmentation and encryption, and ops pasted one static key into it. That form pins a single scrambler key by construction, so it cannot rotate keys, and it bounds time-shift to the origin’s retention. The rented form was the limiter on both key rotation and real DVR.

Both threads converge on one missing piece — an origin packager we own — so the whole stack stays off a managed cloud service’s hot path.

What it does

Takes a CLEAR HLS source (an HTTP(S) master playlist), re-packages it into AES-128-encrypted ABR HLS with a DVR window, serves decryption keys to players through an authorization gateway, and gives partners a multi-tenant API plus a console to provision and meter their own streams. Any CDN can sit in front.

Components

  • Live origin / packager — live HLS origin: ingest via ffmpeg → segment → AES-128 encrypt → DVR window → ABR master; pulls keys from the gateway, never holds the master secret. (AWS analogue: MediaPackage origin.)
  • AES-128 key gateway — mints player bearers, authorizes and serves keys, derives per-stream/per-period keys via HKDF, revokes sessions. (AWS analogue: MediaPackage DRM / SPEKE.)
  • Control-plane API — multi-tenant management API: stream registry, provisioning, usage metering, lifecycle. JWT/tenant-scoped, never on the media hot path. (AWS analogue: MediaPackage control + console.)
  • Partner console — partner-facing console; calls the control-plane API directly with the partner JWT. (AWS analogue: AWS customer console.)

Design

Two planes, kept separate by design. The control plane (control-plane API + console) provisions, meters, and schedules, and never touches a segment or a key. The data plane (packager + key gateway) is the per-request hot path and keeps serving even if the control plane is down. Every component is positioned against its AWS equivalent, and ongoing work is gated on which MediaPackage capability it advances.

Architecture

G cluster_control Control plane cluster_data Data plane (hot path) source CLEAR HLS source HTTP(S) master playlist packager Live origin / packager ingest → segment → AES-128 → DVR → ABR source->packager ingest player Player hls.js · AVPlayer · ExoPlayer — no SDK cdn CDN (any edge) cdn->player playlists · segments console Partner console controlplane Control-plane API registry · provisioning · metering · JWT/tenant console->controlplane partner JWT controlplane->packager provision · schedule packager->cdn encrypted ABR HLS gateway AES-128 key gateway mint bearer · derive + serve keys packager->gateway key pull gateway->player key bytes

The control plane provisions a stream and schedules ingest, then stays off the request path. The packager pulls a CLEAR master, segments and encrypts it, and publishes DVR-windowed ABR HLS that any CDN fronts; the key gateway mints a player bearer and serves the per-period key the EXT-X-KEY URI points at. Key serving verifies its own signed bearer, so the data plane keeps playing even when control is unreachable.

Status

All four components are deployed: the key gateway serves LIVE and VOD keys with per-period HKDF rotation, the packager runs multi-stream ABR packaging with DVR, the control-plane API drives real packager shards through its scheduler, and the partner console is live against it. What remains is closing the gap to full MediaPackage parity. The largest named gap is studio multi-DRM (Widevine / PlayReady / FairPlay) — a category change behind a SPEKE-like key-provider seam, not an upgrade of the clear-key AES-128 tier — followed by multi-input failover and channel/endpoint parity.