FFmpeg
Loading...
Searching...
No Matches
vf_vidstabdetect.c File Reference
#include <vid.stab/libvidstab.h>
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "video.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)
 
#define OFFSETC(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 []
 
const FFFilter 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)
Value:
offsetof(StabData, x)

Definition at line 47 of file vf_vidstabdetect.c.

◆ OFFSETC

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

Definition at line 48 of file vf_vidstabdetect.c.

◆ FLAGS

Definition at line 49 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 71 of file vf_vidstabdetect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 80 of file vf_vidstabdetect.c.

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 93 of file vf_vidstabdetect.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 157 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}
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
#define DEFAULT_RESULT_NAME
#define OFFSETC(x)

Definition at line 51 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,
},
}
static int config_input(AVFilterLink *inlink)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 195 of file vf_vidstabdetect.c.

◆ ff_vf_vidstabdetect

const FFFilter ff_vf_vidstabdetect
Initial value:
= {
.p.name = "vidstabdetect",
.p.description = NULL_IF_CONFIG_SMALL("Extract relative transformations, "
"pass 1 of 2 for stabilization "
"(see vidstabtransform for pass 2)."),
.p.priv_class = &vidstabdetect_class,
.priv_size = sizeof(StabData),
.init = init,
}
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition avfilter.h:182
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static const AVFilterPad avfilter_vf_vidstabdetect_inputs[]
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37
enum AVPixelFormat ff_vidstab_pix_fmts[]

Definition at line 204 of file vf_vidstabdetect.c.