58 blackframe->
frame = 0;
67 av_log(ctx,
AV_LOG_ERROR,
"Too big value for bamount (max is 100) or bthresh (max is 255)\n");
82 for (i = 0; i < h; i++) {
83 for (x = 0; x < inlink->
w; x++)
98 pblack = blackframe->
nblack * 100 / (inlink->
w * inlink->
h);
99 if (pblack >= blackframe->
bamount)
100 av_log(ctx,
AV_LOG_INFO,
"frame:%u pblack:%u pos:%"PRId64
" pts:%"PRId64
" t:%f\n",
101 blackframe->
frame, pblack, picref->
pos, picref->
pts,
110 .
name =
"blackframe",
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
int linesize[8]
number of bytes per line
int h
agreed upon image height
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
static double av_q2d(AVRational a)
Convert rational to double.
static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
int64_t pts
presentation timestamp.
A filter pad used for either input or output.
A link between two filters.
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
#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
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,...)
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
unsigned int bamount
black amount
int w
agreed upon image width
unsigned int frame
frame number
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
as above, but U and V bytes are swapped
A reference to an AVFilterBuffer.
unsigned int nblack
number of black pixels counted so far
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVFilter avfilter_vf_blackframe
void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
start_frame() handler for filters which simply pass video along
const char * name
filter name
AVFilterBufferRef * avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
get_video_buffer() handler for filters which simply pass video along
AVFilterLink ** outputs
array of pointers to output links
int64_t pos
byte position in stream, -1 if unknown
AVFilterContext * dst
dest filter
uint8_t * data[8]
picture/audio data for each plane
static void end_frame(AVFilterLink *inlink)
AVFilterBufferRef * cur_buf
unsigned int bthresh
black threshold
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int query_formats(AVFilterContext *ctx)