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

Recording

ffmpeg -f x11grab -video_size 1600x900 -framerate 50 -i :1.0 -vf format=yuv420p output.mp4

Records the screen without audio

ffmpeg -f alsa -ac 2 -i default -acodec libmp3lame -ab 320k ouput.mp3

Records audio and stores it as compressed mp3