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 add color balance to a video

Written by John Riselvato - original link

The color balance filter allows the RGB shadows, midtones, highlights and preserving lightness can be adjusted. This filter can be used to apply very custom color grading or used to create trippy color changes. 

Figure 56.0: green/blue extreme color balance

In this example, the green shadows are increase and the blue highlights are maxed out, as seen in figure 56.0:

  $ ffmpeg -i input.mp4 -vf "colorbalance=gs=.5:bh=1" -pix_fmt yuv420p output.mp4
colorbalance
    Indicates the color balance filter name

rs, gs, bs
    Indicates adjustments to red, green and blue shadows or darkest pixels (1.0 to -1.0 with default 0.0)

rm, gm, bm
    Indicates adjustments to red, green and blue midtones or medium pixels (1.0 to -1.0 with default 0.0)

rh, gh, bh
    Indicates adjustments to red, green and blue highlights or brightest pixels (1.0 to -1.0 with default 0.0)


pl
    Indicates preserve lightness when changing color balance (1.0 to -1.0 with default 0.0)

Tip: Negative values shift to complementary colors while positive values shift to primary colors.