Configure Video Sizes in FFmpeg Tee Muxer

This article explains how to output different video resolutions to multiple destinations using the FFmpeg tee muxer. Because the tee muxer duplicates encoded packets rather than raw video frames, achieving different video sizes requires scaling and encoding multiple streams before passing them to the tee muxer for distribution.

The Core Concept

The tee muxer operates at the container level. It cannot resize, transcode, or filter video on its own; it merely duplicates the encoded packets it receives and writes them to multiple outputs.

To output different video sizes using tee, you must: 1. Split the input video stream. 2. Scale each split stream to your desired resolutions using video filters. 3. Encode each scaled stream individually. 4. Use the tee muxer’s select option to route the correct encoded stream to its respective output.

The Command Structure

Below is an example command that takes a single input, scales it to both 1080p and 720p, encodes both versions, and uses the tee muxer to save them to separate files.

ffmpeg -i input.mp4 -filter_complex \
"[0:v]split=2[v1][v2]; \
 [v1]scale=1920:1080[v1scaled]; \
 [v2]scale=1280:720[v2scaled]" \
-map "[v1scaled]" -c:v:0 libx264 -b:v:0 4000k \
-map "[v2scaled]" -c:v:1 libx264 -b:v:1 2000k \
-map 0:a -c:a aac \
-f tee "[select='v:0,a']output_1080p.mp4|[select='v:1,a']output_720p.mp4"

How It Works