34 #include "libavutil/opt.h"
69 for (i = 0; i < frame->
height; i++) {
70 for (x = 0; x < inlink->
w; x++)
75 pblack = s->
nblack * 100 / (inlink->
w * inlink->
h);
86 #define OFFSET(x) offsetof(BlackFrameContext, x)
87 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
89 {
"amount",
"Percentage of the pixels that have to be below the threshold "
91 {
"threshold",
"threshold below which a pixel value is considered black",
122 .
name =
"blackframe",
126 .priv_class = &blackframe_class,
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
This structure describes decoded (raw) audio or video data.
static const AVClass blackframe_class
const char * name
Filter name.
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
int h
agreed upon image height
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static const AVFilterPad avfilter_vf_blackframe_inputs[]
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static double av_q2d(AVRational a)
Convert rational to double.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
A link between two filters.
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
AVPixelFormat
Pixel format.
int w
agreed upon image width
common internal API header
AVFilter ff_vf_blackframe
unsigned int frame
frame number
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Main libavfilter public API header.
AVFilterLink ** outputs
array of pointers to output links
unsigned int nblack
number of black pixels counted so far
#define AV_LOG_INFO
Standard information.
int bthresh
black threshold
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVFilterContext * dst
dest filter
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
static const AVFilterPad avfilter_vf_blackframe_outputs[]
static const AVOption options[]
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
struct AVFilterPad AVFilterPad
av_default_item_name
Return the context name.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define AV_NOPTS_VALUE
Undefined timestamp value.
as above, but U and V bytes are swapped
static int query_formats(AVFilterContext *ctx)