How to Adjust Video Color Temperature with FFmpeg
This guide explains how to adjust the color temperature of a video
using FFmpeg's built-in colortemperature filter. You will
learn the basic command syntax, the primary parameters used to cool down
or warm up a shot, and practical examples for common color-correction
tasks.
Understanding the
colortemperature Filter
The colortemperature filter modifies the Kelvin
temperature of a video frame. The default neutral baseline is roughly
6500K (standard daylight, D65).
- Lower values (below 6500K): Shift the video toward warmer, amber, and reddish tones.
- Higher values (above 6500K): Shift the video toward cooler, blue tones.
Basic Syntax
To apply the filter, use the -vf (video filter) flag
followed by colortemperature=temperature=VALUE:
ffmpeg -i input.mp4 -vf "colortemperature=temperature=4000" -c:a copy output.mp4In this command:
-i input.mp4specifies your source file.-vf "colortemperature=temperature=4000"sets the color temperature to 4000 Kelvin (a warm look).-c:a copycopies the audio stream without re-encoding to save processing time and preserve audio quality.
Key Parameters
The colortemperature filter accepts several parameters
separated by colons:
temperature(ort): Sets the target color temperature in Kelvin. Accepted range is typically between 1000 and 40000. The default is 6500.mix: Controls the blend ratio between the original and the filtered video. Values range from0.0(no effect) to1.0(full effect). Default is1.0.pl(preserve lightness): Defines the amount of original luminance to preserve. Values range from0.0to1.0. The default is0.0. Enabling this helps prevent bright or dark areas from clipping when shifting colors drastically.saturation: Adjusts the color saturation of the output. Values range from0.0to1.0. Default is0.5.
Practical Examples
1. Warming Up Footage (Golden Hour Look)
To simulate warmer lighting (such as sunset or indoor tungsten lighting), lower the temperature to around 3500K to 4500K:
ffmpeg -i input.mp4 -vf "colortemperature=temperature=3500" -c:v libx264 -crf 18 -c:a copy output_warm.mp42. Cooling Down Footage (Overcast / Cold Look)
To fix overly warm footage or simulate an overcast, cold environment, raise the temperature above 6500K:
ffmpeg -i input.mp4 -vf "colortemperature=temperature=8500" -c:v libx264 -crf 18 -c:a copy output_cool.mp43. Preserving Lightness and Blending the Effect
If the color shift creates harsh brightness shifts, enable lightness
preservation (pl=1.0) and dial back the overall intensity
using mix:
ffmpeg -i input.mp4 -vf "colortemperature=temperature=9000:mix=0.7:pl=1.0" -c:v libx264 -crf 18 -c:a copy output_balanced.mp4