FFmpeg: Multiplex Multiple Mono Audio Tracks in MXF
This guide explains how to use FFmpeg to multiplex multiple audio tracks as discrete mono streams within an MXF (Material Exchange Format) container. You will learn the exact command-line syntax, channel mapping techniques, and stream configurations required to output broadcast-compliant MXF files with individual, isolated audio channels.
Multiplexing Independent Mono Input Files
When you have a video file and several independent mono audio files (such as separate microphone tracks or language tracks), you must map each file to its own output stream and define the channel layout as mono.
Run the following command to multiplex a video and four separate mono WAV files into an MXF container:
ffmpeg -i video.mp4 -i track1.wav -i track2.wav -i track3.wav -i track4.wav \
-map 0:v \
-map 1:a -map 2:a -map 3:a -map 4:a \
-c:v copy \
-c:a pcm_s24le -channel_layout mono \
output.mxfCommand Breakdown:
-map 0:v: Selects the video stream from the first input (video.mp4).-map 1:a -map 2:a ...: Maps each subsequent audio input file to its own discrete output track.-c:v copy: Re-wraps the video without re-encoding to save time and preserve quality.-c:a pcm_s24le: Encodes the audio to 24-bit PCM, which is the standard for broadcast MXF.-channel_layout mono: Forces FFmpeg to tag each mapped audio stream explicitly as a discrete mono channel.
Splitting a Stereo Input into Discrete Mono Tracks
If your source file has a single stereo audio track, you must split
the stereo channels into two individual mono streams using the
channelsplit filter before wrapping them into the MXF
container.
Use this command to split a stereo track into two discrete mono tracks:
ffmpeg -i input.mp4 \
-filter_complex "[0:a]channelsplit=channel_layout=stereo[left][right]" \
-map 0:v \
-map "[left]" -map "[right]" \
-c:v copy \
-c:a pcm_s24le \
output.mxfCommand Breakdown:
-filter_complex: Splits the stereo input (0:a) into two independent audio streams, labeled[left]and[right].-map "[left]" -map "[right]": Routes the split mono streams into the output file as separate audio tracks (Track 1 and Track 2).
Verifying the Output File
To ensure that the MXF container contains discrete mono tracks rather
than a multi-channel stereo track, analyze the output file using
ffprobe:
ffprobe -i output.mxfIn the output metadata, you should see multiple stream entries for audio, each designated as mono:
Stream #0:0: Video: mpeg2video ...
Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit)
Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit)