[FFmpeg-user] Remove everything but a single color (range)

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Mar 18 11:25:18 EET 2020

Am Mi., 18. März 2020 um 02:51 Uhr schrieb Hans Carlson <forbyta at gmx.com>:
> On Wed, 18 Mar 2020, Carl Eugen Hoyos wrote:
> > Am Di., 17. März 2020 um 00:38 Uhr schrieb Hans Carlson <forbyta at gmx.com>:
> >>
> >> Can anyone explain to me why this displays only the yellow bar with
> >> everything else black:
> >>
> >>    ffplay -f lavfi -i 'smptehdbars=duration=5' -vf "colorhold=color=0xbcc906:similarity=0.25,chromakey=color=black:similarity=.2"
> >>
> >> but this displays all bars in gray scale except the yellow bar which is
> >> in color:
> >>
> >>    ffmpeg -f lavfi -i 'smptehdbars=duration=5' -vf "colorhold=color=0xbcc906:similarity=0.25,chromakey=color=black:similarity=.2" TEST-smptehdbars-yellow-only.mkv
> >>
> >> What I want is ONLY the yellow bar and everything else black, as in the
> >> ffplay command.  How can I get the same thing with ffmpeg?
> >
> > You need to also use the overlay filter.
> Can you expand on that a bit?  What am I overlaying?  I only have one
> input.

You have to add a second one (for example the "color" filter) to
achieve what you want.

> And why does the above command work using ffplay, but not ffmpeg?

To make testing infinitely harder (as you found out), ffplay was changed
some time ago to overlay by default (instead of showing what is
"underneath" the transparency layer).

Carl Eugen

More information about the ffmpeg-user mailing list