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,
130 .
inputs = avfilter_vf_blackframe_inputs,
132 .
outputs = avfilter_vf_blackframe_outputs,
This structure describes decoded (raw) audio or video data.
static const AVClass blackframe_class
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static const AVFilterPad outputs[]
Main libavfilter public API header.
int h
agreed upon image height
static const AVFilterPad avfilter_vf_blackframe_inputs[]
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
const char * name
Pad name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
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.
A filter pad used for either input or output.
A link between two filters.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
void av_log(void *avcl, int level, const char *fmt,...)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
common internal API header
as above, but U and V bytes are swapped
AVFilter ff_vf_blackframe
unsigned int frame
frame number
unsigned int nblack
number of black pixels counted so far
#define AV_LOG_INFO
Standard information.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
int bthresh
black threshold
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
static const AVFilterPad inputs[]
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static const AVFilterPad avfilter_vf_blackframe_outputs[]
static const AVOption options[]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
AVFilterContext * dst
dest filter
AVPixelFormat
Pixel format.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int query_formats(AVFilterContext *ctx)