Crop a video by fractions and the out-of-bounds error

The video filter crop op takes fractions of the frame, not pixels. Rules, the 0.05 minimum, the out-of-bounds error, and a centered 9:16 crop of a 16:9 clip.

4 min readSume
All posts

The crop operation of Sume's video filter takes a rectangle as fractions of the source frame, not pixels: x, y, width and height, each between 0 and 1. If the rectangle leaves the frame, or a side is under 0.05, the request is refused with video_filter_crop_out_of_bounds.

The rules are from the Video filter docs, read 2026-09-29; the 9:16 numbers are arithmetic on a 16:9 source.

What are the crop rules?

The compiler rounds the result to even pixel sizes for yuv420p, so the output can be a pixel off the exact fraction.

Crop field limits, from the Video filter docs, read 2026-09-29.
FieldRange
x, y0 to 1
width, height0.05 to 1
x + widthAt most 1
y + heightAt most 1

How do I crop the center 9:16 out of a 16:9 clip?

Keep the full height, so height is 1 and y is 0. A 9:16 window is 9/16 of the height wide; against a 16:9 frame that is (9/16) / (16/9), about 0.3164 of the width. Center it with x = (1 - 0.3164) / 2, about 0.3418.

This cuts away the sides, so anything there is lost; it is a crop, not a reframe that keeps the whole picture.

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

What if I need something the crop op cannot do?

Other pixel work goes in filtergraph, a filters-only ffmpeg graph applied after ops[]. It is limited to 2048 characters and 32 named filters, and only allowlisted filters work; drawtext, subtitles, movie and lut3d are not on the list. Run the free /v1/video-filter/check first to see a program's diagnostics.

Are there other limits?

The source can be up to 300 seconds, at most 8 ops run per request, and an encode is listed at $0.02 per job (confirm in GET /v1/catalog).

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume