[FFmpeg-devel] [PATCH] life: add slow_death, life_color and death_color options.

Stefano Sabatini stefasab at gmail.com
Tue Dec 6 15:18:37 CET 2011


On date Monday 2011-12-05 00:48:47 +0100, Clément Bœsch encoded:
> ---
> Additionally to the example, here is a more organic one:
>   ffplay -f lavfi life=f=CREDITS:s=400x400:slow_death=1:r=120:death_color=#113366:life_color=#ff0000,boxblur=2:2
> ---
>  doc/filters.texi        |   17 ++++++++++
>  libavfilter/vsrc_life.c |   82 +++++++++++++++++++++++++++++++---------------
>  2 files changed, 72 insertions(+), 27 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index eb1a4df..5e38b08 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -2863,6 +2863,17 @@ If a filename is not specified, the size value defaults to "320x240"
>  @item stitch
>  If set to 1, stitch the left and right grid edges together, and the
>  top and bottom edges also. Defaults to 1.
> +
> + at item slow_death
> +If set to 1, the progressive death effect will be effective: the dead cells
> +will slightly go from @option{death_color} to black.
> +
> + at item life_color
> +Color of a living cell.
> +
> + at item death_color
> +Color of a dead cell. If @option{slow_death} is set, this is the first color
> +used to represent a dead cell.
>  @end table

nit: sort items

[...]

>  static int query_formats(AVFilterContext *ctx)
>  {
> -    static const enum PixelFormat pix_fmts[] = { PIX_FMT_MONOBLACK, PIX_FMT_NONE };
> +    static const enum PixelFormat pix_fmts[] = { PIX_FMT_RGB24, PIX_FMT_NONE };
>      avfilter_set_common_pixel_formats(ctx, avfilter_make_format_list(pix_fmts));
>      return 0;

I'm not overly happy with this, indeed I liked the idea of keeping
this a mono B/W source, please check if making the output format
conditional (depending on slow_death&co.) would complicate the code
so much.
-- 
FFmpeg = Foolish & Fierce Mere Purposeless Extreme Gangster


More information about the ffmpeg-devel mailing list