Scaling a Video with FFmpeg

From the pile Simple Things That I Keep on Forgetting, today we have:

Scaling down a video with ffmpeg while preserving the aspect ratio.

$ ffmpeg ... -vf "scale=w=min(iw\,1280):h=-2" ... 

"h=-2" maintains the aspect ratio, using only even numbers.

Source