Muxing

September 11, 2026
Interleaving separate video, audio and subtitle streams into one playable file, with the timing that keeps them in sync.
muxing
container
streams

Muxing — short for multiplexing — is the process of combining separate encoded streams into a single container file, interleaved so that a player reading linearly always has the video and audio it needs for the current moment already in hand.

The interleaving is the part that is easy to overlook. A container does not store the whole video track and then the whole audio track; it stores them in small alternating chunks with timestamps, so that playback can begin before the file has been fully read, and so seeking to the middle finds both streams there. Getting this wrong produces files that play locally and stall when streamed.

The related terms, in one place:

  • Muxing — combining streams into a container.
  • Demuxing — pulling them back out, unchanged.
  • Remuxing — demux and mux into a different container. Lossless.
  • Transcoding — decode and re-encode. Lossy.

Muxing also carries the metadata that makes a file behave: which track is the default, what language each is, rotation flags, chapter markers, and the faststart arrangement that moves the index to the front of an MP4 so a browser can begin playing before the download finishes.

That last one is worth knowing by name. A perfectly good MP4 that refuses to start playing until fully downloaded is usually a file whose index sits at the end, and remuxing with faststart fixes it without re-encoding a frame.

See also