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_durationfloat2≥ 0set minimum detected black duration in seconds
picture_black_ratio_thfloat0.980–1set the picture black ratio threshold
pixel_black_thfloat0.10–1set the pixel black threshold

FFmpeg also names these options (use the parameter shown above): d → black_min_duration, pic_th → picture_black_ratio_th, pix_th → pixel_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.