FFmpeg lut3d: Specify LUT Interpolation Method
This article explains how to specify the interpolation method when
applying a 3D LUT (Look-Up Table) to a video using the FFmpeg
lut3d filter. You will learn about the different
interpolation options available in FFmpeg—such as tetrahedral and
trilinear—and how to implement them in your command-line workflows to
achieve the best color grading results.
The interp
Option in the lut3d Filter
By default, when FFmpeg applies a 3D LUT to a video, it must
calculate color values that fall between the defined coordinates of the
LUT grid. You can control this calculation process using the
interp option within the lut3d filter.
The basic syntax for the filter is:
-vf "lut3d=file=your_lut_file.cube:interp=method"Available Interpolation Methods
FFmpeg supports several interpolation algorithms, each offering a different balance between processing speed and visual quality:
nearest: Nearest-neighbor interpolation. It chooses the closest color point in the LUT grid without doing any blending. This is the fastest method but produces the lowest quality, often resulting in visible color banding.trilinear: Trilinear interpolation. It interpolates linearly along the three color axes (Red, Green, Blue). It is a standard method that offers a good balance of speed and quality.tetrahedral: Tetrahedral interpolation. This is the recommended method for professional color grading. It divides the 3D color space into tetrahedrals, providing highly accurate color blending, smoother gradients, and fewer artifacts than trilinear interpolation.pyramid: Pyramid interpolation. An alternative geometric interpolation method.prism: Prism interpolation. Another geometric interpolation method.
Command Examples
1. Using Tetrahedral Interpolation (Recommended)
To apply a .cube LUT file using tetrahedral
interpolation for the highest visual quality, use the following
command:
ffmpeg -i input.mp4 -vf "lut3d=file=creative_grade.cube:interp=tetrahedral" -c:a copy output.mp42. Using Trilinear Interpolation
If you need a standard, computationally lighter interpolation method,
you can specify trilinear:
ffmpeg -i input.mp4 -vf "lut3d=file=creative_grade.cube:interp=trilinear" -c:a copy output.mp43. Using Nearest Neighbor (For Fast Previews)
For quick drafts where processing speed is prioritized over color accuracy:
ffmpeg -i input.mp4 -vf "lut3d=file=creative_grade.cube:interp=nearest" -c:a copy output.mp4