FFmpeg  4.4.6
Data Structures | Macros | Functions | Variables
vf_freezedetect.c File Reference

video freeze detection filter More...

#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  FreezeDetectContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (freezedetect)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int is_frozen (FreezeDetectContext *s, AVFrame *reference, AVFrame *frame)
 
static int set_meta (FreezeDetectContext *s, AVFrame *frame, const char *key, const char *value)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption freezedetect_options []
 
static const AVFilterPad freezedetect_inputs []
 
static const AVFilterPad freezedetect_outputs []
 
AVFilter ff_vf_freezedetect
 

Detailed Description

video freeze detection filter

Definition in file vf_freezedetect.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 50 of file vf_freezedetect.c.

◆ V

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 51 of file vf_freezedetect.c.

◆ F

Definition at line 52 of file vf_freezedetect.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( freezedetect  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 65 of file vf_freezedetect.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 100 of file vf_freezedetect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 121 of file vf_freezedetect.c.

◆ is_frozen()

static int is_frozen ( FreezeDetectContext s,
AVFrame reference,
AVFrame frame 
)
static

Definition at line 127 of file vf_freezedetect.c.

Referenced by activate().

◆ set_meta()

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

Definition at line 147 of file vf_freezedetect.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 153 of file vf_freezedetect.c.

Variable Documentation

◆ freezedetect_options

const AVOption freezedetect_options[]
static
Initial value:
= {
{ "n", "set noise tolerance", OFFSET(noise), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0, 1.0, V|F },
{ "noise", "set noise tolerance", OFFSET(noise), AV_OPT_TYPE_DOUBLE, {.dbl=0.001}, 0, 1.0, V|F },
{ "d", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=2000000}, 0, INT64_MAX, V|F },
{ "duration", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=2000000}, 0, INT64_MAX, V|F },
{NULL}
}
#define NULL
Definition: coverity.c:32
@ AV_OPT_TYPE_DURATION
Definition: opt.h:239
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
static int noise(AVBSFContext *ctx, AVPacket *pkt)
Definition: noise_bsf.c:36
int64_t duration
Definition: movenc.c:64
#define F
#define OFFSET(x)
#define V

Definition at line 54 of file vf_freezedetect.c.

◆ freezedetect_inputs

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

Definition at line 208 of file vf_freezedetect.c.

◆ freezedetect_outputs

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

Definition at line 217 of file vf_freezedetect.c.

◆ ff_vf_freezedetect

AVFilter ff_vf_freezedetect
Initial value:
= {
.name = "freezedetect",
.description = NULL_IF_CONFIG_SMALL("Detects frozen video input."),
.priv_size = sizeof(FreezeDetectContext),
.priv_class = &freezedetect_class,
}
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
static const AVFilterPad freezedetect_inputs[]
static int query_formats(AVFilterContext *ctx)
static const AVFilterPad freezedetect_outputs[]
static int activate(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)

Definition at line 225 of file vf_freezedetect.c.