FFmpeg EQ Filter: Adjust Video Contrast and Brightness

This guide explains how to use the FFmpeg eq (equalizer) filter to adjust a video’s contrast, brightness, saturation, and gamma. You will learn the syntax of the filter, the specific parameters for each adjustment, and practical command-line examples to enhance your video processing workflow.

Understanding the EQ Filter Parameters

The eq filter in FFmpeg allows you to adjust video properties on the fly. The filter uses the following key parameters:

Basic Command Syntax

The basic syntax for applying the eq filter uses the -vf (video filter) flag:

ffmpeg -i input.mp4 -vf "eq=parameter=value:parameter2=value2" output.mp4

You can specify one or more parameters separated by colons.

Practical Examples

1. Adjusting Contrast and Brightness

To slightly increase the contrast and brightness of a video, use the following command:

ffmpeg -i input.mp4 -vf "eq=contrast=1.2:brightness=0.05" -c:a copy output.mp4

2. Modifying Saturation

To make a video more vibrant by increasing the color saturation:

ffmpeg -i input.mp4 -vf "eq=saturation=1.5" -c:a copy output.mp4

To convert a video to grayscale, set the saturation to 0:

ffmpeg -i input.mp4 -vf "eq=saturation=0" -c:a copy output.mp4

3. Adjusting Gamma

Gamma correction helps in fixing videos that are too dark or washed out without clipping the highlights or shadows. To lower the gamma (making midtones brighter):

ffmpeg -i input.mp4 -vf "eq=gamma=1.5" -c:a copy output.mp4

To increase the gamma (making midtones darker):

ffmpeg -i input.mp4 -vf "eq=gamma=0.8" -c:a copy output.mp4

4. Combining All Adjustments

You can combine all four parameters into a single command to achieve the precise look you desire:

ffmpeg -i input.mp4 -vf "eq=contrast=1.1:brightness=0.02:saturation=1.2:gamma=0.9" -c:a copy output.mp4

This command increases the contrast by 10%, adds a touch of brightness, boosts the color saturation by 20%, and slightly darkens the midtones using gamma.