[FFmpeg-user] fftfilt
Michael Koch
astroelectronic at t-online.de
Thu Oct 14 13:28:24 EEST 2021
Am 14.10.2021 um 12:07 schrieb Paul B Mahol:
> Sorry but I'm not on windows, so I can not use your script.
Then try the below (slightly improved) version. It would become much
simpler with variables:
ARRAY_H = pow(2,ceil(log(ceil(W*10/9))/log(2)))
ARRAY_V = pow(2,ceil(log(ceil(H*10/9))/log(2)))
The test image contains wavelengths from 4 to 8 (in the center) to 16
pixels per linepair.
The filter wavelength is independant of input size. You can change the
size in the first command (but it must be 1:1 aspect ratio, otherwise
hstack would fail)
Michael
ffmpeg -f lavfi -i color=black:s=230x230 -lavfi
geq='r=127.5+127.5*cos((X-W/2)*PI/(pow(2,(1+2*Y/H))))',colorchannelmixer=1:0:0:0:1:0:0:0:1:0:0:0,split[h][v];[v]transpose[v];[v][h]hstack
-frames 1 -y test.png
ffmpeg -i test.png -vf
scale=2*iw:2*ih,fftfilt=dc_Y=0:dc_U=0:dc_V=0:weight_Y='lte(hypot(X/pow(2,ceil(log(ceil(W*10/9))/log(2))),Y/pow(2,ceil(log(ceil(H*10/9))/log(2)))),1.0/8)':weight_U=1:weight_V=1,scale=iw/2:ih/2
-y lowpass.png
ffmpeg -i test.png -vf
scale=2*iw:2*ih,fftfilt=dc_Y=128:dc_U=1:dc_V=1:weight_Y='gte(hypot(X/pow(2,ceil(log(ceil(W*10/9))/log(2))),Y/pow(2,ceil(log(ceil(H*10/9))/log(2)))),1.0/8)':weight_U=1:weight_V=1,scale=iw/2:ih/2
-y highpass.png
ffmpeg -i test.png -vf
scale=2*iw:2*ih,fftfilt=dc_Y=128:dc_U=1:dc_V=1:weight_Y='between(hypot(X/pow(2,ceil(log(ceil(W*10/9))/log(2))),Y/pow(2,ceil(log(ceil(H*10/9))/log(2)))),0.8/8,1.2/8)':weight_U=1:weight_V=1,scale=iw/2:ih/2
-y bandpass.png
ffmpeg -i test.png -vf
scale=2*iw:2*ih,fftfilt=dc_Y=0:dc_U=0:dc_V=0:weight_Y='1-between(hypot(X/pow(2,ceil(log(ceil(W*10/9))/log(2))),Y/pow(2,ceil(log(ceil(H*10/9))/log(2)))),0.8/8,1.2/8)':weight_U=1:weight_V=1,scale=iw/2:ih/2
-y notch.png
More information about the ffmpeg-user
mailing list