FFmpeg DPX Bit Depth and Color Space Guide
This guide explains how to configure the bit depth (specifically 10-bit and 16-bit) and define the color space when exporting DPX (Digital Picture Exchange) images using FFmpeg. You will learn the specific pixel formats and command-line arguments required to write the correct DPX header metadata for professional post-production workflows.
Specifying Bit Depth
In FFmpeg, the bit depth of the output DPX file is determined by the
pixel format (-pix_fmt) flag. The DPX encoder supports
various bit depths, with 10-bit and 16-bit being the industry
standards.
10-Bit DPX Output
To output 10-bit DPX files, use the gbrp10be (10-bit Big
Endian) or gbrp10le (10-bit Little Endian) pixel format.
Big Endian is the traditional default for DPX.
ffmpeg -i input.mp4 -pix_fmt gbrp10be output_%04d.dpx16-Bit DPX Output
To output 16-bit DPX files, use rgb48be (16-bit RGB Big
Endian) or rgba64be (16-bit RGB with Alpha Channel).
# 16-bit RGB (No Alpha)
ffmpeg -i input.mp4 -pix_fmt rgb48be output_%04d.dpx
# 16-bit RGBA (With Alpha)
ffmpeg -i input.mp4 -pix_fmt rgba64be output_%04d.dpxSpecifying Color Space
To ensure that color space information is correctly written into the DPX header metadata, you must explicitly define the color primaries, transfer characteristics, and color matrix using the following FFmpeg flags:
-color_primaries: Defines the color gamut (e.g.,bt709,bt2020).-color_trc: Defines the transfer characteristics / gamma curve (e.g.,bt709,smpte2084for HDR,linear).-colorspace: Defines the matrix coefficients (e.g.,bt709,bt2020nc).
Example 1: Rec. 709 (SDR) 10-Bit DPX
This command exports a video to 10-bit DPX files matching the Rec. 709 color standard:
ffmpeg -i input.mp4 -pix_fmt gbrp10be -color_primaries bt709 -color_trc bt709 -colorspace bt709 output_%04d.dpxExample 2: Rec. 2020 (HDR) 16-Bit DPX
This command exports a video to 16-bit DPX files using the Rec. 2020 color space with SMPTE ST 2084 (PQ) transfer characteristics:
ffmpeg -i input.mp4 -pix_fmt rgb48be -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020nc output_%04d.dpxVerifying DPX Metadata
After exporting, you can verify that the bit depth and color space
metadata were applied correctly by running ffprobe on one
of the generated DPX frames:
ffprobe -show_streams output_0001.dpx