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.mxf

Key Parameter Breakdown:

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.mxf

Key Parameter Breakdown:

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.mxf

In 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.mxf

Ensure that the video codec, pixel format, and audio properties (24-bit PCM at 48kHz) align exactly with your target AS-02 delivery specifications.