Commonly used commands to edit videos.

ffmpeg is a suite of libraries and programs to handle video and audio streams.

Resizing

ffmpeg -i input.mp4 -vf scale=320:-1 output.mp4

Retains the aspect ration specifying the width.

ffmpeg -i input.mp4 -vf scale=-1:720 output.mp4

Retains the aspect ration specifying the height.

ffmpeg -i input.mp4 -vf scale=1280:720 -preset slow -crf 18 output.mp4

Retains a high image quality