Crop an avatar video to 1:1: video-filter fractions for every ratio
Exact x, y, width and height fractions that turn a 9:16, 3:4, 4:3 or 16:9 Sume avatar clip into a centered square with video-filter, $0.02 a job.
To crop a Sume avatar video to a centered square, send Video filter a crop op with fractions of the frame: for a 9:16 clip that is x 0, y 0.21875, width 1 and height 0.5625. Other ratios use the same rule, and the table below gives all four. The job costs $0.02 and returns a new MP4; the source is not changed.
You may want this when you rendered the default 9:16 but a placement wants 1:1. You can also render a 1:1 avatar video directly, since 1:1 is one of the five supported ratios. Cropping is the cheaper fix when a clip already exists.
The fractions
Video filter takes a crop rectangle as fractions of the source frame, not pixels. x and y are in 0 to 1, width and height are in 0.05 to 1, and x + width and y + height must not pass 1. The compiler rounds to even values for yuv420p. Because the numbers are fractions, they work for any resolution; no pixel dimensions are assumed here.
| Source ratio | Crop op | Why |
|---|---|---|
| 9:16 (default) | x 0, y 0.21875, width 1, height 0.5625 | 9/16 = 0.5625 of the height; (1 - 0.5625) / 2 = 0.21875 |
| 3:4 | x 0, y 0.125, width 1, height 0.75 | 3/4 = 0.75 of the height; (1 - 0.75) / 2 = 0.125 |
| 4:3 | x 0.125, y 0, width 0.75, height 1 | 3/4 = 0.75 of the width; (1 - 0.75) / 2 = 0.125 |
| 16:9 | x 0.21875, y 0, width 0.5625, height 1 | 9/16 = 0.5625 of the width; (1 - 0.5625) / 2 = 0.21875 |
| 1:1 | nothing to crop | already square |
The request
The video must already be a media.sume.com artifact or asset of your workspace; the API does not fetch open-internet URLs, so import first. An Idempotency-Key is required. Use the free /v1/video-filter/check call first: it validates the program and returns diagnostics without creating a job.
curl -X POST https://api.sume.com/v1/video-filter \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: square-crop-001" \
-d '{
"video_url": "https://media.sume.com/artifacts/artf_demo/avatar.mp4",
"ops": [{"op": "crop", "x": 0, "y": 0.21875, "width": 1, "height": 0.5625}]
}'Check the framing before you crop
A center crop assumes the subject is in the middle of the frame. Look at one still from the clip first. If the face sits high in a 9:16 frame, lower y toward 0 so the window moves up, and keep y + height at or under 1. For example y 0.1 with height 0.5625 ends at 0.6625, which is valid.
Captions burned into the avatar job are part of the pixels, so crop before you add captions with the separate video-captions job, or check that inline captions survive. Video filter takes sources up to 300 seconds, well past the 60-second avatar maximum.
Sources
Related posts
More in Media tools
- Dim an avatar clip to 0.45 for overlay text: run the free check first
Darken a Sume avatar video with video-filter dim 0.45, run the unbilled /check call first, then pay $0.02 for the encode. What dim does and what it refuses.
- Does the Kling motion control prompt change the movement? No
On Sume's Kling 3.0 Motion Control route the motion video drives all movement and the prompt only steers appearance. Fields, limits and $0.1575 per second.
- Eight inspect stills on a 45 s Snap ad: one lands in the first 6 s
Video inspect's default eight stills on 45 seconds sit 5.6 s apart; only 2.8 s falls in Snap's non-skippable first 6. Use frames at 1, 3 and 5.9 instead.
- Fabric accepts image_url or avatar_handle, never both: which to send
On Sume's VEED Fabric 1.0 route, send one visual source: the image_url of an inspected still, or an avatar_handle the user named. Both together is not allowed.
Written by Sume