How to Set RGB Saturation in FFmpeg Vibrance

This guide explains how to control color saturation thresholds using the FFmpeg vibrance filter. Unlike standard saturation filters that boost all colors linearly, the vibrance filter selectively enhances desaturated pixels while preserving already-saturated tones. By configuring the dedicated red, green, and blue balance parameters (rbal, gbal, and bbal), you can precisely target and isolate which color ranges receive the boost and which are suppressed.

Key Filter Parameters

The vibrance filter utilizes an overall intensity control combined with individual color channel balance controls:

  • intensity: Sets the overall strength of the vibrance effect. The valid range is -2.0 to 2.0 (default is 0.0). Positive values boost less-saturated colors, while negative values desaturate them.
  • rbal: Sets the saturation threshold balance for the red channel. Accepts values from -10.0 to 10.0 (default is 1.0).
  • gbal: Sets the saturation threshold balance for the green channel. Accepts values from -10.0 to 10.0 (default is 1.0).
  • bbal: Sets the saturation threshold balance for the blue channel. Accepts values from -10.0 to 10.0 (default is 1.0).

Basic Command Syntax

To use the filter, apply the -vf (video filter) option in your FFmpeg command:

ffmpeg -i input.mp4 -vf "vibrance=intensity=0.5:rbal=1.5:gbal=1.0:bbal=0.8" -c:a copy output.mp4

In this command:

  • intensity=0.5 enables a moderate saturation boost across muted areas.
  • rbal=1.5 increases the saturation sensitivity for red tones.
  • gbal=1.0 maintains standard vibrance scaling for greens.
  • bbal=0.8 reduces the effect on blue tones, preventing over-saturation in skies or water.

Targeted Saturation Examples

1. Boosting Warm Tones (Reds and Yellows)

To make skin tones or sunsets pop without oversaturating cooler background elements, increase the red balance while lowering green and blue:

ffmpeg -i input.mp4 -vf "vibrance=intensity=0.8:rbal=2.0:gbal=0.5:bbal=0.2" -c:a copy output.mp4

2. Enhancing Foliage (Greens)

To bring out grass and foliage without altering skin tones:

ffmpeg -i input.mp4 -vf "vibrance=intensity=0.6:rbal=0.2:gbal=2.5:bbal=0.5" -c:a copy output.mp4

3. Enhancing Sky and Ocean (Blues)

To enrich skies or bodies of water without distorting surrounding landscape elements:

ffmpeg -i input.mp4 -vf "vibrance=intensity=0.7:rbal=0.0:gbal=0.5:bbal=2.0" -c:a copy output.mp4

Fine-Tuning Luma Thresholds

The vibrance filter calculates color saturation relative to perceived luminance. If the balance parameters do not achieve the desired separation between color thresholds, adjust the luma coefficients:

  • rlum: Red luma coefficient (default 0.072186)
  • glum: Green luma coefficient (default 0.715158)
  • blum: Blue luma coefficient (default 0.212656)

Adjusting these shifts the point at which the filter considers a pixel "bright" versus "saturated":

ffmpeg -i input.mp4 -vf "vibrance=intensity=1.0:rbal=1.5:gbal=1.0:bbal=1.0:rlum=0.1:glum=0.6:blum=0.3" -c:a copy output.mp4

Using rbal, gbal, and bbal alongside intensity gives full control over color distribution, preventing clipping while enriching flat or washed-out video channels.