Crop 1920x1080 to 9:16 with an API: width 0.3164, x 0.3418

Center-crop a 16:9 clip to vertical with Sume video filter: the crop fractions, the arithmetic, and why 1280x720 falls under TikTok's 540x960 minimum.

4 min readSume
All posts

To center-crop a 1920 x 1080 clip to 9:16 with Sume, send a crop op with x: 0.3418, y: 0, width: 0.3164, height: 1. Crop values are fractions of the source frame, so the same four numbers work for any 16:9 source. The job costs $0.02 and the source can be up to 300 seconds.

The arithmetic

The crop op takes x and y in [0, 1] and width and height in [0.05, 1], with x + width <= 1 and y + height <= 1. The compiler rounds the rectangle to pixels.

A 9:16 window of full height has a width of 9/16 of the height. For a 16:9 frame (width = 16/9 of the height) the width fraction is (9/16) / (16/9) = 81/256 = 0.3164. To center it, x = (1 - 0.3164) / 2 = 0.3418. On a 1920 x 1080 source that is a rectangle of about 608 x 1080 pixels.

Center 9:16 crop from 16:9 sources (computed 2026-10-09)
Sourcewidth fractionx fractionPixels croppedMeets TikTok 540x960 minimum?
1920x10800.31640.3418about 608x1080Yes
1280x7200.31640.3418about 405x720No: width under 540
3840x21600.31640.3418about 1215x2160Yes

The platform minimum

TikTok's non-Spark ad specifications list vertical video at 9:16 with at least 540 x 960 pixels, horizontal at 960 x 540, and square at 640 x 640. File types are .mp4, .mov, .mpeg, .3gp, and .avi, with a length up to 10 minutes, a size of 500 MB or less, and a bitrate of at least 516 kbps (TikTok Ads help, read 2026-10-09).

A crop does not upscale. A 1280 x 720 source crops to about 405 x 720, which is under the 540 x 960 floor. Start from a 1080p or larger source, or conform the size with the trim step's exact-precision output option.

curl -X POST https://api.sume.com/v1/video-filter \
  -H "Authorization: Bearer $SUME_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: crop-916-001" \
  -d '{
    "video_url": "https://media.sume.com/artifacts/artf_demo/wide.mp4",
    "ops": [{ "op": "crop", "x": 0.3418, "y": 0,
              "width": 0.3164, "height": 1 }]
  }'

Other source sizes

The fractions depend only on the aspect ratio, not the pixel size, so they hold for every 16:9 source. For a 4:3 source the width fraction is (9/16) / (4/3) = 27/64 = 0.4219, with x = (1 - 0.4219) / 2 = 0.2891. For a square source it is 0.5625 and x is 0.2188. Always check that x + width is at most 1; here 0.2188 + 0.5625 = 0.7813.

After the crop, the output keeps the source frame rate and audio. If you also need a file under TikTok's 500 MB ad limit or a minimum bitrate of 516 kbps, check the result's size and bitrate against the TikTok page before you upload it; video filter does not report them.

Check first

Run the same body against POST /v1/video-filter/check, which is free, and read diagnostics[] before you encode. Out-of-bounds fractions fail with video_filter_crop_out_of_bounds, which also fires if a side is under 0.05. The output keeps the source frame rate and audio unless the program changes them.

If your subject is not centered, move x and keep width: the rule is only that x + width stays at or below 1.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume