Go to the documentation of this file.
54 #define SET_META(key, format, value) \
55 snprintf(buf, sizeof(buf), format, value); \
56 av_dict_set(metadata, key, buf, 0)
69 for (x = 0; x <
inlink->w; x++)
70 s->nblack += p[x] <
s->bthresh;
75 s->last_keyframe =
s->frame;
78 if (pblack >=
s->bamount) {
82 "type:%c last_keyframe:%d\n",
87 SET_META(
"lavfi.blackframe.pblack",
"%u", pblack);
95 #define OFFSET(x) offsetof(BlackFrameContext, x)
96 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
98 {
"amount",
"percentage of the pixels that have to be below the threshold "
100 {
"threshold",
"threshold below which a pixel value is considered black",
102 {
"thresh",
"threshold below which a pixel value is considered black",
118 .
name =
"blackframe",
121 .priv_class = &blackframe_class,
AVPixelFormat
Pixel format.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
#define FILTER_PIXFMTS_ARRAY(array)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
const char * name
Filter name.
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
A link between two filters.
unsigned int nblack
number of black pixels counted so far
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static enum AVPixelFormat pix_fmts[]
A filter pad used for either input or output.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define FILTER_INPUTS(array)
Describe the class of an AVClass context structure.
#define SET_META(key, format, value)
static const AVFilterPad avfilter_vf_blackframe_inputs[]
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
int bthresh
black threshold
enum AVPictureType pict_type
Picture type of the frame.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define AV_LOG_INFO
Standard information.
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
#define i(width, name, range_min, range_max)
static const AVOption blackframe_options[]
unsigned int frame
frame number
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
const char * name
Pad name.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVDictionary * metadata
metadata.
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
const AVFilter ff_vf_blackframe
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define flags(name, subs,...)
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
unsigned int last_keyframe
frame number of the last received key-frame
AVFILTER_DEFINE_CLASS(blackframe)