What You Will Learn

  • The command to apply a 3D LUT file for color grading with the lut3d filter
  • The supported LUT formats (.cube, .3dl, .dat, .m3d)
  • How to adjust the intensity of a LUT
  • A practical color grading workflow

Tested with: FFmpeg 6.1 (verified against real FFmpeg)
Target OS: Windows / macOS / Linux


What Is a 3D LUT?

A 3D LUT (3-Dimensional Look-Up Table) is a table that converts input color values (R, G, B) into different output color values. With a single LUT file, you can reproduce the “film look,” “cinematic look,” and other color grades used by professional video production and YouTubers. If you would rather build a look by hand instead of using a LUT, start with adjusting hue and saturation with the hue filter.


Basic Commands

Apply a .cube LUT

ffmpeg -i input.mp4 -vf "lut3d=file=my_lut.cube" output.mp4

Specify the path to the LUT file with file=.

When the Path Contains Spaces

ffmpeg -i input.mp4 -vf "lut3d=file='my lut file.cube'" output.mp4

Wrap a path that contains spaces in single quotes.


Supported Formats

ExtensionFormat Name
.cubeAdobe/DaVinci Resolve CUBE (most common)
.3dlAutodesk 3DL
.datPandora dat
.m3dPandora m3d

We recommend using the most universal .cube format.


How to Reduce LUT Intensity

lut3d itself does not have a direct intensity parameter. If a LUT is too strong, either pull saturation/contrast back with eq or tone curve color correction with curves after the LUT, or build a separate filtergraph that blends the graded result with the original.

Simple intensity adjustment can be substituted by combining it with the eq filter:

ffmpeg -i input.mp4 \
  -vf "lut3d=file=my_lut.cube,eq=contrast=0.9:saturation=0.8" \
  output.mp4

A Concrete .cube File Structure (Reference)

# シンプルな 2x2x2 CUBE ファイル例(テスト用)
LUT_3D_SIZE 2
0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
1.0 1.0 0.0
0.0 0.0 1.0
1.0 0.0 1.0
0.0 1.0 1.0
1.0 1.0 1.0

Real, high-quality LUTs use sizes such as 33×33×33 (35,937 entries) or 65×65×65.


Create and Apply a Minimal .cube File for Testing

cat > test.cube << 'EOF'
LUT_3D_SIZE 2
0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
1.0 1.0 0.0
0.0 0.0 1.0
1.0 0.0 1.0
0.0 1.0 1.0
1.0 1.0 1.0
EOF

ffmpeg -i input.mp4 -vf "lut3d=file=test.cube" output.mp4

Applying a LUT with the haldclut Filter (An Alternative Method)

haldclut is a different approach that uses an image-format LUT (PNG/TIFF).

ffmpeg -i input.mp4 -i lut_image.png \
  -filter_complex "[0][1]haldclut" \
  output.mp4

Color Grading Workflow

1. Converting from Log Footage (S-Log3 → Rec.709)

ffmpeg -i slog3_footage.mp4 \
  -vf "lut3d=file=SLog3_To_Rec709.cube" \
  output.mp4

Log footage such as Sony’s S-Log3 requires a dedicated conversion LUT.

2. Applying a Film Look

ffmpeg -i input.mp4 \
  -vf "lut3d=file=film_look.cube" \
  output.mp4

Free LUTs are distributed on many sites such as DeLUT, IWLTBAP, and Emiliana Torrini.


Combining lut3d with curves and eq

You can fine-tune the image further after applying the LUT.

ffmpeg -i input.mp4 \
  -vf "lut3d=file=my_lut.cube,eq=contrast=1.05:saturation=1.1" \
  output.mp4

Notes

  • We recommend an absolute path for the LUT file (a relative path is resolved against FFmpeg’s working directory).
  • The lut3d filter is included in libavfilter, so no external library is required.
  • If the LUT file’s format is incorrect, you will get an error (for example, in how comment lines are written).
  • Applying a LUT to high-resolution footage can be slower than real time.

Measured Example

This example applies a 33x33x33 .cube LUT to a 1080p/30fps, 2-minute H.264 video:

ffmpeg -i input.mp4 \
  -vf "lut3d=file=look.cube,eq=saturation=0.95:contrast=0.98" \
  -c:v libx264 -crf 23 -preset medium -c:a copy \
  output.mp4

lut3d performs 3D table lookup and interpolation per pixel, so it is heavier than a simple eq adjustment. On a typical 8-core desktop, processing may take roughly 1.5–3x real time.

File size depends on the look. A film-style LUT that adds grain-like contrast or stronger color separation in shadows can increase size at the same CRF. A LUT that reduces saturation or detail can reduce it. Check skin, white walls, and sky gradients first; strong LUTs can look appealing at a glance but introduce skin-tone shifts or banding. Results vary by environment.


  • haldclut — apply an image-format LUT
  • curves — color correction with tone curves
  • hue — adjust hue, saturation, and brightness
  • eq — adjust brightness, contrast, and gamma