[FFmpeg-devel] [PATCH 0/2] Add colorkey video filter

Timo Rothenpieler timo at rothenpieler.org
Thu Jun 11 19:23:33 CEST 2015

Since nobody commented or objected the last time i sent this as RFC, i think
the best way to maybe get it better optimized would be merging it.

People occasionaly ask for this feature(Or rather, for greenscreens).
While this isn't yet the optimal implementation for that usecase, yuv based
chromakey would be better for that, it's a good start and a chromakey filter
would be the next thing to implement.
Using this for a greenscreen already works reasonably well, but uses a lot of
CPU power because of the conversion to rgb and back to yuv. Propably also less
than ideal for the picture quality.

There is still the open question of how to handle the format conversion this
filter does.
It seems to work as expected, as the filter chain appears to be updated when
the first frame with a diffrent format is generated, but so far i haven't
found out if it's possible to announce the mappings in advance.

I still left the float->int math conversion as seperate commit, this way, if
my conversion of the algorithm turns out to be flawed, the original algorithm
is still available as reference.
If this is not desireable, i can squash it into one commit.

Timo Rothenpieler (2):
  avfilter/vf_colorkey: Add colorkey video filter
  avfilter/vf_colorkey: Transform calculations to integer math

 Changelog                 |   1 +
 MAINTAINERS               |   1 +
 doc/filters.texi          |  39 +++++++
 libavfilter/Makefile      |   1 +
 libavfilter/allfilters.c  |   1 +
 libavfilter/vf_colorkey.c | 282 ++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 325 insertions(+)
 create mode 100644 libavfilter/vf_colorkey.c


More information about the ffmpeg-devel mailing list