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 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 []
 
const 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.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 85 of file vf_vidstabdetect.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 142 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,
},
}

Definition at line 175 of file vf_vidstabdetect.c.

◆ avfilter_vf_vidstabdetect_outputs

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

Definition at line 184 of file vf_vidstabdetect.c.

◆ ff_vf_vidstabdetect

const 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 191 of file vf_vidstabdetect.c.

FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:170
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:142
avfilter_vf_vidstabdetect_outputs
static const AVFilterPad avfilter_vf_vidstabdetect_outputs[]
Definition: vf_vidstabdetect.c:184
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
ff_vidstab_pix_fmts
enum AVPixelFormat ff_vidstab_pix_fmts[]
Definition: vidstabutils.c:23
OFFSETC
#define OFFSETC(x)
Definition: vf_vidstabdetect.c:45
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_vidstabdetect.c:63
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
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:175
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:85
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_vidstabdetect.c:72
OFFSET
#define OFFSET(x)
Definition: vf_vidstabdetect.c:44
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:143
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
StabData
Definition: vf_vidstabdetect.c:33