How to Pulse Saturation in FFmpeg Using Hue Filter

This article explains how to program the saturation of a video to pulse rhythmically using the hue filter in FFmpeg. By applying mathematical expressions containing sine waves and time variables to the saturation parameter, you can create dynamic, oscillating color effects without needing complex video editing software.

To make the saturation pulse rhythmically, you must use the s (saturation) parameter of FFmpeg’s hue filter and assign it an expression that varies over time. The mathematical formula for a rhythmic pulse relies on the sine (sin) function, using the frame timestamp (t) as the driving variable.

The Basic Command

Here is the standard FFmpeg command to apply a rhythmic saturation pulse:

ffmpeg -i input.mp4 -vf "hue=s='1 + 0.8*sin(2*PI*1*t)'" -c:a copy output.mp4

Breakdown of the Saturation Expression

The expression '1 + 0.8*sin(2*PI*1*t)' controls how the saturation behaves over time:

Customizing the Pulse

You can adjust the math inside the expression to change the rhythm and style of the pulse: