Black Frame Detection

Detect video intervals that are (almost) completely black. Can be useful to detect chapter transitions, commercials, or invalid recordings. Output lines contains the time for the start, end and duration of the detected black interval expressed in seconds.

🚧

Note

This feature doesn’t work with subtitles.

🚧

Note

Maximum number of “black” segments to clip out is limited to 150.

<?xml version="1.0"?>
<query>
    <userid><<id>></userid> <!-- required-->
    <userkey><<key>></userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <source>[SourceFile]</source> <!-- required-->
    <format>
        <output>[output]</output> <!-- required -->
        <cut_black>
            <enable>[yes|no]</enable>
            <black_min_duration>[Duration]</black_min_duration>
            <pixel_black>[PixelThreshold]</pixel_black>
            <picture_black_ratio>[PictureThreshold]</picture_black_ratio>
            <trim>[yes|no]</trim>
        </cut_black>
        <!-- format parameters -->
    </format>
</query>
{
    "query": {
        "userid": "<<id>>", // required
        "userkey": "<<key>>", // required
        "action": "[Action]", // required
        "source": "[SourceFile]", // required
        "format": {
            "output": "[output]", // required
            "cut_black": {
                "enable": "[yes|no]",
                "black_min_duration": "[Duration]",
                "pixel_black": "[PixelThreshold]",
                "picture_black_ratio": "[PictureThreshold]",
                "trim": "[yes|no]"
            }
            // format parameters
        }
    }
}

Parameter

Description

Allowed Values

Default Value

enable

Enable black frame detection and clipping.

yes, no

no

black_min_duration

Specify the shortest black frame duration in seconds.

Positive float number

2.0

pixel_black

Threshold for classification pixels as black.

Positive float number less than 1.

0 – Pixel must be absolutely black to be classified as black.

0.99 – The lightest pixels would be classified as black.

0.00

picture_black_ratio

Threshold for classification frame as black.

Positive float number less or equals to 1.

1 – Frame must have only “black” pixels to be classified as “black” frame.

0 – Frame can have no black pixels to be classified as “black” frame.

1

trim

Trim black frames only from start and end of the video

yes, no

no