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.
The pipeline, built on the Upipe framework:
- reads a transport stream from a file or from UDP;
- demultiplexes it and frames the elementary streams (H.264, MPEG video, MPEG audio, A/52, teletext, DVB subtitles);
- either passes them straight through, or decodes and re-encodes the video with libavcodec and x264 at a chosen quality (CRF);
- muxes everything again and writes it to a file or UDP.
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. Input, output, CRF, remux-only mode and log level are set on the command line.
Tech: C, CMake, Upipe, FFmpeg, x264, libev. Source on GitHub.