Timeline fit: cover, contain, stretch or blur?
In a Sume Timeline render, video[].fit sets how a clip fills the frame: cover crops, contain pads black, stretch distorts, blur pads with a blurred copy.

video[].fit on a Sume Timeline render has four values: cover (the default) fills the frame and crops the overflow, contain shows the whole clip and pads the rest with black, stretch scales to the frame and distorts the picture, and blur shows the whole clip over a blurred, enlarged copy of itself. It matters whenever a clip's aspect ratio differs from the output.
The value list is from the Sume docs page Timeline 1.0, read 2026-09-29. What each value does is stated in the render compiler source, packages/timeline-compiler/src/index.ts, as of that date; the docs page lists the names only.
What does each fit mode do?
The default output is 1080 by 1920, so a landscape clip is the usual case where you have to choose. Fit is set per clip, so one render can mix modes.
| `fit` | Result when the shapes differ | Compiler steps |
|---|---|---|
cover (default) | Frame filled; the overflow is cropped away | scale with force_original_aspect_ratio=increase, then crop to the frame |
contain | Whole clip visible; black bars fill the gap | scale with force_original_aspect_ratio=decrease, then pad with black, centered |
stretch | Frame filled; aspect ratio is not kept | scale straight to the frame size |
blur | Whole clip visible; the gap shows a blurred copy | A cover-cropped, blurred copy under a contained copy |
How does blur build the background?
The compiler splits the clip into two copies. One is scaled down by a factor of 8, cover-cropped, blurred with gblur at sigma 6 and scaled back up to the frame. The other is contained inside the frame, and the two are overlaid with the sharp copy centered. The comment in the source describes the point: a mismatched aspect ratio reads as depth instead of black bars.
Which mode should I pick?
Pick by what you can afford to lose. cover loses the edges of the picture, so a subject near an edge can be cut. contain and blur keep every pixel of the clip. stretch keeps everything but changes shapes, which shows on faces and circles. If the clip already matches the output shape, all four look the same.
Can I mix modes in one render?
Yes. fit sits on each entry of video[], so an intro that already matches the frame can use the default while a landscape interview clip in the same render uses blur. Stills are accepted in the same list and are held as static frames, so the same choice applies to a photo whose shape does not match the frame. Remember that the output size itself comes from output.width and output.height, which are even integers from 256 to 2160, and default to 1080 by 1920 when omitted.
What does a request with fit look like?
Add fit to the clip inside video[]. The rest of the request is unchanged from the Timeline docs example, and Idempotency-Key is required on the submit.
curl -X POST https://api.sume.com/v1/timeline-1.0/render \
-H "Authorization: Bearer $SUME_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: timeline-fit-001" \
-d '{
"audio": {
"url": "https://media.sume.com/artifacts/artf_demo/voice.wav",
"duration_seconds": 8
},
"video": [
{
"source_url": "https://media.sume.com/artifacts/artf_demo/wide.mp4",
"start": 0,
"duration": 8,
"fit": "blur"
}
]
}'Sources
Related posts
More in Media tools
- render_strategy_unsafe: Timeline render single with over 12 slots
render_strategy_unsafe means render.strategy was single with more than 12 video slots. Use auto or chunked, or send 12 or fewer slots. Sume Timeline docs.
- Trim a video without re-encoding: precision keyframe in the Sume API
Sume's video trim with precision keyframe stream-copies the cut, with no re-encode. It can start a GOP early, so read actual_start_seconds in the result.
- 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.
- Darken a video with an API: the dim operation and its amount
The dim op multiplies a clip's brightness by amount in (0, 1]. 0.45 darkens, 1 changes nothing, 0 and above 1 are refused. Request, limits and cost.
Written by Sume