Data Structures | Macros | Functions | Variables
vf_blackframe.c File Reference

Search for black frames to detect scene transitions. More...

#include <stdio.h>
#include <inttypes.h>
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  BlackFrameContext


#define SET_META(key, format, value)
#define OFFSET(x)   offsetof(BlackFrameContext, x)


static int query_formats (AVFilterContext *ctx)
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)


static const AVOption blackframe_options []
static const AVFilterPad avfilter_vf_blackframe_inputs []
static const AVFilterPad avfilter_vf_blackframe_outputs []
AVFilter ff_vf_blackframe

Detailed Description

Search for black frames to detect scene transitions.

Ported from MPlayer libmpcodecs/vf_blackframe.c.

Definition in file vf_blackframe.c.

Macro Definition Documentation

#define SET_META (   key,
snprintf(buf, sizeof(buf), format, value); \
av_dict_set(metadata, key, buf, 0)
const char * key
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate.The lists are not just lists
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:108
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:70
#define snprintf
Definition: snprintf.h:34

Definition at line 63 of file vf_blackframe.c.

Referenced by filter_frame().

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

Definition at line 104 of file vf_blackframe.c.

Definition at line 105 of file vf_blackframe.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)

Definition at line 49 of file vf_blackframe.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 

Definition at line 67 of file vf_blackframe.c.


Variable Documentation

const AVOption blackframe_options[]
Initial value:
= {
{ "amount", "percentage of the pixels that have to be below the threshold "
"for the frame to be considered black", OFFSET(bamount), AV_OPT_TYPE_INT, { .i64 = 98 }, 0, 100, FLAGS },
{ "threshold", "threshold below which a pixel value is considered black",
OFFSET(bthresh), AV_OPT_TYPE_INT, { .i64 = 32 }, 0, 255, FLAGS },
{ "thresh", "threshold below which a pixel value is considered black",
OFFSET(bthresh), AV_OPT_TYPE_INT, { .i64 = 32 }, 0, 255, FLAGS },
{ NULL }
#define NULL
Definition: coverity.c:32
#define FLAGS
#define OFFSET(x)

Definition at line 106 of file vf_blackframe.c.

const AVFilterPad avfilter_vf_blackframe_inputs[]
Initial value:
= {
.name = "default",
.filter_frame = filter_frame,
{ NULL }
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_blackframe.c:67

Definition at line 118 of file vf_blackframe.c.

const AVFilterPad avfilter_vf_blackframe_outputs[]
Initial value:
= {
.name = "default",
{ NULL }
#define NULL
Definition: coverity.c:32

Definition at line 127 of file vf_blackframe.c.

AVFilter ff_vf_blackframe
Initial value:
= {
.name = "blackframe",
.description = NULL_IF_CONFIG_SMALL("Detect frames that are (almost) black."),
.priv_size = sizeof(BlackFrameContext),
.priv_class = &blackframe_class,
static const AVFilterPad avfilter_vf_blackframe_inputs[]
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static const AVFilterPad avfilter_vf_blackframe_outputs[]
static int query_formats(AVFilterContext *ctx)
Definition: vf_blackframe.c:49

Definition at line 135 of file vf_blackframe.c.