Skip to content

Mux: video that plays before it is processed

A video API that starts playback seconds after upload by transcoding segments on demand instead of the whole file up front.

The idea

The usual video pipeline transcodes every rendition before anyone can watch: queue a job, wait, publish. Mux reversed the order. An upload is cut into short segments, and a segment is transcoded when a viewer first asks for it, streamed out as it is produced. A long file can play within seconds, and renditions nobody watches are never made.

That moves work out of a batch queue and into the request path, which changes what can go wrong. Mux's write-up of a 22-day storage incident shows it well: corrupted segments came from a cancelled read that affected other readers of the same file, a race between deleting and replicating, and incomplete writes treated as complete files, all made worse by a scaling change that slowed object storage during bursts. None of these is exotic. Each is a small assumption that held until the load changed.

Read them next to the video pipeline investigation, which builds the conventional queue-and-workers design. Just-in-time transcoding is the alternative when time to first play matters more than predictable batch cost.

Read the originals

Written by the engineers who built it.

Practise it

Make the decisions yourself, then compare.