As well as transcoding video, we can rescale video, handy for converting HD to SD or UHD to HD. Rescaling can be done when transcoding, or as a step on its own. Please note, if you want to play video back at a certain size, ffplay can rescale the output video, without destroying the source.
This is how to rescale the video, where you specify the framesize:
ffmpeg -i input.mov -vf scale=320:240 output.mov
You can also rescale without specifying the exact aspect ratio, so here we have specified the width, and the height will be worked out automatically from the original aspect ratio.
ffmpeg -i input.mp4 -vf scale=320:-1 output.mp4
To transcode and rescale in one go, you can use the following example:
ffmpeg -i source.mov -vcodec h264 -b:v 50M -vf scale=960:540 dest.mp4