FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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

#define DEFAULT_RESULT_NAME   "transforms.trf"

Definition at line 21 of file vf_vidstabdetect.c.

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

Definition at line 44 of file vf_vidstabdetect.c.

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

Definition at line 45 of file vf_vidstabdetect.c.

Definition at line 46 of file vf_vidstabdetect.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( vidstabdetect  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 63 of file vf_vidstabdetect.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 72 of file vf_vidstabdetect.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 85 of file vf_vidstabdetect.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 100 of file vf_vidstabdetect.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 155 of file vf_vidstabdetect.c.

Variable Documentation

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.

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

Definition at line 187 of file vf_vidstabdetect.c.

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

Definition at line 197 of file vf_vidstabdetect.c.

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