FFmpeg
Loading...
Searching...
No Matches
vf_scdet.c File Reference

video scene change detection filter More...

#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"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  SCDetContext
 

Macros

#define OFFSET(x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 
#define F   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (scdet)
 
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 enum AVPixelFormat pix_fmts []
 
static const AVFilterPad scdet_inputs []
 
const FFFilter ff_vf_scdet
 

Detailed Description

video scene change detection filter

Definition in file vf_scdet.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
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 )

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 110 of file vf_scdet.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 137 of file vf_scdet.c.

◆ get_scene_score()

static double get_scene_score ( AVFilterContext * ctx,
AVFrame * frame )
static

Definition at line 144 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 175 of file vf_scdet.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 180 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, {.i64 = 0 }, 0, 1, V|F },
{ "s", "Set the flag to pass scene change frames", OFFSET(sc_pass), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, V|F },
{NULL}
}
#define V
Definition avdct.c:32
#define NULL
Definition coverity.c:32
#define F(x)
#define OFFSET(x)
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326

Definition at line 53 of file vf_scdet.c.

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

Definition at line 63 of file vf_scdet.c.

◆ scdet_inputs

const AVFilterPad scdet_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
}
static int config_input(AVFilterLink *inlink)
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 224 of file vf_scdet.c.

◆ ff_vf_scdet

const FFFilter ff_vf_scdet
Initial value:
= {
.p.name = "scdet",
.p.description = NULL_IF_CONFIG_SMALL("Detect video scene change"),
.p.priv_class = &scdet_class,
.priv_size = sizeof(SCDetContext),
.activate = activate,
}
#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)
static int activate(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 enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
static const AVFilterPad scdet_inputs[]
Definition vf_scdet.c:224
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

Definition at line 232 of file vf_scdet.c.