FFmpeg
Data Structures | Macros | Functions | Variables
vf_scdet.c File Reference
#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 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 []
 
static const AVFilterPad scdet_outputs []
 
const 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 48 of file vf_scdet.c.

◆ V

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 49 of file vf_scdet.c.

◆ F

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

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 100 of file vf_scdet.c.

◆ get_scene_score()

static double get_scene_score ( AVFilterContext ctx,
AVFrame frame 
)
static

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

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

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

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ scdet_inputs

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

Definition at line 188 of file vf_scdet.c.

◆ scdet_outputs

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

Definition at line 196 of file vf_scdet.c.

◆ ff_vf_scdet

const 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,
.activate = activate,
}

Definition at line 203 of file vf_scdet.c.

V
#define V
Definition: vf_scdet.c:49
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:174
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_scdet.c:62
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:459
F
#define F
Definition: vf_scdet.c:50
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
AV_PIX_FMT_YUV440P
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_scdet.c:75
AV_PIX_FMT_YUV422P9
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:457
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:462
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
AV_PIX_FMT_YUV420P9
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:456
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:460
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_scdet.c:100
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
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:115
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:464
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:466
AV_PIX_FMT_YUVJ440P
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition: pixfmt.h:100
AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:458
scdet_outputs
static const AVFilterPad scdet_outputs[]
Definition: vf_scdet.c:196
OFFSET
#define OFFSET(x)
Definition: vf_scdet.c:48
activate
static int activate(AVFilterContext *ctx)
Definition: vf_scdet.c:144
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:463
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
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:133
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
scdet_inputs
static const AVFilterPad scdet_inputs[]
Definition: vf_scdet.c:188
SCDetContext
Definition: vf_scdet.c:33