FFmpeg
Data Structures | Macros | Functions | Variables
vf_scdet.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "filters.h"
#include "scene_sad.h"

Go to the source code of this file.

Data Structures

struct  SCDetContext
 

Macros

#define OFFSET(x)   offsetof(SCDetContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (scdet)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static double get_scene_score (AVFilterContext *ctx, AVFrame *frame)
 
static int set_meta (SCDetContext *s, AVFrame *frame, const char *key, const char *value)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption scdet_options []
 
static const AVFilterPad scdet_inputs []
 
static const AVFilterPad scdet_outputs []
 
AVFilter ff_vf_scdet
 

Detailed Description

video scene change detection filter

Definition in file vf_scdet.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 49 of file vf_scdet.c.

◆ V

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 50 of file vf_scdet.c.

◆ F

Definition at line 51 of file vf_scdet.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( scdet  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 63 of file vf_scdet.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 84 of file vf_scdet.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 109 of file vf_scdet.c.

◆ get_scene_score()

static double get_scene_score ( AVFilterContext ctx,
AVFrame frame 
)
static

Definition at line 116 of file vf_scdet.c.

Referenced by activate().

◆ set_meta()

static int set_meta ( SCDetContext s,
AVFrame frame,
const char *  key,
const char *  value 
)
static

Definition at line 148 of file vf_scdet.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 153 of file vf_scdet.c.

Variable Documentation

◆ scdet_options

const AVOption scdet_options[]
static
Initial value:
= {
{ "threshold", "set scene change detect threshold", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl = 10.}, 0, 100., V|F },
{ "t", "set scene change detect threshold", OFFSET(threshold), AV_OPT_TYPE_DOUBLE, {.dbl = 10.}, 0, 100., V|F },
{ "sc_pass", "Set the flag to pass scene change frames", OFFSET(sc_pass), AV_OPT_TYPE_BOOL, {.dbl = 0 }, 0, 1, V|F },
{ "s", "Set the flag to pass scene change frames", OFFSET(sc_pass), AV_OPT_TYPE_BOOL, {.dbl = 0 }, 0, 1, V|F },
{NULL}
}

Definition at line 53 of file vf_scdet.c.

◆ scdet_inputs

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

Definition at line 197 of file vf_scdet.c.

◆ scdet_outputs

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

Definition at line 206 of file vf_scdet.c.

◆ ff_vf_scdet

AVFilter ff_vf_scdet
Initial value:
= {
.name = "scdet",
.description = NULL_IF_CONFIG_SMALL("Detect video scene change"),
.priv_size = sizeof(SCDetContext),
.priv_class = &scdet_class,
}

Definition at line 214 of file vf_scdet.c.

V
#define V
Definition: vf_scdet.c:50
F
#define F
Definition: vf_scdet.c:51
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_scdet.c:63
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_scdet.c:84
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
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
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scdet.c:109
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
scdet_outputs
static const AVFilterPad scdet_outputs[]
Definition: vf_scdet.c:206
OFFSET
#define OFFSET(x)
Definition: vf_scdet.c:49
activate
static int activate(AVFilterContext *ctx)
Definition: vf_scdet.c:153
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:242
scdet_inputs
static const AVFilterPad scdet_inputs[]
Definition: vf_scdet.c:197
SCDetContext
Definition: vf_scdet.c:34