colorlevels

Watch on youtube.com
doc

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

rimin, gimin, bimin

Minimum input levels are used to darken shadows (dark tones).

Example 1

00:00:00
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimin=0.1:
gimin=0.1:
bimin=0.1
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 2

00:00:06
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimin=0.2:
gimin=0.2:
bimin=0.2
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 3

00:00:12
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimin=0.4:
gimin=0.4:
bimin=0.4
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 4

00:00:18
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimin=0.4:
gimin=0.0:
bimin=0.0
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 5

00:00:24
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimin=0.0:
gimin=0.4:
bimin=0.0
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 6

00:00:30
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimin=0.0:
gimin=0.0:
bimin=0.4
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

rimax, gimax, bimax

Maximum input levels are used to lighten highlights (bright tones).

Example 1

00:00:36
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimax=0.9:
gimax=0.9:
bimax=0.9
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 2

00:00:42
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimax=0.8:
gimax=0.8:
bimax=0.8
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 3

00:00:48
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimax=0.7:
gimax=0.7:
bimax=0.7
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 4

00:00:54
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimax=0.7:
gimax=1.0:
bimax=1.0
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 5

00:01:00
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimax=1.0:
gimax=0.7:
bimax=1.0
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 6

00:01:06
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
rimax=1.0:
gimax=1.0:
bimax=0.7
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

romax, gomax, bomax

Output levels allows manual selection of a constrained output level range.

Example 1

00:01:12
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
romin=0.3:romax=1.0:
gomin=0.3:gomax=1.0:
bomin=0.3:bomax=1.0
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 2

00:01:18
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
romin=0.3:romax=0.7:
gomin=0.3:gomax=0.7:
bomin=0.3:bomax=0.7
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"

Example 3

00:01:24
#! /bin/sh
ifn="Pexels_855634.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]colorlevels=
romin=0.4:romax=0.6:
gomin=0.4:gomax=0.6:
bomin=0.4:bomax=0.6
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"