Filter out black/empty frames

Rūdolfs Bundulis rudolfs.bundulis at gmail.com
Wed Oct 26 13:07:59 UTC 2022


Hi,

I think there is nothing that covers all the cases you need. There is
template match (https://gstreamer.freedesktop.org/documentation/opencv/templatematch.html?gi-language=c)
which takes a template frame, but that will work if you have a fixed
"black" tone not for example a range of rgb values that are considered
black and it does not seem to work with alpha.

Libav has blackdetect
(https://ffmpeg.org/ffmpeg-filters.html#blackdetect) and blackframe
(https://ffmpeg.org/ffmpeg-filters.html#blackframe) but as far as I
can see the gst ffmpeg plugins package does not expose the filters
(maybe there is a fork or something else that allows it). These seem
better for black if you don't have a fixed value since they accept a
threshold.

Potentially, maybe the easiest way it to take template match and
adjust it so that it takes argb from png and accepts threshold
parameters? That would be easier than making a plugin from 0.

Best Regards,
Rudolfs Bundulis


More information about the gstreamer-devel mailing list