How to Apply Sepia LUT in FFmpeg using lut3d
This guide explains how to apply a sepia Look-Up Table (LUT) to a
video using the FFmpeg command-line tool. You will learn the exact
syntax for the lut3d video filter, how to reference your
LUT file, and how to execute the command to generate a professionally
color-graded sepia video.
To apply a 3D LUT (typically in .cube format) to a video
in FFmpeg, you must use the lut3d video filter. This filter
maps the colors of your input video to the target sepia color space
defined by your LUT file.
Prerequisites
Before starting, ensure you have: 1. FFmpeg installed on your system.
2. A sepia 3D LUT file (usually with a .cube
extension).
The FFmpeg Command
Open your terminal or command prompt and run the following command:
ffmpeg -i input.mp4 -vf "lut3d=sepia.cube" -c:a copy output.mp4Command Breakdown
-i input.mp4: Specifies the path to your source video file.-vf "lut3d=sepia.cube": Applies the video filter graph. Thelut3dfilter is called, and the path to your sepia LUT file (sepia.cube) is passed as the argument. If your LUT file is in a different directory, provide the full file path (e.g.,lut3d='/path/to/sepia.cube').-c:a copy: Copies the audio stream directly from the source video to the output video without re-encoding it, which saves processing time and preserves audio quality.output.mp4: The name and format of the final, stylized video.
Adjusting Interpolation (Optional)
By default, FFmpeg uses tetrahedral interpolation to map the colors,
which is highly accurate and recommended for most 3D LUTs. If you need
to specify the interpolation method manually, you can use the
interp option:
ffmpeg -i input.mp4 -vf "lut3d=file=sepia.cube:interp=tetrahedral" -c:a copy output.mp4Available interpolation options include: * tetrahedral
(Default, best quality) * trilinear * pyramid
* prism