49 #define OFFSET(x) offsetof(BlackDetectContext, x)
50 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
54 {
"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 },
55 {
"picture_black_ratio_th",
"set the picture black ratio threshold",
OFFSET(picture_black_ratio_th),
AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1,
FLAGS },
64 #define YUVJ_FORMATS \
65 AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
101 "black_min_duration:%s pixel_black_th:%f pixel_black_th_i:%d picture_black_ratio_th:%f\n",
115 "black_start:%s black_end:%s black_duration:%s\n",
141 double picture_black_ratio = 0;
145 for (i = 0; i < inlink->
h; i++) {
146 for (x = 0; x < inlink->
w; x++)
151 picture_black_ratio = (double)blackdetect->
nb_black_pixels / (inlink->
w * inlink->
h);
154 "frame:%"PRId64
" picture_black_ratio:%f pts:%s t:%s type:%c\n",
197 .
name =
"blackdetect",
201 .
inputs = blackdetect_inputs,
202 .
outputs = blackdetect_outputs,
203 .priv_class = &blackdetect_class,