[FFmpeg-devel] [PATCHv3] avfilter/vf_chromakey: Add chromakey video filter

Lou Logan lou at lrcd.com
Sat Sep 19 22:23:09 CEST 2015


Hi,

I know the docs is similar to colorkey, but I have a few short
suggestions.

On Fri, 18 Sep 2015 16:27:54 +0200, Timo Rothenpieler wrote:

[...]
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 4a55e59..0446204 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -3556,6 +3556,51 @@ boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chrom
>  @end example
>  @end itemize
>  
> + at section chromakey
> +YUV colorspace color/chroma keying.
> +
> +The filter accepts the following options:
> +
> + at table @option
> + at item color
> +The color which will be replaced with transparency.

For the general syntax of this option, check the "Color" section in the
ffmpeg-utils manual. Default is @code{black}.

> + at item similarity
> +Similarity percentage with the key color.
> +
> +0.01 matches only the exact key color, while 1.0 matches everything.

Default is 0.01.

> + at item blend
> +Blend percentage.
> +
> +0.0 makes pixels either fully transparent, or not transparent at all.

Range is 0.0 to 1.0. Default is 0.0.

> +Higher values result in semi-transparent pixels, with a higher transparency
> +the more similar the pixels color is to the key color.
> +
> + at item yuv
> +Signals that the color passed is already in YUV instead of RGB.

Default is disabled.

> +
> +Litteral colors like "green" or "red" don't make sense with this enabled anymore.

s/Litteral/Literal

The "anymore" can be removed.

What happens if a literal color is used when the yuv option is enabled?

[...]

> +static const AVOption chromakey_options[] = {
> +    { "color", "set the chromakey key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
> +    { "similarity", "set the chromakey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
> +    { "blend", "set the chromakey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS },
> +    { "yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },

"indicate that the color parameter is in yuv instead of rgb"


More information about the ffmpeg-devel mailing list