The scale filter takes scale=w:h. The trick that prevents stretched, squashed video is the special value -1 (or -2): set one dimension and let FFmpeg compute the other from the source aspect ratio. Use -2 in practice — it rounds to an even number, which most codecs require.
Key takeaways
scale=1280:-2sets width to 1280 and keeps aspect ratio (even height).scale=-2:720locks height to 720 instead.- Downscaling shrinks file size; upscaling can't add real detail.
- Use
force_original_aspect_ratio+padto fit an exact frame.
Resize to a width or height, keep aspect ratio
# lock width to 1280, height auto (even) ffmpeg -i in.mp4 -vf "scale=1280:-2" -c:a copy out.mp4 # lock height to 720, width auto ffmpeg -i in.mp4 -vf "scale=-2:720" -c:a copy out.mp4
Downscale to 1080p or 720p
Capping the long edge is the safest way to hit a target like 1080p without forcing an aspect ratio. min() avoids upscaling clips that are already smaller:
# downscale so width never exceeds 1920, never upscale ffmpeg -i in.mp4 -vf "scale='min(1920,iw)':-2" -c:a copy out.mp4 # quick 720p ffmpeg -i in.mp4 -vf "scale=-2:720" -c:a copy out_720p.mp4
Fit an exact frame size with padding
When you need a precise output (say 1080×1080) without cropping, scale to fit and pad the empty space with a background color:
ffmpeg -i in.mp4 -vf \ "scale=1080:1080:force_original_aspect_ratio=decrease,\ pad=1080:1080:(ow-iw)/2:(oh-ih)/2:black" \ -c:a copy out.mp4
Resize visually instead
FFmpegLab exposes resolution presets and a custom size field, then writes the matching scale command behind the scenes — running fully offline. Combine it with cropping to reframe first, then compress to finish.