---
title: "upmux: an MPEG-TS re-multiplexer"
description: "A C tool built on the Upipe framework that takes apart broadcast MPEG transport streams, optionally re-encodes them, and muxes them again with correct clock timing."
date: 2015-05-08T12:15:31+02:00
lastmod: 2026-10-16T18:58:52+02:00
url: https://klimek.link/projects/upmux/
author: "Marcin Klimek"
source: https://klimek.link/projects/upmux/
---

# upmux: an MPEG-TS re-multiplexer

Broadcast video travels as **MPEG transport streams**, and their program clock (PCR) has to be right or receivers stutter. **upmux** takes a stream apart and puts it back together with fixed timing, in a pipeline I built on the **Upipe** framework:

1. It reads a transport stream from a file or from UDP.
2. It demultiplexes the stream and frames the elementary streams: H.264, MPEG video, MPEG audio, A/52, teletext and DVB subtitles.
3. It either passes them straight through, or decodes and re-encodes the video with libavcodec and **x264** at a chosen quality (CRF).
4. It muxes everything again and writes it to a file or UDP.

*Diagram: The upmux pipeline from input stream to output stream*

Under the hood it uses Upipe's memory pools, a dejitter probe on the clock, and separate worker threads for the source, the codec stages and the sink. You set input, output, CRF, remux-only mode and log level on the command line.

[Source on GitHub](https://github.com/marcinklimek/upmux).

Source: https://klimek.link/projects/upmux/
