Write SMPTE D-10 IMX Video to MXF with FFmpeg

This article provides a direct, technical guide on how to encode and wrap SMPTE D-10 (commonly known as Sony IMX) compatible video into an MXF container using FFmpeg. You will learn the exact command-line parameters, stream constraints, and shortcut targets required to produce broadcast-compliant IMX 30, 40, or 50 Mbps MXF files.

Understanding SMPTE D-10 Constraints

SMPTE D-10 is a strict standard definition (SD) broadcast standard. To write a compliant file, your output must adhere to the following specifications: * Video Codec: MPEG-2 4:2:2 Intra-frame only. * Resolution & Framerate: PAL (720x576 at 25 fps) or NTSC (720x486 at 29.97 fps). * Bitrates: Exactly 30 Mbps (IMX30), 40 Mbps (IMX40), or 50 Mbps (IMX50) Constant Bitrate (CBR). * Audio: Stream must contain AES3 PCM audio (16-bit or 24-bit at 48 kHz), formatted into 4 or 8 mono channels.

Method 1: The Quick Way (Using FFmpeg Targets)

FFmpeg provides built-in pre-configured targets for IMX encoding. This is the easiest and most reliable way to ensure all internal MPEG-2 flags are correctly set.

For PAL IMX 50 (50 Mbps):

ffmpeg -i input.mp4 -target pal-imx50 output.mxf

For NTSC IMX 50 (50 Mbps):

ffmpeg -i input.mp4 -target ntsc-imx50 output.mxf

Note: You can replace imx50 with imx30 or imx40 in the target name depending on your bitrate requirement.

Method 2: Manual Parameter Configuration

If you need granular control over the encoding process, you must specify the exact video and audio properties required by the SMPTE D-10 standard. The following example encodes an input to a compliant PAL IMX 50 MXF file:

ffmpeg -i input.mp4 \
  -vcodec mpeg2video \
  -r 25 \
  -pix_fmt yuv422p \
  -aspect 4:3 \
  -b:v 50000000 -minrate 50000000 -maxrate 50000000 -bufsize 2000000 \
  -g 1 -bf 0 \
  -flags +ildct+ilme -top 1 \
  -non_linear_quant 1 -qmin 1 -qmax 12 \
  -acodec pcm_s16le -ar 48000 \
  -f mxf_d10 \
  output.mxf

Key Parameter Breakdown

Handling Audio Channel Requirements

SMPTE D-10 requires 4 or 8 channels of PCM audio. If your input file has a simple stereo track, you must map and split the stereo channels into multiple discrete mono channels to satisfy the MXF muxer.

To map a stereo input into 4 discrete mono audio channels in the output MXF:

ffmpeg -i input.mp4 \
  -target pal-imx50 \
  -filter_complex "[0:a]channelsplit=channel_layout=stereo[left][right];[left]asplit=2[l1][l2];[right]asplit=2[r1][r2]" \
  -map 0:v \
  -map "[l1]" -map "[r1]" -map "[l2]" -map "[r2]" \
  output.mxf

This configuration splits the stereo input, duplicates the channels, and maps them as four individual mono audio tracks in the final SMPTE D-10 compliant container.