[FFmpeg-user] Problem with colorhold filter

Michael Koch astroelectronic at t-online.de
Sat May 16 10:41:32 EEST 2020


Hi,

I just found out that the colorhold filter doesn't behave as described. 
In the documentation is written:
similarity
Similarity percentage with the above color. 0.01 matches only the exact 
key color, while 1.0 matches everything.

But when I use similarity=1.0, it matches a wide range of colors, but 
not everything. Can be reproduced as follows:

ffmpeg -f lavfi -i color=black:s=1280x256 -vf 
geq=r='clip(512-X,0,255)+clip(X-1024,0,255)':g='lt(X,512)*clip(X,0,255)+gte(X,512)*clip(1024-X,0,255)':b='lt(X,1024)*clip(X-512,0,255)+gte(X,1024)*clip(1536-X,0,255)',oscilloscope=tw=1:s=1 
-frames 1 -y spectrum.png

ffmpeg -i spectrum.png -filter_complex 
colorhold=color=00FF00:similarity=1.0:blend=0 -y out.png

Michael



More information about the ffmpeg-user mailing list