Alex Balgavy

Just some stuff about me.

Here's my dotfiles repository.

Check out my blog.

My keys: PGP, SSH

My crypto wallets (BTC, XMR)

ffmpeg how to edit the saturation of a video

Written by John Riselvato - original link

Although the hue filter has a saturation variable, FFmpeg also has another filter called vibrance which is used to adjust the color intensity. Both filters give slightly different saturation effects but each has its place.

Figure 59.0: max boosted saturation{width=“436” height=“240”}

In this example, all colors are boosted in the video, as seen in figure 59.0:

 $ ffmpeg -i input.mp4 -filter_complex "vibrance=intensity=2" -pix_fmt yuv420p output.mp4

Figure 59.1: negative intensity + green saturation{width=“436” height=“240”}

A specific color can also be set to apply a saturation. In this example, a negative intensity with a green saturation is applied. As seen in figure 59.1:

  $ ffmpeg -i input.mp4 -filter_complex "vibrance=intensity=-2:gbal=10" -pix_fmt yuv420p output.mp4
intensity
    Indicates the strength of the saturation boost. Positive value boosts while negative value alters (2 to -2 with default 0)

rbal
    Indicates the red balance (10 to -10 with default 1)

gbal
    Indicates the green balance (10 to -10 with default 1)


bbal
    Indicates the blue balance (10 to -10 with default 1)

rlum
    Indicates the red luma coefficient (1 to 0 default 0)

glum
    Indicates the green luma coefficient (1 to 0 default 0)

blum
    Indicates the blue luma coefficient (1 to 0 default 0)