[FFmpeg-devel] [PATCH] avfilter: add xfade filter

Lou Logan lou at lrcd.com
Thu Jan 30 01:34:52 EET 2020


On Sun, Jan 26, 2020, at 4:46 AM, Paul B Mahol wrote:
> + at item wipeleft
> + at item wiperight
> + at item wipeup
> + at item wipedown

Nice filter, but you're missing the best wipe of them all: starwipe.

> + at item slideleft
> + at item slideright
> + at item slideup
> + at item slidedown
> + at end table
> +Default transition effect is fade.
> +
> + at item duration
> +Set cross fade duration in seconds.

Add "Default is 1 second".

> + at item offset
> +Set cross fade start relative to first input stream.

Add "Default is 0".

Compilation is spammy with warnings on gcc 9.2.0:

libavfilter/vf_xfade.c: In function ‘uninit’:
libavfilter/vf_xfade.c:107:19: warning: unused variable ‘s’ [-Wunused-variable]
  107 |     XFadeContext *s = ctx->priv;
      |                   ^
libavfilter/vf_xfade.c: In function ‘slideleft8_transition’:
libavfilter/vf_xfade.c:300:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  300 |                 dst[x] = (zx > 0) * (zx < width) ? xf1[zz] : xf0[zz];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~
libavfilter/vf_xfade.c:310:1: note: in expansion of macro ‘SLIDELEFT_TRANSITION’
  310 | SLIDELEFT_TRANSITION(8, uint8_t, 1)
      | ^~~~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slideleft16_transition’:
libavfilter/vf_xfade.c:300:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  300 |                 dst[x] = (zx > 0) * (zx < width) ? xf1[zz] : xf0[zz];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~
libavfilter/vf_xfade.c:311:1: note: in expansion of macro ‘SLIDELEFT_TRANSITION’
  311 | SLIDELEFT_TRANSITION(16, uint16_t, 2)
      | ^~~~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slideright8_transition’:
libavfilter/vf_xfade.c:333:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  333 |                 dst[x] = (zx > 0) * (zx < width) ? xf1[zz] : xf0[zz];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~
libavfilter/vf_xfade.c:343:1: note: in expansion of macro ‘SLIDERIGHT_TRANSITION’
  343 | SLIDERIGHT_TRANSITION(8, uint8_t, 1)
      | ^~~~~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slideright16_transition’:
libavfilter/vf_xfade.c:333:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  333 |                 dst[x] = (zx > 0) * (zx < width) ? xf1[zz] : xf0[zz];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~
libavfilter/vf_xfade.c:344:1: note: in expansion of macro ‘SLIDERIGHT_TRANSITION’
  344 | SLIDERIGHT_TRANSITION(16, uint16_t, 2)
      | ^~~~~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slideup8_transition’:
libavfilter/vf_xfade.c:366:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  366 |                 dst[x] = (zy > 0) * (zy < height) ? xf1[x] : xf0[x];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~~
libavfilter/vf_xfade.c:374:1: note: in expansion of macro ‘SLIDEUP_TRANSITION’
  374 | SLIDEUP_TRANSITION(8, uint8_t, 1)
      | ^~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slideup16_transition’:
libavfilter/vf_xfade.c:366:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  366 |                 dst[x] = (zy > 0) * (zy < height) ? xf1[x] : xf0[x];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~~
libavfilter/vf_xfade.c:375:1: note: in expansion of macro ‘SLIDEUP_TRANSITION’
  375 | SLIDEUP_TRANSITION(16, uint16_t, 2)
      | ^~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slidedown8_transition’:
libavfilter/vf_xfade.c:397:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  397 |                 dst[x] = (zy > 0) * (zy < height) ? xf1[x] : xf0[x];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~~
libavfilter/vf_xfade.c:405:1: note: in expansion of macro ‘SLIDEDOWN_TRANSITION’
  405 | SLIDEDOWN_TRANSITION(8, uint8_t, 1)
      | ^~~~~~~~~~~~~~~~~~~~
libavfilter/vf_xfade.c: In function ‘slidedown16_transition’:
libavfilter/vf_xfade.c:397:35: warning: ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
  397 |                 dst[x] = (zy > 0) * (zy < height) ? xf1[x] : xf0[x];                \
      |                          ~~~~~~~~~^~~~~~~~~~~~~~~
libavfilter/vf_xfade.c:406:1: note: in expansion of macro ‘SLIDEDOWN_TRANSITION’
  406 | SLIDEDOWN_TRANSITION(16, uint16_t, 2)
      | ^~~~~~~~~~~~~~~~~~~~


More information about the ffmpeg-devel mailing list