Commit 0c2b37fe authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add displace video filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent b70566d6
......@@ -16,6 +16,7 @@ version <next>:
- Screenpresso SPV1 decoding
- chromaprint fingerprinting muxer
- ffplay dynamic volume control
- displace filter
version 2.8:
......
......@@ -4750,6 +4750,58 @@ Flags to local 3x3 coordinates maps like this:
6 7 8
@end table
@section displace
Displace pixels as indicated by second and third input stream.
It takes three input streams and outputs one stream, the first input is the
source, and second and third input are displacement maps.
The second input specifies how much to displace pixels along the
x-axis, while the third input specifies how much to displace pixels
along the y-axis.
If one of displacement map streams terminates, last frame from that
displacement map will be used.
Note that once generated, displacements maps can be reused over and over again.
A description of the accepted options follows.
@table @option
@item edge
Set displace behavior for pixels that are out of range.
Available values are:
@table @samp
@item blank
Missing pixels are replaced by black pixels.
@item smear
Adjacent pixels will spread out to replace missing pixels.
@item wrap
Out of range pixels are wrapped so they point to pixels of other side.
@end table
Default is @samp{smear}.
@end table
@subsection Examples
@itemize
@item
Add ripple effect to rgb input of video size hd720:
@example
ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
@end example
@item
Add wave effect to rgb input of video size hd720:
@example
ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
@end example
@end itemize
@section drawbox
Draw a colored box on the input image.
......
......@@ -126,6 +126,7 @@ OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o
OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
OBJS-$(CONFIG_DILATION_FILTER) += vf_neighbor.o
OBJS-$(CONFIG_DISPLACE_FILTER) += vf_displace.o framesync.o
OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o
OBJS-$(CONFIG_DRAWGRAPH_FILTER) += f_drawgraph.o
OBJS-$(CONFIG_DRAWGRID_FILTER) += vf_drawbox.o
......
......@@ -148,6 +148,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(DESHAKE, deshake, vf);
REGISTER_FILTER(DETELECINE, detelecine, vf);
REGISTER_FILTER(DILATION, dilation, vf);
REGISTER_FILTER(DISPLACE, displace, vf);
REGISTER_FILTER(DRAWBOX, drawbox, vf);
REGISTER_FILTER(DRAWGRAPH, drawgraph, vf);
REGISTER_FILTER(DRAWGRID, drawgrid, vf);
......
......@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 9
#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_MINOR 10
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment