How to Adjust Video Color Temperature with FFmpeg
This article provides a quick guide on how to use the
colortemperature filter in FFmpeg to modify the color
temperature of your videos. You will learn the basic command syntax, how
the temperature scale works in FFmpeg, and how to use key parameters to
make your video look warmer or cooler.
The colortemperature filter in FFmpeg allows you to
adjust the color temperature of a video source using Kelvin (K) values.
The default neutral temperature is 6500K (representing standard daylight
D65). Adjusting this value alters the balance between warm (red/orange)
and cool (blue) tones in your video.
Basic Syntax
The basic syntax for the colortemperature filter is as
follows:
ffmpeg -i input.mp4 -vf "colortemperature=temperature=VALUE" output.mp4Alternatively, you can use the short-form parameter t
instead of temperature:
ffmpeg -i input.mp4 -vf "colortemperature=t=VALUE" output.mp4Key Parameters
temperature(ort): Sets the color temperature in Kelvin. The allowed range is from1000to40000. The default value is6500.- Lowering the value (e.g.,
4000) shifts the colors toward warmer, reddish-yellow tones. - Increasing the value (e.g.,
9000) shifts the colors toward cooler, bluish tones.
- Lowering the value (e.g.,
mix(orm): Determines the mix ratio between the filtered and original video. The range is from0.0(completely original) to1.0(fully filtered). The default value is1.0.pl(orplackian): Controls the Plackian (Planckian) locus mix. The range is from0.0to1.0. The default is0.0.
Practical Examples
1. Making a Video Warmer
To give your video a warm, golden-hour look, lower the temperature below the 6500K neutral point. This example sets the temperature to 4000K:
ffmpeg -i input.mp4 -vf "colortemperature=t=4000" output.mp42. Making a Video Cooler
To give your video a cold, blue, or sci-fi aesthetic, raise the temperature above the 6500K neutral point. This example sets the temperature to 9500K:
ffmpeg -i input.mp4 -vf "colortemperature=t=9500" output.mp43. Adjusting Filter Intensity
If the color shift is too intense, you can use the mix
parameter to blend the temperature adjustment with the original footage.
This example applies a cool 8000K temperature but only mixes it at 50%
intensity:
ffmpeg -i input.mp4 -vf "colortemperature=t=8000:mix=0.5" output.mp4