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

Matthias C. M. Troffaes matthias.troffaes at gmail.com
Fri Jun 2 10:38:19 EEST 2017


Attached a patch which adds a "skipblend" filter, which is similar to
the framestep filter, but additionally blends frames together at each
step, for a motion blur effect. The number of frames that are blended
(i.e. the exposure time, in frames) can be set, allowing control over
the strength of the motion blur. The filter has timeline support, and
supports both 8-bit and 16-bit pixel formats. Tests and documentation
included.

This can be used for instance to blend down high framerate footage to
produce a high quality motion blur effect.

Note that a similar effect is already possible by repeatedly chaining
the tblend and framestep=step=2 filters; see for example:

https://video.stackexchange.com/questions/16552/4x-resample-videoframes-using-ffmpeg

But this is limited to steps that are powers of two, and this does not
allow an intermediate exposure time. It's also slower.

Issues addressed: fixed mips failure (reported by Michael), fixed
potential overflow on systems where int is only 16 bits wide (reported
by Moritz), fixed changelog entry position (reported by Moritz), moved
code out of framestep and instead create new filter (requested by Paul
& wm4, I agree this looks cleaner).

In the documentation, I've also added links between framestep, tblend,
and the new skipblend filter, to help users to find the right filter
they are looking for.

Feedback welcome as always.

Kind regards,
Matthias

PS. For reference, previous submissions of this patch with discussion:

https://ffmpeg.org/pipermail/ffmpeg-devel/2017-April/209794.html
https://ffmpeg.org/pipermail/ffmpeg-devel/2017-May/211814.html


Matthias C. M. Troffaes (1):
  avfilter: add skipblend filter

 Changelog                              |   1 +
 doc/filters.texi                       |  30 ++++
 libavfilter/Makefile                   |   1 +
 libavfilter/allfilters.c               |   1 +
 libavfilter/version.h                  |   2 +-
 libavfilter/vf_skipblend.c             | 272 +++++++++++++++++++++++++++++++++
 tests/fate/filter-video.mak            |  12 ++
 tests/ref/fate/filter-skipblend-anim-1 |  17 +++
 tests/ref/fate/filter-skipblend-anim-2 |  17 +++
 tests/ref/fate/filter-skipblend-gray-1 |  14 ++
 tests/ref/fate/filter-skipblend-gray-2 |  13 ++
 11 files changed, 379 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_skipblend.c
 create mode 100644 tests/ref/fate/filter-skipblend-anim-1
 create mode 100644 tests/ref/fate/filter-skipblend-anim-2
 create mode 100644 tests/ref/fate/filter-skipblend-gray-1
 create mode 100644 tests/ref/fate/filter-skipblend-gray-2

-- 
2.7.4



More information about the ffmpeg-devel mailing list