Skip to content

Blackdetect

Video Single output Transform

Detect video intervals that are (almost) black.

FFmpeg filter: blackdetect — the official reference.

Add it to a graph. The explicit form works for every filter — bind it to its input and read the result from outputs():

$node = $video->addFilter(new Blackdetect());
$result = $node->outputs()[0];

Shorthand. Single-output filters can skip the node — apply() returns the result stream directly:

$result = $video->apply(new Blackdetect());

TODO — when this filter shines: what it’s the right tool for, what to reach for instead when it isn’t, and how it composes with neighbouring filters.

TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).

TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.

TODO

TODO

ParameterTypeDefaultRange / valuesDescription
black_min_durationfloat20set minimum detected black duration in seconds
picture_black_ratio_thfloat0.9801set the picture black ratio threshold
pixel_black_thfloat0.101set the pixel black threshold

FFmpeg also names these options (use the parameter shown above): dblack_min_duration, pic_thpicture_black_ratio_th, pix_thpixel_black_th.


Maps to FFmpeg’s blackdetect filter. Verified against ffmpeg n7.1.1.

An Artisan Build project.

Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project. Support FFmpeg.