The scale filter
Resolution changes go through -vf scale=W:H. Width and height accept literal pixels (1280:720), the special value -1 (preserve aspect ratio, must be divisible by 2), or expressions (iw/2:ih/2).
Aspect-ratio safe scaling
Hard-coding both dimensions can squish video. Two patterns to remember:
scale=1280:-2— width is 1280, height auto-computed and rounded to even (H.264/H.265 require even dimensions).scale=-2:720— height is 720, width auto.scale=iw/2:ih/2— half size, exact ratio preserved.
Upscaling vs downscaling
Downscaling is lossless in perceptual terms — you're throwing pixels away. Upscaling is lossy in perceptual terms — you're inventing pixels. scale uses bicubic by default, which is fine for downscaling and acceptable for moderate upscaling. For aggressive upscaling (480p → 4K) consider AI-based tools (Topaz, esrgan) or the realesrgan_ncnn filter on Linux.