Configure DNxHD in FFmpeg for Avid

This article provides a straightforward guide on how to configure and encode DNxHD video files using FFmpeg to ensure seamless compatibility with Avid Media Composer. You will learn the exact command-line parameters, required bitrates, color spaces, and audio configurations necessary to prevent import errors and avoid time-consuming transcodes within Avid.

To successfully import or link DNxHD media in Avid Media Composer without issues, the encoded file must strictly adhere to SMPTE standards for DNxHD. Avid is highly sensitive to mismatched resolutions, frame rates, and bitrates.

The Standard FFmpeg Command

The basic command template for creating an Avid-compatible DNxHD file in an MXF or MOV container is as follows:

ffmpeg -i input.mp4 -c:v dnxhd -b:v 145M -pix_fmt yuv422p -c:a pcm_s16le output.mov

Key Parameter Requirements

To achieve perfect compatibility, you must configure the following parameters precisely:

1. Video Codec and Bitrate (-c:v dnxhd and -b:v)

FFmpeg requires you to specify the target bitrate using the -b:v flag. The bitrate must exactly match one of the standard DNxHD profiles for your project’s specific frame rate and resolution. If the math does not match, FFmpeg will fail to encode and output an error listing the valid bitrates.

Common 1080p combinations include: * 1080p @ 23.976 fps: Use -b:v 36M (DNxHD 36 / LB), -b:v 115M (DNxHD 115 / SQ), or -b:v 175M (DNxHD 175 / HQ). * 1080p @ 25 fps: Use -b:v 120M (DNxHD 120 / SQ) or -b:v 185M (DNxHD 185 / HQ). * 1080p @ 29.97 fps: Use -b:v 45M (DNxHD 45 / LB), -b:v 145M (DNxHD 145 / SQ), or -b:v 220M (DNxHD 220 / HQ).

For 10-bit color spaces (e.g., DNxHD HQX), you must append the x profile designation or match the exact 10-bit bitrate counterpart (e.g., -b:v 220M combined with a 10-bit pixel format).

2. Pixel Format (-pix_fmt)

Avid expects specific color subsampling and bit depths. * For 8-bit color (standard), use: -pix_fmt yuv422p * For 10-bit color (high quality), use: -pix_fmt yuv422p10le

3. Frame Rate and Resolution (-r and -s)

The output dimensions and frame rate must match broadcast standards. Use the scale and fps filters if your source file deviates:

ffmpeg -i input.mp4 -vf "scale=1920:1080,fps=24000/1001" -c:v dnxhd -b:v 115M -pix_fmt yuv422p -c:a pcm_s16le output.mov

4. Audio Codec (-c:a)

Avid natively prefers uncompressed PCM audio. Use -c:a pcm_s16le (16-bit) or -c:a pcm_s24le (24-bit) at a sample rate of 48kHz (-ar 48000).

5. Container format

For fast import or direct AMA linking in Avid, wrap the output in either a QuickTime MOV container (.mov) or an MXF container (.mxf).

To output to an MXF OP1a container, use:

ffmpeg -i input.mp4 -c:v dnxhd -b:v 145M -pix_fmt yuv422p -c:a pcm_s24le -ar 48000 output.mxf