DNxHD

From wiki.selur.net
Jump to navigation Jump to search

DNxHD and its successor DNxHR are Avid's intra-frame intermediate codecs for editing (standardised as SMPTE VC-3). DNxHD is a fixed list of profiles, each tied to one HD resolution, bit depth and bit rate; DNxHR works at any resolution. Hybrid encodes both with ffmpeg's dnxhd encoder.

Base → Video: DNxHD, then the DNxHD tab

DNxHD tab in Hybrid
DNxHD tab in Hybrid

What it does

Every frame is coded on its own with a DCT and a fixed size per frame, so the bit rate is constant and editing software can cut and seek anywhere. There is no quality or bit rate setting: the profile fixes everything.

  • A DNxHD profile is named after its nominal bit rate in Mbit/s (DNxHD 36, DNxHD 185x …). It only exists for one resolution (1920x1080, 1440x1080, 1280x720 or 960x720), one bit depth (8 or 10 bit, 10 bit is marked with x), progressive or interlaced video (i) and for certain frame rates. The output of Hybrid has to match all of that, otherwise the job is refused.
  • A DNxHR profile (LB, SQ, HQ, HQX, 444) only fixes the quality class, the bit depth and the color sampling. Any resolution and frame rate is accepted, and ffmpeg derives the bit rate from the profile and the frame size.

Requirements

ffmpeg, which is part of Hybrid on every system. Hybrid only accepts MOV as output container for DNxHD; with another container the job is refused.

Settings

Control ffmpeg option Range / values Hybrid default Meaning
Profile -profile:v, -b:v DNxHD 36 … DNxHD 440x (37 profiles), DNxHR LB, DNxHR SQ, DNxHR HQ, DNxHR HQX, DNxHR 444 DNxHD 100 The DNxHD or DNxHR profile. It sets bit depth, color sampling, interlacing and the bit rate in one go. For DNxHD Hybrid writes -profile:v 0 and the bit rate the profile has for the output frame rate as -b:v; for DNxHR it writes -profile:v 1 – 5 (LB, SQ, HQ, HQX, 444) and no bit rate. Pick DNxHR unless a workflow asks for a specific DNxHD profile.
Macroblock decision -mbd simple, bits, rd rd How the encoder distributes the bits inside a frame. rd uses rate-distortion optimisation, which is slower and gives the best quality for the fixed frame size; simple and bits use the fast method.
Profile Restrictions (box) – text – Display only: what the selected profile demands, see below.
(reason text under the box) – text – Display only: why the current output does not fit the selected profile, see below. Empty when everything fits.

The Configuration row at the bottom saves, loads and deletes named sets of these settings.

Profile Restrictions

The box lists the properties of the selected profile:

  • Profile name
  • Resolution and PAR: the frame size and pixel aspect ratio the profile is defined for, e.g. 1440x1080 with a PAR of 1.33 (anamorphic) or 1920x1080 with a PAR of 1. DNxHR profiles show any.
  • Supported bitrate@fps: the bit rate of the profile and the frame rates it exists for (23.976, 24, 25, 29.97, 50, 59.94 or 60 fps). For DNxHR the box says that ffmpeg derives the bit rate.
  • Interlaced: whether the profile is an interlaced one.
  • Color sampling: 422 or 444.
  • Bit depth: 8-bit or 10-bit.

Hybrid converts the video to the bit depth and color sampling of the profile by itself. Everything else has to be set up by the user. The text under the box names each mismatch between the profile and the current output:

  • Output PAR … and profile PAR … differ: set the pixel aspect ratio of the output to the one of the profile (DNxHD only).
  • Profile resolution … and output resolution … differ: resize or crop to the resolution of the profile (DNxHD only).
  • Profile doesn't have a bitrate for current output frame rate: the profile does not exist for this frame rate; choose another profile or change the frame rate (DNxHD only).
  • Output scanorder is '…', but the profile requires interlaced/progressive content: choose the progressive or the interlaced (i) variant of the profile, or deinterlace.

As long as a reason is shown, the job is not accepted; Hybrid reports the same text when the job is created. In the screenshot the 640x352, 25 fps test clip is checked against DNxHD 100, which needs 1440x1080 with a PAR of 1.33 at 29.97 fps, so three reasons are listed.

Example

Profile DNxHR HQ with macroblock decision rd on a 10-bit YUV 4:2:0 source (640x352, 25 fps), output container MOV; Hybrid converts the video to 8-bit 4:2:2 in the script, because that is what the profile uses:

vspipe "encodingTempSynthSkript.vpy" - --outputindex 0 -c y4m --progress | ffmpeg -y -noautorotate -nostdin -threads 8 -color_primaries bt470bg -color_trc smpte170m -colorspace bt470bg -color_range tv -f yuv4mpegpipe -i - -an -sn -color_primaries bt470bg -color_trc smpte170m -colorspace bt470bg -color_range tv -pix_fmt yuv422p -fps_mode auto -r 25/1 -strict -2 -vcodec dnxhd -profile:v 3 -mbd 2 -metadata encoding_tool="Hybrid 2026.11.22.1" "test.mov"

With DNxHD 185 on a progressive 1920x1080, 25 fps output the encoder part becomes:

-pix_fmt yuv422p -fps_mode auto -r 25/1 -strict -2 -vcodec dnxhd -profile:v 0 -b:v 185M -mbd 2

How Hybrid calls it

  • The filter script (Vapoursynth or AviSynth) is piped into ffmpeg; without a script ffmpeg reads the source itself.
  • The script already delivers the bit depth and color sampling of the profile (yuv422p, yuv422p10le or yuv444p10le), so ffmpeg does not convert again.
  • -strict -2, -profile:v and -mbd are always written; -b:v only for DNxHD profiles.
  • For an interlaced profile Hybrid adds -flags +ildct+ilme and sets the field order of the video with -vf setfield=tff or setfield=bff.
  • Color matrix, transfer, primaries and range of the video are passed to ffmpeg as -colorspace, -color_trc, -color_primaries and -color_range.
  • The number of ffmpeg threads follows Hybrid's general thread setting.

Background

Profile names

The DNxHD list follows the profiles ffmpeg's encoder knows. Avid uses some names for more than one resolution; those entries carry the resolution in the name, e.g. DNxHD 45 (1920x1080) and DNxHD 45 (960x720). A trailing x means 10 bit, i interlaced and s a 1280x720 variant.

DNxHR classes

Profile Bit depth Color sampling Use
DNxHR LB 8-bit 4:2:2 low bit rate, offline editing and proxies
DNxHR SQ 8-bit 4:2:2 standard quality
DNxHR HQ 8-bit 4:2:2 high quality
DNxHR HQX 10-bit 4:2:2 high quality with 10 bit, grading and mastering
DNxHR 444 10-bit 4:4:4 finishing quality with full chroma resolution

Sources

  • FFmpeg codecs documentation
  • SMPTE ST 2019-1 (VC-3 picture compression and data stream format)
  • the built-in help of ffmpeg (ffmpeg -h encoder=dnxhd)
  • Hybrid's tooltips