Skip to content
Browse files
lavfi: add deshake_opencl filter
  • Loading branch information
Cldfire authored and fhvwy committed Aug 22, 2019
1 parent 5b5746b commit b29c7bcbf6bc257f4302b8bed0509bb5489ca068
Showing with 2,924 additions and 1 deletion.
  1. +1 −0 configure
  2. +69 −0 doc/filters.texi
  3. +2 −0 libavfilter/Makefile
  4. +1 −0 libavfilter/allfilters.c
  5. +647 −0 libavfilter/opencl/
  6. +1 −0 libavfilter/opencl_source.h
  7. +1 −1 libavfilter/version.h
  8. +2,202 −0 libavfilter/vf_deshake_opencl.c
@@ -3454,6 +3454,7 @@ delogo_filter_deps="gpl"
drawtext_filter_suggest="libfontconfig libfribidi"
@@ -19795,6 +19795,75 @@ Make every semi-green pixel in the input transparent with some slight blending:
@end example
@end itemize

@section deshake_opencl
Feature-point based video stabilization filter.

The filter accepts the following options:

@table @option
@item tripod
Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to @code{0}.

@item debug
Whether or not additional debug info should be displayed, both in the processed output and in the console.

Note that in order to see console debug output you will also need to pass @code{-v verbose} to ffmpeg.

Viewing point matches in the output video is only supported for RGB input.

Defaults to @code{0}.

@item adaptive_crop
Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.

Defaults to @code{1}.

@item refine_features
Whether or not feature points should be refined at a sub-pixel level.

This can be turned off for a slight performance gain at the cost of precision.

Defaults to @code{1}.

@item smooth_strength
The strength of the smoothing applied to the camera path from @code{0.0} to @code{1.0}.

@code{1.0} is the maximum smoothing strength while values less than that result in less smoothing.

@code{0.0} causes the filter to adaptively choose a smoothing strength on a per-frame basis.

Defaults to @code{0.0}.

@item smooth_window_multiplier
Controls the size of the smoothing window (the number of frames buffered to determine motion information from).

The size of the smoothing window is determined by multiplying the framerate of the video by this number.

Acceptable values range from @code{0.1} to @code{10.0}.

Larger values increase the amount of motion data available for determining how to smooth the camera path,
potentially improving smoothness, but also increase latency and memory usage.

Defaults to @code{2.0}.

@end table

@subsection Examples

Stabilize a video with a fixed, medium smoothing strength:
-i INPUT -vf "hwupload, deshake_opencl=smooth_strength=0.5, hwdownload" OUTPUT
@end example

Stabilize a video with debugging (both in console and in rendered video):
-i INPUT -filter_complex "[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p" -v verbose OUTPUT
@end example
@end itemize

@section nlmeans_opencl

Non-local Means denoise filter through OpenCL, this filter accepts same options as @ref{nlmeans}.
@@ -211,6 +211,8 @@ OBJS-$(CONFIG_DEINTERLACE_VAAPI_FILTER) += vf_deinterlace_vaapi.o vaapi_vpp
OBJS-$(CONFIG_DENOISE_VAAPI_FILTER) += vf_misc_vaapi.o vaapi_vpp.o
OBJS-$(CONFIG_DESHAKE_OPENCL_FILTER) += vf_deshake_opencl.o opencl.o \
@@ -200,6 +200,7 @@ extern AVFilter ff_vf_delogo;
extern AVFilter ff_vf_denoise_vaapi;
extern AVFilter ff_vf_derain;
extern AVFilter ff_vf_deshake;
extern AVFilter ff_vf_deshake_opencl;
extern AVFilter ff_vf_despill;
extern AVFilter ff_vf_detelecine;
extern AVFilter ff_vf_dilation;

0 comments on commit b29c7bc

Please sign in to comment.