Trimmed video looks squashed: video-trim output width and height

Setting both output.width and output.height on video-trim scales to exactly that box and distorts the picture. Set one side, or crop and fit in a Timeline.

3 min readSume
All posts

People look squashed because output on Sume's video-trim route is a conform to the exact size you request, not a fit. When you send both width and height and they do not match the source's aspect ratio, the picture is stretched to fill the box. Send only one of them and the other follows the source ratio.

This is easy to hit when you trim a landscape clip and ask for 1080 by 1920 in the same call, expecting a vertical short.

What the compiled filter does

We ran the repository's trim compiler on several output blocks. Both sides set gives a plain scale=1080:1920. A width alone gives scale=1080:-2, and a height alone gives scale=-2:1080; the -2 asks the scaler to keep the source aspect and round to an even number. Odd values are floored: 1079 by 1919 became scale=1078:1918.

Take a 1920 by 1080 clip and request 1080 by 1920. Horizontally it is scaled by 0.5625 and vertically by 1.7778, so everything comes out about 3.2 times taller relative to its width. That is the squashed look.

video-trim output fields and the filter they compile to (read 2026-10-03)
output sentCompiled filterAspect ratioUse for
width 1080, height 1920scale=1080:1920Forced, stretches if source differsSources already 9:16
width 1080 onlyscale=1080:-2Kept from the sourceDownscale a landscape clip
height 1080 onlyscale=-2:1080Kept from the sourceCap the height
width 1079, height 1919scale=1078:1918Forced, even-roundedNothing, send even numbers
width 720, height 720, fps 30scale=720:720,fps=30ForcedSquare sources only

Doing a landscape-to-vertical change properly

Trim is for the time range, and its conform is for size and frame rate on material that already has the right shape. Changing shape is a layout decision, and Timeline 1.0 has it: each slot's fit is cover to crop, contain to pad with black, blur to pad with a blurred copy of the frame, or stretch if you really want the distortion. The default output is 1080 by 1920.

So the flow is video-trim for the cut, then a one-slot Timeline render with fit: "cover" or "blur". If you want a particular crop window instead of the centre, use a video-filter crop first, then fit.

Other limits on output

Edges must be 256 to 2160 and fps one of 24, 25, 30 or 60. output works only with precision: "exact"; combining it with keyframe returns video_trim_output_requires_exact. A trim costs $0.02 per job, so a wrong output block is cheap to redo, but check the result frame with video frames before publishing.

Sources

Related posts

More in Media tools

All Media tools posts

Written by Sume