deband¶
- see also
deband:
Remove banding artifacts from input video. It works by replacing banded pixels with average value of referenced pixels.
1thr, 2thr, 3thr, 4thr¶
1thr, 2thr, 3thr, 4thr:
Watch on youtube.comSet banding detection threshold for each plane. Default is
0.02
. Valid range is0.00003
to0.5
. If difference between current pixel and reference pixel is less than threshold, it will be considered as banded.
#! /bin/sh
pref="`basename $0 .sh`"
ifn="Pexels Videos 1457810.mp4"
thr=${thr:-0.002}
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]deband=1thr=${thr}:2thr=${thr}:3thr=${thr}
" ${pref}.mp4
thr=0.005 |
00:00:00 | 00:02:18 | 00:04:36 |
thr=0.02 |
00:00:23 | 00:02:41 | 00:04:59 |
thr=0.05 |
00:00:46 | 00:03:04 | 00:05:22 |
thr=0.1 |
00:01:09 | 00:03:27 | 00:05:45 |
thr=0.25 |
00:01:32 | 00:03:50 | 00:06:08 |
thr=0.5 |
00:01:55 | 00:04:13 | 00:06:31 |
range¶
range:
Watch on youtube.comBanding detection range in pixels. Default is
16
. If positive, random number in range 0 to set value will be used. If negative, exact absolute value will be used. The range defines square of four pixels around current pixel.
#! /bin/sh
pref="`basename $0 .sh`"
ifn="Pexels Videos 1457810.mp4"
thr=${thr:-0.002}
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]deband=1thr=${thr}:2thr=${thr}:3thr=${thr}:r=${r:-16}
" ${pref}.mp4
direction¶
direction:
Watch on youtube.comSet direction in radians from which four pixel will be compared. If positive, random direction from
0
to setdirection
will be picked. If negative, exact of absolute value will be picked. For example direction0
,-PI
or-2*PI
radians will pick only pixels on same row and -PI/2 will pick only pixels on same column.
#! /bin/sh
pref="`basename $0 .sh`"
ifn="input.mp4"
thr=${thr:-0.002}
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]deband=1thr=${thr}:2thr=${thr}:3thr=${thr}:d=${d:--PI/2}
" ${pref}.mp4
blur¶
blur:
Watch on youtube.comIf enabled, current pixel is compared with average value of all four surrounding pixels. The default is enabled. If disabled current pixel is compared with all four surrounding pixels. The pixel is considered banded if only all four differences with surrounding pixels are less than threshold.
#! /bin/sh
pref="`basename $0 .sh`"
ifn="Pexels Videos 1457810.mp4"
thr=${thr:-0.002}
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]deband=1thr=${thr}:2thr=${thr}:3thr=${thr}:b=${b:-0}
" ${pref}.mp4
coupling¶
coupling:
Watch on youtube.comIf enabled, current pixel is changed if and only if all pixel components are banded, e.g. banding detection threshold is triggered for all color components. The default is disabled.
#! /bin/sh
pref="`basename $0 .sh`"
ifn="input.mp4"
thr=${thr:-0.002}
thr2=${thr:-0.002}
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]deband=1thr=${thr}:2thr=${thr2}:3thr=${thr2}:c=${c:-1}
" ${pref}.mp4
Input video of above example was generated by:
#! /bin/sh
ffmpeg -y -filter_complex "
color=s=1920x1080,format=yuv444p,loop=-1:size=2,trim=0:20
,geq='
lum=64*floor(mod(X+T*100,W)/64)*(255/W):
cr=128-mod(X+T*100,W)*(64/W):
cb=128+mod(X+T*100,W)*(64/W)'
" grad.mp4