Adjust Video Saturation and Gamma with FFmpeg eq Filter
This guide explains how to use the FFmpeg eq (equalizer)
filter to adjust video saturation and gamma. You will learn the basic
syntax, the specific parameters for saturation and gamma, and practical
command-line examples to fine-tune your video’s visual appearance.
The eq filter in FFmpeg is a powerful tool for adjusting
video properties like contrast, brightness, saturation, and gamma.
Understanding the Parameters
saturation: Controls the intensity of colors. The default value is1.0. A value of0.0produces a grayscale (black and white) video, while values greater than1.0increase color intensity. The allowed range is0.0to3.0.gamma: Controls the midtone brightness without affecting the absolute black and white points. The default value is1.0. Values below1.0will darken the midtones, while values above1.0will brighten them. The allowed range is0.1to10.0.
How to Adjust Saturation
To change the saturation of a video, use the saturation
parameter within the eq filter.
For example, to increase video saturation by 50% (setting it to
1.5):
ffmpeg -i input.mp4 -vf "eq=saturation=1.5" -c:a copy output.mp4To decrease saturation by 50% (setting it to 0.5):
ffmpeg -i input.mp4 -vf "eq=saturation=0.5" -c:a copy output.mp4How to Adjust Gamma
To change the gamma of a video, use the gamma
parameter.
To brighten the midtones of a dark video (setting gamma to
1.4):
ffmpeg -i input.mp4 -vf "eq=gamma=1.4" -c:a copy output.mp4To darken the midtones (setting gamma to 0.8):
ffmpeg -i input.mp4 -vf "eq=gamma=0.8" -c:a copy output.mp4Combining Saturation and Gamma Adjustments
You can adjust both parameters simultaneously by separating them with
a colon (:) inside the filter argument.
For example, to increase the saturation to 1.3 and
slightly brighten the midtones with a gamma of 1.2:
ffmpeg -i input.mp4 -vf "eq=saturation=1.3:gamma=1.2" -c:a copy output.mp4