Skip to content

(FFmpeg) How to Edit the Hue of a Video?

The hue filter allows for modification of the hue and saturation of a video. 

Figure 57.0: applying a hue and saturation

In the example below, the hue is set to 45 degrees with an increased saturation, as seen in figure 57.0:

$ ffmpeg -i input.mp4 -vf "hue=h=45:s=2" output.mp4
Figure 57.1: dynamic hues

The hue filter also has framing and time parameters that allow for great effects like animating through hue colors quickly. Expressions can also be programmed, as seen in figure 57.1:

 $ ffmpeg -i input.mp4 -vf "hue=H=2*PI*t:s=cos(2*PI*t)+10" output.mp4
	Indicates the hue filter name

	Indicates the hue angle as a number of degrees (default 0)

	Indicates the saturation (10 to -10 with default 1)

	Indicates hue angle as a number of radians (default 0)

	Indicates the brightness (10 to -10 with default 0)

	Indicates frame count of the input frame (starts at 0)

	Indicates the timestamp (HH:MM:SS)

Love FFmpeg? Grab a copy of FFmpeg For Beginners on Kindle or Paperback to learn over 120 ways to master FFmpeg!

buy now on amazon