Auto Crop

Detect and remove video letterbox, if any. Then crop/resize/fill to fit target size

<?xml version="1.0"?>
<query>
    <userid>[UserID]</userid> <!-- required-->
    <userkey>[UserKey]</userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <auto_crop>
            <enable>[yes|no]</enable>
            <crop_type>[CropType]</crop_type>
            <limit>[Detection]</limit>
            <round>[CropRound]</round>
        </auto_crop>
    </format>
</query>
{
    "query": {
        "userid": "[UserID]",
        "userkey": "[UserKey]",
        "action": "[Action]",
        "format": {
            "auto_crop": {
                "enable": "[yes|no]",
                "crop_type": "[CropType]",
                "limit": "[Detection]",
                "round": "[CropRound]"
            }
        }
    }
}
ParameterDescriptionAllowed ValuesDefault Value
enableEnable auto-cropping.yes, nono
crop_typeSpecify cropping type.resize - crop letterbox, then crop to keep width/height ratio then re-scaling to fit output size.
stretch - crop letterbox, then re-scaling without saving of width/heigth ratio to fit output size
crop - only letterbox cropping
center - after letterbox cropping the source image is centered in the target image without scaling. A lesser dimension is filled, a greater dimension is cropped
center_resize - after letterbox cropping the source image is centered and resized so that it fills the entire tagget space without filling. Then excess pixels are cropped
resize
limitHigher black value threshold.Positive integer number from 0 to 128. Value greater than 128 will be changed to 128.

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

128 – The lightest pixels would be classified as black.
24
roundThe value which the width/height should be divisible by.Positive integer number.16

🚧

Note for crop_type

If <crop_type /> set to crop and specified for output then video will be re-scaled as though <crop_type /> was set to stretch.

❗️

Note

Auto cropping will be ignored if <crop_* /> parameters are specified.