How to Create AS-02 MXF Files with FFmpeg
This guide explains how to write and package video files into the AS-02 MXF versioning format using FFmpeg. You will learn the exact command-line configurations, video and audio codec constraints, and metadata settings required to produce compliant AS-02 MXF assets for broadcasting, archiving, and mastering workflows.
Understanding AS-02 MXF Requirements
The AS-02 (Application Specification 02) standard is designed for program versioning and multi-version development. Unlike traditional flat MXF files, AS-02 operates on a “media bundle” concept, where high-quality MXF essence components (video, audio, and metadata) are stored alongside version control XML sheets.
To create AS-02 compliant MXF files with FFmpeg, you must target the correct operational patterns (typically OP1b or OP-Atom) and use industry-approved codecs such as DNxHD, JPEG 2000, or AVC-Intra, paired with uncompressed PCM audio.
Method 1: Creating AS-02 Compliant DNxHD MXF Files
DNxHD (or DNxHR) is one of the most common codecs used within the AS-02 specification. Use the following FFmpeg command to transcode an input video to a compliant 1080p DNxHD MXF file:
ffmpeg -i input.mp4 -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -colorspace bt709 -color_trc bt709 -color_primaries bt709 -c:a pcm_s24le -ar 48000 -f mxf output.mxfKey Parameter Breakdown:
-c:v dnxhd: Specifies the DNxHD/DNxHR video encoder.-profile:v dnxhr_hq: Sets the DNxHR profile (High Quality, 8-bit). For 10-bit mastering, usednxhr_hqx.-pix_fmt yuv422p: Configures the pixel format to YUV 4:2:2, which is required for professional broadcasting standards.-colorspace bt709 -color_trc bt709 -color_primaries bt709: Strictly defines the color space parameters to avoid metadata mismatches in professional playout systems.-c:a pcm_s24le: Encodes the audio to 24-bit Little-Endian PCM, the standard uncompressed audio format for AS-02.-ar 48000: Sets the audio sample rate to 48 kHz, the required broadcast standard.-f mxf: Forces the output format to MXF.
Method 2: Creating AS-02 Compliant AVC-Intra MXF Files
AVC-Intra is another widely accepted codec family within the AS-02 specification. This command encodes your source video to AVC-Intra 100 within an MXF container:
ffmpeg -i input.mp4 -c:v libx264 -pix_fmt yuv422p10le -profile:v high422 -x264opts avcintra-class=100 -c:a pcm_s24le -ar 48000 -f mxf output.mxfKey Parameter Breakdown:
-c:v libx264: Uses the H.264/AVC encoder.-pix_fmt yuv422p10le: Sets the pixel format to 10-bit YUV 4:2:2.-x264opts avcintra-class=100: Forces the encoder to use the compliant AVC-Intra 100 profile constraints, which limits bitrates and GOP structures to meet broadcast requirements.
Mapping Multiple Audio Channels
AS-02 workflows frequently require discrete, uncompressed audio channels (e.g., Stereo, 5.1 Surround, or multi-language tracks) rather than a single interleaved stereo track.
To map distinct audio streams into individual mono tracks within the
MXF container, use the -map option:
ffmpeg -i input.mp4 -map 0:v:0 -map 0:a:0 -map 0:a:1 -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s24le -ar 48000 -f mxf output.mxfIn this command: * -map 0:v:0 maps the
first video stream. * -map 0:a:0 maps the
first audio channel to its own discrete track. *
-map 0:a:1 maps the second audio channel
to its own discrete track.
Validating the Output
Once your MXF file is generated, you can verify its compliance and structural layout using FFprobe:
ffprobe -show_streams -show_format output.mxfEnsure that the video codec, pixel format, and audio properties (24-bit PCM at 48kHz) align exactly with your target AS-02 delivery specifications.