Modify the hue and/or the saturation of the input.
This filter accepts the following optional named options:
- h
-
Specify the hue angle as a number of degrees. It accepts a float number or an expression, and defaults to 0.0.
- H
-
Specify the hue angle as a number of radians. It accepts a float number or an expression, and defaults to 0.0.
- s
-
Specify the saturation in the [-10,10] range. It accepts a float number and defaults to 1.0.
The h, H and s parameters are expressions containing the following constants:
- n
-
frame count of the input frame starting from 0
- pts
-
presentation timestamp of the input frame expressed in time base units
- r
-
frame rate of the input video, NAN if the input frame rate is unknown
- t
-
timestamp expressed in seconds, NAN if the input timestamp is unknown
- tb
-
time base of the input video
The options can also be set using the syntax: hue:saturation
In this case hue is expressed in degrees.
Examples
-
Set the hue to 90 degrees and the saturation to 1.0:
hue=h=90:s=1
-
Same command but expressing the hue in radians:
hue=H=PI/2:s=1
-
Same command without named options, hue must be expressed in degrees:
hue=90:1
-
Note that "h:s" syntax does not support expressions for the values of h and s, so the following example will issue an error:
hue=PI/2:1
-
Rotate hue and make the saturation swing between 0 and 2 over a period of 1 second:
hue="H=2*PI*t: s=sin(2*PI*t)+1"
-
Apply a 3 seconds saturation fade-in effect starting at 0:
hue="s=min(t/3\,1)"
The general fade-in expression can be written as:
hue="s=min(0\, max((t-START)/DURATION\, 1))"
-
Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
hue="s=max(0\, min(1\, (8-t)/3))"
The general fade-out expression can be written as:
hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
Commands
This filter supports the following command:
- reinit
-
Modify the hue and/or the saturation of the input video. The command accepts the same named options and syntax than when calling the filter from the command-line.
If a parameter is omitted, it is kept at its current value.