65 blackframe->
frame = 0;
74 av_log(ctx,
AV_LOG_ERROR,
"Too big value for bamount (max is 100) or bthresh (max is 255)\n");
89 for (i = 0; i < frame->
video->
h; i++) {
90 for (x = 0; x < inlink->
w; x++)
95 pblack = blackframe->
nblack * 100 / (inlink->
w * inlink->
h);
96 if (pblack >= blackframe->
bamount)
125 .
name =
"blackframe",
133 .
inputs = avfilter_vf_blackframe_inputs,
135 .
outputs = avfilter_vf_blackframe_outputs,
AVFilterBufferRefVideoProps * video
video buffer specific properties
int linesize[8]
number of bytes per line
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static const AVFilterPad outputs[]
int h
agreed upon image height
int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *frame)
Send a frame of data to the next filter.
static const AVFilterPad avfilter_vf_blackframe_inputs[]
const char * name
Pad name.
static double av_q2d(AVRational a)
Convert rational to double.
int64_t pts
presentation timestamp.
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
static av_cold int init(AVFilterContext *ctx, const char *args)
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,...)
unsigned int bamount
black amount
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
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame)
unsigned int frame
frame number
A reference to an AVFilterBuffer.
unsigned int nblack
number of black pixels counted so far
AVFilter avfilter_vf_blackframe
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static const AVFilterPad inputs[]
const char * name
filter name
AVFilterLink ** outputs
array of pointers to output links
static const AVFilterPad avfilter_vf_blackframe_outputs[]
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)
int64_t pos
byte position in stream, -1 if unknown
AVFilterContext * dst
dest filter
uint8_t * data[8]
picture/audio data for each plane
unsigned int bthresh
black threshold
AVFilterBufferRef * ff_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
AVPixelFormat
Pixel format.
static int query_formats(AVFilterContext *ctx)