Libav
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
 

Macros

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

Functions

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

Variables

static const AVOption options []
 
static const AVClass blackframe_class
 
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 OFFSET (   x)    offsetof(BlackFrameContext, x)

Definition at line 86 of file vf_blackframe.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 87 of file vf_blackframe.c.

Function Documentation

static int query_formats ( AVFilterContext ctx)
static

Definition at line 49 of file vf_blackframe.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 61 of file vf_blackframe.c.

Variable Documentation

const AVOption options[]
static
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, INT_MAX, FLAGS },
{ NULL },
}
#define FLAGS
Definition: vf_blackframe.c:87
#define OFFSET(x)
Definition: vf_blackframe.c:86
NULL
Definition: eval.c:55

Definition at line 88 of file vf_blackframe.c.

const AVClass blackframe_class
static
Initial value:
= {
.class_name = "blackframe",
.item_name = av_default_item_name,
.option = options,
}
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:52
static const AVOption options[]
Definition: vf_blackframe.c:88

Definition at line 96 of file vf_blackframe.c.

const AVFilterPad avfilter_vf_blackframe_inputs[]
static
Initial value:
= {
{
.name = "default",
.get_video_buffer = ff_null_get_video_buffer,
.filter_frame = filter_frame,
},
{ NULL }
}
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
Definition: video.c:30
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_blackframe.c:61

Definition at line 103 of file vf_blackframe.c.

const AVFilterPad avfilter_vf_blackframe_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 113 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 AVClass blackframe_class
Definition: vf_blackframe.c:96
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:232
static const AVFilterPad avfilter_vf_blackframe_inputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:150
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:221
static const AVFilterPad avfilter_vf_blackframe_outputs[]
static int query_formats(AVFilterContext *ctx)
Definition: vf_blackframe.c:49

Definition at line 121 of file vf_blackframe.c.