FFmpeg Concat Demuxer vs Concat Filter Performance

When combining multiple video files in FFmpeg, choosing between the concat demuxer and the concat filter is the most critical decision affecting rendering speed, CPU utilization, and output quality. This article compares the performance profiles of both methods, explaining why the demuxer offers near-instantaneous, lossless stitching, while the filter provides maximum format compatibility at the cost of high computational overhead and potential quality loss.

The Concat Demuxer: High Speed, Low Resource Usage

The concat demuxer operates at the container level. It reads a list of input files from a text file and copies the packets sequentially into a new output file without touching the underlying compressed data.

The Concat Filter: High Compatibility, High Resource Usage

The concat filter operates at the filtergraph level. It requires FFmpeg to completely decode the input video and audio streams, pass the raw uncompressed frames to the filter to be joined, and then re-encode the combined stream into the destination format.

Performance Summary Table

Metric Concat Demuxer Concat Filter
Operation Level Container (Stream Copy) Codec (Decode -> Filter -> Encode)
Speed Near-instantaneous Slow (limited by encoder speed)
CPU/GPU Load Negligible Very High
Output Quality Lossless (no change to original pixels) Lossy (degraded by re-encoding)
Input Constraints Must be identical codecs/parameters Can be completely different formats

When to Use Each Method

Use the concat demuxer when you are stitching together clips from the same source, such as segments split by a camera, segments of a recorded livestream, or TS video chunks.

Use the concat filter when you need to merge videos from different sources (like a mix of MP4, AVI, and MKV files), or when you want to apply transitions, overlays, or watermarks during the joining process.