FFmpeg
Data Structures | Macros | Functions | Variables
vf_vidstabdetect.c File Reference
#include <vid.stab/libvidstab.h>
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "internal.h"
#include "vidstabutils.h"

Go to the source code of this file.

Data Structures

struct  StabData
 

Macros

#define DEFAULT_RESULT_NAME   "transforms.trf"
 
#define OFFSET(x)   offsetof(StabData, x)
 
#define OFFSETC(x)   (offsetof(StabData, conf)+offsetof(VSMotionDetectConfig, x))
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (vidstabdetect)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 

Variables

static const AVOption vidstabdetect_options []
 
static const AVFilterPad avfilter_vf_vidstabdetect_inputs []
 
static const AVFilterPad avfilter_vf_vidstabdetect_outputs []
 
AVFilter ff_vf_vidstabdetect
 

Macro Definition Documentation

◆ DEFAULT_RESULT_NAME

#define DEFAULT_RESULT_NAME   "transforms.trf"

Definition at line 21 of file vf_vidstabdetect.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(StabData, x)

Definition at line 44 of file vf_vidstabdetect.c.

◆ OFFSETC

#define OFFSETC (   x)    (offsetof(StabData, conf)+offsetof(VSMotionDetectConfig, x))

Definition at line 45 of file vf_vidstabdetect.c.

◆ FLAGS

Definition at line 46 of file vf_vidstabdetect.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( vidstabdetect  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 63 of file vf_vidstabdetect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 72 of file vf_vidstabdetect.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 85 of file vf_vidstabdetect.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 102 of file vf_vidstabdetect.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 159 of file vf_vidstabdetect.c.

Variable Documentation

◆ vidstabdetect_options

const AVOption vidstabdetect_options[]
static
Initial value:
= {
{"result", "path to the file used to write the transforms", OFFSET(result), AV_OPT_TYPE_STRING, {.str = DEFAULT_RESULT_NAME}, .flags = FLAGS},
{"shakiness", "how shaky is the video and how quick is the camera?"
" 1: little (fast) 10: very strong/quick (slow)", OFFSETC(shakiness), AV_OPT_TYPE_INT, {.i64 = 5}, 1, 10, FLAGS},
{"accuracy", "(>=shakiness) 1: low 15: high (slow)", OFFSETC(accuracy), AV_OPT_TYPE_INT, {.i64 = 15}, 1, 15, FLAGS},
{"stepsize", "region around minimum is scanned with 1 pixel resolution", OFFSETC(stepSize), AV_OPT_TYPE_INT, {.i64 = 6}, 1, 32, FLAGS},
{"mincontrast", "below this contrast a field is discarded (0-1)", OFFSETC(contrastThreshold), AV_OPT_TYPE_DOUBLE, {.dbl = 0.25}, 0.0, 1.0, FLAGS},
{"show", "0: draw nothing; 1,2: show fields and transforms", OFFSETC(show), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, FLAGS},
{"tripod", "virtual tripod mode (if >0): motion is compared to a reference"
" reference frame (frame # is the value)", OFFSETC(virtualTripod), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS},
{NULL}
}

Definition at line 48 of file vf_vidstabdetect.c.

◆ avfilter_vf_vidstabdetect_inputs

const AVFilterPad avfilter_vf_vidstabdetect_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}

Definition at line 192 of file vf_vidstabdetect.c.

◆ avfilter_vf_vidstabdetect_outputs

const AVFilterPad avfilter_vf_vidstabdetect_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 202 of file vf_vidstabdetect.c.

◆ ff_vf_vidstabdetect

AVFilter ff_vf_vidstabdetect
Initial value:
= {
.name = "vidstabdetect",
.description = NULL_IF_CONFIG_SMALL("Extract relative transformations, "
"pass 1 of 2 for stabilization "
"(see vidstabtransform for pass 2)."),
.priv_size = sizeof(StabData),
.init = init,
.priv_class = &vidstabdetect_class,
}

Definition at line 210 of file vf_vidstabdetect.c.

FLAGS
#define FLAGS
Definition: vf_vidstabdetect.c:46
DEFAULT_RESULT_NAME
#define DEFAULT_RESULT_NAME
Definition: vf_vidstabdetect.c:21
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_vidstabdetect.c:159
avfilter_vf_vidstabdetect_outputs
static const AVFilterPad avfilter_vf_vidstabdetect_outputs[]
Definition: vf_vidstabdetect.c:202
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
OFFSETC
#define OFFSETC(x)
Definition: vf_vidstabdetect.c:45
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_vidstabdetect.c:63
result
and forward the result(frame or status change) to the corresponding input. If nothing is possible
NULL
#define NULL
Definition: coverity.c:32
avfilter_vf_vidstabdetect_inputs
static const AVFilterPad avfilter_vf_vidstabdetect_inputs[]
Definition: vf_vidstabdetect.c:192
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_vidstabdetect.c:102
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_vidstabdetect.c:72
OFFSET
#define OFFSET(x)
Definition: vf_vidstabdetect.c:44
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_vidstabdetect.c:85
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
StabData
Definition: vf_vidstabdetect.c:33