19 November 2026

Fit, cover and center scaling modes

New scale_mode, allow_upscale and size_divisible_by video settings control how the picture fits into the output size. They are also available for thumbnail and thumbnail set outputs with width and height.

  • scale_mode: pad keeps the aspect ratio and pads the picture to the size, stretch scales it to the size (the same as keep_aspect_ratio yes and no), and the new fit keeps the aspect ratio without padding: the output size follows the source aspect ratio and fits within the size. With 1280x720, a 4:3 source gives 960x720 and a 2.39:1 source gives 1280x536. cover keeps the aspect ratio and fills the size, cropping the overflow evenly from both sides: a 16:9 source in 640x480 loses 1/8 of its width on each side. center doesn't scale the picture: it is centered in the size, cropped where it's larger and padded where it's smaller. Anamorphic sources get square pixels.
  • allow_upscale: no keeps sources smaller than the size at their own size.
  • size_divisible_by: the calculated width and height are rounded to a multiple of this value, 2 by default.

The size is calculated for the picture left after cropping, so auto_crop removes the letterbox first and the remaining picture is fitted. auto_crop crop_type can't be used together with the new parameters; cover and center replace the crop_type center_resize and center values used with auto cropping disabled by limit 0.

<?xml version="1.0"?>
<query>
    <userid>[UserID]</userid> <!-- required -->
    <userkey>[UserKey]</userkey> <!-- required -->
    <action>[Action]</action> <!-- required -->
    <source>[SourceFile]</source> <!-- required -->
    <format>
        <output>mp4</output> <!-- required -->
        <size>1280x720</size>
        <scale_mode>fit</scale_mode>
        <allow_upscale>no</allow_upscale>
        <!-- format parameters -->
    </format>
    <format>
        <output>thumbnail</output>
        <width>640</width>
        <height>360</height>
        <scale_mode>fit</scale_mode>
        <allow_upscale>no</allow_upscale>
    </format>
</query>
{
  "query": {
    "userid": "[UserID]", // required
    "userkey": "[UserKey]", // required
    "action": "[Action]", // required
    "source": "[SourceFile]", // required
    "format": [
      {
        "output": "mp4", // required
        "size": "1280x720",
        "scale_mode": "fit",
        "allow_upscale": "no"
        // format parameters
      },
      {
        "output": "thumbnail",
        "width": "640",
        "height": "360",
        "scale_mode": "fit",
        "allow_upscale": "no"
      }
    ]
  }
}

Flatten Alpha Channel

flatten_alpha optional format-level parameter flattens the source alpha channel onto black (premultiplies colors by alpha).

<?xml version="1.0"?>
<query>
    <userid>[UserID]</userid> <!-- required -->
    <userkey>[UserKey]</userkey> <!-- required -->
    <action>[Action]</action> <!-- required -->
    <source>[SourceFile]</source> <!-- required -->
    <format>
        <output>[OutputFormat]</output> <!-- required-->
        <flatten_alpha>[yes|no]</flatten_alpha>
    </format>
</query>
{
  "query": {
    "userid": "[UserID]", // required
    "userkey": "[UserKey]", // required
    "action": "[Action]", // required
    "source": "[SourceFile]", // required
    "format": {
      "output": "[OutputFormat]",
      "flatten_alpha": "[yes|no]"
    }
  }
}
ParameterDescriptionAllowed ValuesDefault Value
flatten_alphaFlatten the source alpha channel onto a black background (premultiply colors by alpha)yes, nono