lavfi/vidstabtransform: apply various documentation/option minor fixes
Improve consistency with the rest of the documentation.
This commit is contained in:
parent
676a395ab9
commit
3dc494f8b9
116
doc/filters.texi
116
doc/filters.texi
@ -8136,23 +8136,27 @@ the unsharp filter, see below.
|
|||||||
To enable compilation of this filter you need to configure FFmpeg with
|
To enable compilation of this filter you need to configure FFmpeg with
|
||||||
@code{--enable-libvidstab}.
|
@code{--enable-libvidstab}.
|
||||||
|
|
||||||
This filter accepts the following options:
|
@subsection Options
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
|
|
||||||
@item input
|
@item input
|
||||||
path to the file used to read the transforms (default: @file{transforms.trf})
|
Set path to the file used to read the transforms. Default value is
|
||||||
|
@file{transforms.trf}).
|
||||||
|
|
||||||
@item smoothing
|
@item smoothing
|
||||||
Set the number of frames (value*2 + 1) used for lowpass filtering the camera movements
|
Set the number of frames (value*2 + 1) used for lowpass filtering the
|
||||||
(default: 10). For example a number of 10 means that 21 frames are used
|
camera movements. Default value is 10.
|
||||||
(10 in the past and 10 in the future) to smoothen the motion in the
|
|
||||||
video. A larger values leads to a smoother video, but limits the
|
For example a number of 10 means that 21 frames are used (10 in the
|
||||||
acceleration of the camera (pan/tilt movements).
|
past and 10 in the future) to smoothen the motion in the video. A
|
||||||
0 is a special case where a static camera is simulated.
|
larger values leads to a smoother video, but limits the acceleration
|
||||||
|
of the camera (pan/tilt movements). 0 is a special case where a
|
||||||
|
static camera is simulated.
|
||||||
|
|
||||||
@item optalgo
|
@item optalgo
|
||||||
Set the camera path optimization algorithm:
|
Set the camera path optimization algorithm.
|
||||||
|
|
||||||
|
Accepted values are:
|
||||||
@table @samp
|
@table @samp
|
||||||
@item gauss
|
@item gauss
|
||||||
gaussian kernel low-pass filter on camera motion (default)
|
gaussian kernel low-pass filter on camera motion (default)
|
||||||
@ -8161,16 +8165,18 @@ averaging on transformations
|
|||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item maxshift
|
@item maxshift
|
||||||
maximal number of pixels to translate frames (default: -1 no limit)
|
Set maximal number of pixels to translate frames. Default value is -1,
|
||||||
|
meaning no limit.
|
||||||
|
|
||||||
@item maxangle
|
@item maxangle
|
||||||
maximal angle in radians (degree*PI/180) to rotate frames (default: -1
|
Set maximal angle in radians (degree*PI/180) to rotate frames. Default
|
||||||
no limit)
|
value is -1, meaning no limit.
|
||||||
|
|
||||||
@item crop
|
@item crop
|
||||||
How to deal with borders that may be visible due to movement
|
Specify how to deal with borders that may be visible due to movement
|
||||||
compensation. Available values are:
|
compensation.
|
||||||
|
|
||||||
|
Available values are:
|
||||||
@table @samp
|
@table @samp
|
||||||
@item keep
|
@item keep
|
||||||
keep image information from previous frame (default)
|
keep image information from previous frame (default)
|
||||||
@ -8179,49 +8185,41 @@ fill the border black
|
|||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item invert
|
@item invert
|
||||||
@table @samp
|
Invert transforms if set to 1. Default value is 0.
|
||||||
@item 0
|
|
||||||
keep transforms normal (default)
|
|
||||||
@item 1
|
|
||||||
invert transforms
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@item relative
|
@item relative
|
||||||
consider transforms as
|
Consider transforms as relative to previsou frame if set to 1,
|
||||||
@table @samp
|
absolute if set to 0. Default value is 0.
|
||||||
@item 0
|
|
||||||
absolute
|
|
||||||
@item 1
|
|
||||||
relative to previous frame (default)
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@item zoom
|
@item zoom
|
||||||
Set percentage to zoom (default: 0)
|
Set percentage to zoom. A positive value will result in a zoom-in
|
||||||
@table @samp
|
effect, a negative value in a zoom-out effect. Default value is 0 (no
|
||||||
@item >0
|
zoom).
|
||||||
zoom in
|
|
||||||
@item <0
|
|
||||||
zoom out
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@item optzoom
|
@item optzoom
|
||||||
Set optimal zooming to avoid borders
|
Set optimal zooming to avoid borders.
|
||||||
|
|
||||||
|
Accepted values are:
|
||||||
@table @samp
|
@table @samp
|
||||||
@item 0
|
@item 0
|
||||||
disabled
|
disabled
|
||||||
@item 1
|
@item 1
|
||||||
optimal static zoom value is determined (only very strong movements will lead to visible borders) (default)
|
optimal static zoom value is determined (only very strong movements
|
||||||
|
will lead to visible borders) (default)
|
||||||
@item 2
|
@item 2
|
||||||
optimal adaptive zoom value is determined (no borders will be visible), see @option{zoomspeed}
|
optimal adaptive zoom value is determined (no borders will be
|
||||||
|
visible), see @option{zoomspeed}
|
||||||
@end table
|
@end table
|
||||||
Note that the value given at zoom is added to the one calculated
|
|
||||||
here.
|
Note that the value given at zoom is added to the one calculated here.
|
||||||
|
|
||||||
@item zoomspeed
|
@item zoomspeed
|
||||||
Set percent to zoom maximally each frame (for @option{optzoom=2}). Range is from 0 to 5, default value is 0.2
|
Set percent to zoom maximally each frame (enabled when
|
||||||
|
@option{optzoom} is set to 2). Range is from 0 to 5, default value is
|
||||||
|
0.25.
|
||||||
|
|
||||||
@item interpol
|
@item interpol
|
||||||
type of interpolation
|
Specify type of interpolation.
|
||||||
|
|
||||||
Available values are:
|
Available values are:
|
||||||
@table @samp
|
@table @samp
|
||||||
@ -8236,49 +8234,39 @@ cubic in both directions (slow)
|
|||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item tripod
|
@item tripod
|
||||||
virtual tripod mode means that the video is stabilized such that the
|
Enable virtual tripod mode if set to 1, which is equivalent to
|
||||||
camera stays stationary. Use also @code{tripod} option of
|
@code{relative=0:smoothing=0}. Default value is 0.
|
||||||
@ref{vidstabdetect}.
|
|
||||||
@table @samp
|
Use also @code{tripod} option of @ref{vidstabdetect}.
|
||||||
@item 0
|
|
||||||
off (default)
|
|
||||||
@item 1
|
|
||||||
virtual tripod mode: equivalent to @code{relative=0:smoothing=0}
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@item debug
|
@item debug
|
||||||
Increase log verbosity of set to 1. Also the detected global motions are written to the temporary file @file{global_motions.trf}.
|
Increase log verbosity if set to 1. Also the detected global motions
|
||||||
@table @samp
|
are written to the temporary file @file{global_motions.trf}. Default
|
||||||
@item 0
|
value is 0.
|
||||||
disabled (default)
|
|
||||||
@item 1
|
|
||||||
enabled
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@subsection Examples
|
@subsection Examples
|
||||||
|
|
||||||
@itemize
|
@itemize
|
||||||
@item
|
@item
|
||||||
typical call with default default values:
|
Use @command{ffmpeg} for a typical stabilization with default values:
|
||||||
(note the unsharp filter which is always recommended)
|
|
||||||
@example
|
@example
|
||||||
ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
|
ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
Note the use of the unsharp filter which is always recommended.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
zoom in a bit more and load transform data from a given file
|
Zoom in a bit more and load transform data from a given file:
|
||||||
@example
|
@example
|
||||||
vidstabtransform=zoom=5:input="mytransforms.trf"
|
vidstabtransform=zoom=5:input="mytransforms.trf"
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@item
|
@item
|
||||||
smoothen the video even more
|
Smoothen the video even more:
|
||||||
@example
|
@example
|
||||||
vidstabtransform=smoothing=30
|
vidstabtransform=smoothing=30
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
@section vflip
|
@section vflip
|
||||||
|
@ -47,11 +47,12 @@ typedef struct {
|
|||||||
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
|
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
|
||||||
|
|
||||||
static const AVOption vidstabtransform_options[] = {
|
static const AVOption vidstabtransform_options[] = {
|
||||||
{"input", "path to the file storing the transforms", OFFSET(input),
|
{"input", "set path to the file storing the transforms", OFFSET(input),
|
||||||
AV_OPT_TYPE_STRING, {.str = DEFAULT_INPUT_NAME}, .flags = FLAGS },
|
AV_OPT_TYPE_STRING, {.str = DEFAULT_INPUT_NAME}, .flags = FLAGS },
|
||||||
{"smoothing", "number of frames*2 + 1 used for lowpass filtering", OFFSETC(smoothing),
|
{"smoothing", "set number of frames*2 + 1 used for lowpass filtering", OFFSETC(smoothing),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 15}, 0, 1000, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = 15}, 0, 1000, FLAGS},
|
||||||
{"optalgo", "camera path optimization algo", OFFSETC(camPathAlgo),
|
|
||||||
|
{"optalgo", "set camera path optimization algo", OFFSETC(camPathAlgo),
|
||||||
AV_OPT_TYPE_INT, {.i64 = VSOptimalL1}, VSOptimalL1, VSAvg, FLAGS, "optalgo"},
|
AV_OPT_TYPE_INT, {.i64 = VSOptimalL1}, VSOptimalL1, VSAvg, FLAGS, "optalgo"},
|
||||||
{ "opt", "global optimization", 0, // from version 1.0 on
|
{ "opt", "global optimization", 0, // from version 1.0 on
|
||||||
AV_OPT_TYPE_CONST, {.i64 = VSOptimalL1 }, 0, 0, FLAGS, "optalgo"},
|
AV_OPT_TYPE_CONST, {.i64 = VSOptimalL1 }, 0, 0, FLAGS, "optalgo"},
|
||||||
@ -59,27 +60,31 @@ static const AVOption vidstabtransform_options[] = {
|
|||||||
AV_OPT_TYPE_CONST, {.i64 = VSGaussian }, 0, 0, FLAGS, "optalgo"},
|
AV_OPT_TYPE_CONST, {.i64 = VSGaussian }, 0, 0, FLAGS, "optalgo"},
|
||||||
{ "avg", "simple averaging on motion", 0,
|
{ "avg", "simple averaging on motion", 0,
|
||||||
AV_OPT_TYPE_CONST, {.i64 = VSAvg }, 0, 0, FLAGS, "optalgo"},
|
AV_OPT_TYPE_CONST, {.i64 = VSAvg }, 0, 0, FLAGS, "optalgo"},
|
||||||
{"maxshift", "maximal number of pixels to translate image", OFFSETC(maxShift),
|
|
||||||
|
{"maxshift", "set maximal number of pixels to translate image", OFFSETC(maxShift),
|
||||||
AV_OPT_TYPE_INT, {.i64 = -1}, -1, 500, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = -1}, -1, 500, FLAGS},
|
||||||
{"maxangle", "maximal angle in rad to rotate image", OFFSETC(maxAngle),
|
{"maxangle", "set maximal angle in rad to rotate image", OFFSETC(maxAngle),
|
||||||
AV_OPT_TYPE_DOUBLE, {.dbl = -1.0}, -1.0, 3.14, FLAGS},
|
AV_OPT_TYPE_DOUBLE, {.dbl = -1.0}, -1.0, 3.14, FLAGS},
|
||||||
{"crop", "set cropping mode", OFFSETC(crop),
|
|
||||||
|
{"crop", "set cropping mode", OFFSETC(crop),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS, "crop"},
|
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS, "crop"},
|
||||||
{ "keep", "keep border", 0,
|
{ "keep", "keep border", 0,
|
||||||
AV_OPT_TYPE_CONST, {.i64 = VSKeepBorder }, 0, 0, FLAGS, "crop"},
|
AV_OPT_TYPE_CONST, {.i64 = VSKeepBorder }, 0, 0, FLAGS, "crop"},
|
||||||
{ "black", "black border", 0,
|
{ "black", "black border", 0,
|
||||||
AV_OPT_TYPE_CONST, {.i64 = VSCropBorder }, 0, 0, FLAGS, "crop"},
|
AV_OPT_TYPE_CONST, {.i64 = VSCropBorder }, 0, 0, FLAGS, "crop"},
|
||||||
{"invert", "1: invert transforms", OFFSETC(invert),
|
|
||||||
|
{"invert", "invert transforms", OFFSETC(invert),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
||||||
{"relative", "consider transforms as 0: absolute, 1: relative", OFFSETC(relative),
|
{"relative", "consider transforms as relative", OFFSETC(relative),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, FLAGS},
|
||||||
{"zoom", "percentage to zoom >0: zoom in, <0 zoom out", OFFSETC(zoom),
|
{"zoom", "set percentage to zoom (>0: zoom in, <0: zoom out", OFFSETC(zoom),
|
||||||
AV_OPT_TYPE_DOUBLE, {.dbl = 0}, -100, 100, FLAGS},
|
AV_OPT_TYPE_DOUBLE, {.dbl = 0}, -100, 100, FLAGS},
|
||||||
{"optzoom", "0: nothing, 1: optimal static zoom, 2: optimal dynamic zoom", OFFSETC(optZoom),
|
{"optzoom", "set optimal zoom (0: nothing, 1: optimal static zoom, 2: optimal dynamic zoom)", OFFSETC(optZoom),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 2, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 2, FLAGS},
|
||||||
{"zoomspeed", "for adative zoom: percent to zoom maximally each frame", OFFSETC(zoomSpeed),
|
{"zoomspeed", "for adative zoom: percent to zoom maximally each frame", OFFSETC(zoomSpeed),
|
||||||
AV_OPT_TYPE_DOUBLE, {.dbl = 0.25}, 0, 5, FLAGS},
|
AV_OPT_TYPE_DOUBLE, {.dbl = 0.25}, 0, 5, FLAGS},
|
||||||
{"interpol", "type of interpolation", OFFSETC(interpolType),
|
|
||||||
|
{"interpol", "set type of interpolation", OFFSETC(interpolType),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 2}, 0, 3, FLAGS, "interpol"},
|
AV_OPT_TYPE_INT, {.i64 = 2}, 0, 3, FLAGS, "interpol"},
|
||||||
{ "no", "no interpolation", 0,
|
{ "no", "no interpolation", 0,
|
||||||
AV_OPT_TYPE_CONST, {.i64 = VS_Zero }, 0, 0, FLAGS, "interpol"},
|
AV_OPT_TYPE_CONST, {.i64 = VS_Zero }, 0, 0, FLAGS, "interpol"},
|
||||||
@ -89,9 +94,10 @@ static const AVOption vidstabtransform_options[] = {
|
|||||||
AV_OPT_TYPE_CONST, {.i64 = VS_BiLinear},0, 0, FLAGS, "interpol"},
|
AV_OPT_TYPE_CONST, {.i64 = VS_BiLinear},0, 0, FLAGS, "interpol"},
|
||||||
{ "bicubic", "bi-cubic", 0,
|
{ "bicubic", "bi-cubic", 0,
|
||||||
AV_OPT_TYPE_CONST, {.i64 = VS_BiCubic },0, 0, FLAGS, "interpol"},
|
AV_OPT_TYPE_CONST, {.i64 = VS_BiCubic },0, 0, FLAGS, "interpol"},
|
||||||
{"tripod", "if 1: virtual tripod mode (equiv. to relative=0:smoothing=0)", OFFSET(tripod),
|
|
||||||
|
{"tripod", "enable virtual tripod mode (same as relative=0:smoothing=0)", OFFSET(tripod),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
||||||
{"debug", "if 1: more output printed and global motions are stored to file",OFFSET(debug),
|
{"debug", "enable debug mode and writer global motions information to file", OFFSET(debug),
|
||||||
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user