FFmpeg  4.4.8
vf_blackdetect.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Stefano Sabatini
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file
23  * Video black detector, loosely based on blackframe with extended
24  * syntax and features
25  */
26 
27 #include <float.h>
28 #include "libavutil/opt.h"
29 #include "libavutil/pixdesc.h"
30 #include "libavutil/timestamp.h"
31 #include "avfilter.h"
32 #include "filters.h"
33 #include "internal.h"
34 
35 typedef struct BlackDetectContext {
36  const AVClass *class;
37  double black_min_duration_time; ///< minimum duration of detected black, in seconds
38  int64_t black_min_duration; ///< minimum duration of detected black, expressed in timebase units
39  int64_t black_start; ///< pts start time of the first black picture
40  int64_t black_end; ///< pts end time of the last black picture
41  int64_t last_picref_pts; ///< pts of the last input picture
43 
46  unsigned int pixel_black_th_i;
47 
48  unsigned int nb_black_pixels; ///< number of black pixels counted so far
50  int depth;
52  unsigned int *counter;
54 
55 #define OFFSET(x) offsetof(BlackDetectContext, x)
56 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
57 
58 static const AVOption blackdetect_options[] = {
59  { "d", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX, FLAGS },
60  { "black_min_duration", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX, FLAGS },
61  { "picture_black_ratio_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1, FLAGS },
62  { "pic_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1, FLAGS },
63  { "pixel_black_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1, FLAGS },
64  { "pix_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1, FLAGS },
65  { NULL }
66 };
67 
68 AVFILTER_DEFINE_CLASS(blackdetect);
69 
70 #define YUVJ_FORMATS \
71  AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
72 
73 static const enum AVPixelFormat yuvj_formats[] = {
75 };
76 
78 {
79  static const enum AVPixelFormat pix_fmts[] = {
100  };
101 
103  if (!fmts_list)
104  return AVERROR(ENOMEM);
105  return ff_set_common_formats(ctx, fmts_list);
106 }
107 
108 static int config_input(AVFilterLink *inlink)
109 {
110  AVFilterContext *ctx = inlink->dst;
111  BlackDetectContext *s = ctx->priv;
113  const int depth = desc->comp[0].depth;
114  const int max = (1 << depth) - 1;
115  const int factor = (1 << (depth - 8));
116 
117  s->depth = depth;
118  s->nb_threads = ff_filter_get_nb_threads(ctx);
119  s->time_base = inlink->time_base;
120  s->black_min_duration = s->black_min_duration_time / av_q2d(s->time_base);
121  s->counter = av_calloc(s->nb_threads, sizeof(*s->counter));
122  if (!s->counter)
123  return AVERROR(ENOMEM);
124 
125  s->pixel_black_th_i = ff_fmt_is_in(inlink->format, yuvj_formats) ?
126  // luminance_minimum_value + pixel_black_th * luminance_range_size
127  s->pixel_black_th * max :
128  16 * factor + s->pixel_black_th * (235 - 16) * factor;
129 
131  "black_min_duration:%s pixel_black_th:%f pixel_black_th_i:%d picture_black_ratio_th:%f\n",
132  av_ts2timestr(s->black_min_duration, &s->time_base),
133  s->pixel_black_th, s->pixel_black_th_i,
134  s->picture_black_ratio_th);
135  return 0;
136 }
137 
139 {
140  BlackDetectContext *s = ctx->priv;
141 
142  if ((s->black_end - s->black_start) >= s->black_min_duration) {
144  "black_start:%s black_end:%s black_duration:%s\n",
145  av_ts2timestr(s->black_start, &s->time_base),
146  av_ts2timestr(s->black_end, &s->time_base),
147  av_ts2timestr(s->black_end - s->black_start, &s->time_base));
148  }
149 }
150 
152  int jobnr, int nb_jobs)
153 {
154  BlackDetectContext *s = ctx->priv;
155  const unsigned int threshold = s->pixel_black_th_i;
156  unsigned int *counterp = &s->counter[jobnr];
157  AVFrame *in = arg;
158  const int linesize = in->linesize[0];
159  const int w = in->width;
160  const int h = in->height;
161  const int start = ff_slice_pos(h, jobnr, nb_jobs);
162  const int end = ff_slice_pos(h, jobnr + 1, nb_jobs);
163  const int size = end - start;
164  unsigned int counter = 0;
165 
166  if (s->depth == 8) {
167  const uint8_t *p = in->data[0] + start * linesize;
168 
169  for (int i = 0; i < size; i++) {
170  for (int x = 0; x < w; x++)
171  counter += p[x] <= threshold;
172  p += linesize;
173  }
174  } else {
175  const uint16_t *p = (const uint16_t *)(in->data[0] + start * linesize);
176 
177  for (int i = 0; i < size; i++) {
178  for (int x = 0; x < w; x++)
179  counter += p[x] <= threshold;
180  p += linesize / 2;
181  }
182  }
183 
184  *counterp = counter;
185 
186  return 0;
187 }
188 
189 static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
190 {
191  AVFilterContext *ctx = inlink->dst;
192  BlackDetectContext *s = ctx->priv;
193  double picture_black_ratio = 0;
194 
195  ctx->internal->execute(ctx, black_counter, picref, NULL,
196  FFMIN(inlink->h, s->nb_threads));
197 
198  for (int i = 0; i < s->nb_threads; i++)
199  s->nb_black_pixels += s->counter[i];
200 
201  picture_black_ratio = (double)s->nb_black_pixels / (inlink->w * inlink->h);
202 
204  "frame:%"PRId64" picture_black_ratio:%f pts:%s t:%s type:%c\n",
205  inlink->frame_count_out, picture_black_ratio,
206  av_ts2str(picref->pts), av_ts2timestr(picref->pts, &s->time_base),
208 
209  if (picture_black_ratio >= s->picture_black_ratio_th) {
210  if (!s->black_started) {
211  /* black starts here */
212  s->black_started = 1;
213  s->black_start = picref->pts;
214  av_dict_set(&picref->metadata, "lavfi.black_start",
215  av_ts2timestr(s->black_start, &s->time_base), 0);
216  }
217  } else if (s->black_started) {
218  /* black ends here */
219  s->black_started = 0;
220  s->black_end = picref->pts;
222  av_dict_set(&picref->metadata, "lavfi.black_end",
223  av_ts2timestr(s->black_end, &s->time_base), 0);
224  }
225 
226  s->last_picref_pts = picref->pts;
227  s->nb_black_pixels = 0;
228  return ff_filter_frame(inlink->dst->outputs[0], picref);
229 }
230 
232 {
233  BlackDetectContext *s = ctx->priv;
234 
235  av_freep(&s->counter);
236 
237  if (s->black_started) {
238  // FIXME: black_end should be set to last_picref_pts + last_picref_duration
239  s->black_end = s->last_picref_pts;
241  }
242 }
243 
244 static const AVFilterPad blackdetect_inputs[] = {
245  {
246  .name = "default",
247  .type = AVMEDIA_TYPE_VIDEO,
248  .config_props = config_input,
249  .filter_frame = filter_frame,
250  },
251  { NULL }
252 };
253 
255  {
256  .name = "default",
257  .type = AVMEDIA_TYPE_VIDEO,
258  },
259  { NULL }
260 };
261 
263  .name = "blackdetect",
264  .description = NULL_IF_CONFIG_SMALL("Detect video intervals that are (almost) black."),
265  .priv_size = sizeof(BlackDetectContext),
269  .uninit = uninit,
270  .priv_class = &blackdetect_class,
272 };
static const AVFilterPad inputs[]
Definition: af_acontrast.c:193
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
#define av_cold
Definition: attributes.h:88
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
uint8_t
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1096
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Definition: avfilter.c:802
Main libavfilter public API header.
#define flags(name, subs,...)
Definition: cbs_av1.c:572
#define s(width, name)
Definition: cbs_vp9.c:257
#define FFMIN(a, b)
Definition: common.h:105
#define NULL
Definition: coverity.c:32
long long int64_t
Definition: coverity.c:34
#define max(a, b)
Definition: cuda_runtime.h:33
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
Definition: filters.h:271
int ff_fmt_is_in(int fmt, const int *fmts)
Tell if an integer is contained in the provided -1-terminated list of integers.
Definition: formats.c:257
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:587
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:286
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:227
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition: dict.c:70
#define AVERROR(e)
Definition: error.h:43
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:215
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:210
#define AV_LOG_INFO
Standard information.
Definition: log.h:205
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
Definition: mem.c:245
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
Definition: utils.c:83
int i
Definition: input.c:407
const char * arg
Definition: jacosubdec.c:66
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:309
const char * desc
Definition: libsvtav1.c:79
uint8_t w
Definition: llviddspenc.c:39
AVOptions.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2573
#define AV_PIX_FMT_YUV420P16
Definition: pixfmt.h:410
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:406
#define AV_PIX_FMT_YUV444P9
Definition: pixfmt.h:398
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:399
#define AV_PIX_FMT_YUV440P12
Definition: pixfmt.h:405
#define AV_PIX_FMT_YUV422P9
Definition: pixfmt.h:397
#define AV_PIX_FMT_YUVA444P10
Definition: pixfmt.h:438
#define AV_PIX_FMT_YUVA420P16
Definition: pixfmt.h:441
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:403
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:436
#define AV_PIX_FMT_YUVA422P9
Definition: pixfmt.h:434
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:404
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:400
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:381
#define AV_PIX_FMT_YUV420P9
Definition: pixfmt.h:396
#define AV_PIX_FMT_YUVA420P9
Definition: pixfmt.h:433
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:437
#define AV_PIX_FMT_YUV420P14
Definition: pixfmt.h:407
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
@ 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...
Definition: pixfmt.h:89
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition: pixfmt.h:99
@ AV_PIX_FMT_NV21
as above, but U and V bytes are swapped
Definition: pixfmt.h:90
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition: pixfmt.h:73
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:177
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:176
#define AV_PIX_FMT_YUVA422P12
Definition: pixfmt.h:439
#define AV_PIX_FMT_YUV422P14
Definition: pixfmt.h:408
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:380
#define AV_PIX_FMT_GRAY14
Definition: pixfmt.h:382
#define AV_PIX_FMT_YUV422P16
Definition: pixfmt.h:411
#define AV_PIX_FMT_YUV440P10
Definition: pixfmt.h:401
#define AV_PIX_FMT_GRAY16
Definition: pixfmt.h:383
#define AV_PIX_FMT_YUVA444P16
Definition: pixfmt.h:443
#define AV_PIX_FMT_YUVA422P16
Definition: pixfmt.h:442
#define AV_PIX_FMT_YUV444P14
Definition: pixfmt.h:409
#define AV_PIX_FMT_YUVA444P9
Definition: pixfmt.h:435
#define AV_PIX_FMT_YUVA444P12
Definition: pixfmt.h:440
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:412
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:402
Describe the class of an AVClass context structure.
Definition: log.h:67
An instance of a filter.
Definition: avfilter.h:341
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:353
A list of supported formats for one end of a filter link.
Definition: formats.h:65
A filter pad used for either input or output.
Definition: internal.h:54
const char * name
Pad name.
Definition: internal.h:60
Filter definition.
Definition: avfilter.h:145
const char * name
Filter name.
Definition: avfilter.h:149
AVFormatInternal * internal
An opaque field for libavformat internal usage.
Definition: avformat.h:1699
This structure describes decoded (raw) audio or video data.
Definition: frame.h:318
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:411
AVDictionary * metadata
metadata.
Definition: frame.h:604
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:401
AVOption.
Definition: opt.h:248
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
Rational number (pair of numerator and denominator).
Definition: rational.h:58
unsigned int * counter
AVRational time_base
int64_t black_end
pts end time of the last black picture
int64_t black_min_duration
minimum duration of detected black, expressed in timebase units
int64_t last_picref_pts
pts of the last input picture
int64_t black_start
pts start time of the first black picture
double black_min_duration_time
minimum duration of detected black, in seconds
unsigned int pixel_black_th_i
unsigned int nb_black_pixels
number of black pixels counted so far
double picture_black_ratio_th
#define av_freep(p)
#define av_log(a,...)
AVFormatContext * ctx
Definition: movenc.c:48
timestamp utils, mostly useful for debugging/logging purposes
#define av_ts2str(ts)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: timestamp.h:54
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: timestamp.h:76
int size
static const AVFilterPad blackdetect_outputs[]
static void check_black_end(AVFilterContext *ctx)
static int black_counter(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int query_formats(AVFilterContext *ctx)
static int config_input(AVFilterLink *inlink)
#define YUVJ_FORMATS
#define FLAGS
static enum AVPixelFormat yuvj_formats[]
static const AVOption blackdetect_options[]
static av_cold void uninit(AVFilterContext *ctx)
#define OFFSET(x)
AVFILTER_DEFINE_CLASS(blackdetect)
static const AVFilterPad blackdetect_inputs[]
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
AVFilter ff_vf_blackdetect
static const int factor[16]
Definition: vf_pp7.c:77