18

How is ffmpeg used with a video filter circa 2017 to adjust gamma/contrast, brightness and saturation?

Stack Exchange resources that are a few years old point to the filter mp=eq2=, but it seems to be deprecated1 and replaced with just eq=. The link does not reveal a good understanding of the setting ranges, however.

How is eq= (or equivalent filters) used? E.g., what is the format and appropriate settings/ranges?

For my personal usage, I'd like to keep gamma where it is, while increasing brightness and saturation a fair bit, for a dark video.


1Throws error message: No such filter: 'mp'

  • 2
    Checks the docs, and look into the curves or pp filter as well. – Gyan Mar 19 '17 at 10:32
  • 2
    The syntax is the same as for all filters. i.e. filtername=option1=value1:option2=value2:option3=value3... These can be in any order. – Gyan Mar 19 '17 at 10:51
  • I don't see any “thank you” to @Gyan — in my humble opinion at least a half of reputation for your own answer to this question belongs to him. – MarianD Jun 27 at 15:42
17

These settings helped me to lighten up a dark video using the filter eq, with some added saturation.

Syntax:

filtername=option1=value1:option2=value2:option3=value3... These can be in any order.

Filter ranges and all options:

https://ffmpeg.org/ffmpeg-filters.html#eq

Preview:

ffplay -vf eq=brightness=0.06:saturation=2 INPUT.MOV

Render:

ffmpeg -i INPUT.MOV -vf eq=brightness=0.06:saturation=2 -c:a copy OUTPUT.MOV


Alternative filters: curves and pp.

  • the preview ffplay is an awesome added value – Amjo Apr 29 at 7:20
3

Gamma correction is likely to be a better choice than brightness, to stretch the histogram to the right rather than push it over:

# tinker with numbers
ffplay -vf eq=gamma=1.5:saturation=1.3 original.vid 

# render
ffmpeg -i original.vid -vf eq=gamma=1.5:saturation=1.3 \
    -c:a copy  outfile.vid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.