Tips and tricks with ffmpeg

This is a quick cheatsheet for me and for anyone that would be interested by ffmpeg. I use ffmpeg for many things but especially: screen recording and to be able to upload larger files on Discord without Nitro.

Recording screen and audio

ffmpeg -f x11grab -i :0.0 -preset ultrafast screenrecording.mkv
ffmpeg -f x11grab -i :0.0 -f pulse -ac 2 -i default -preset ultrafast screenrecording.mkv
ffmpeg -f pulse -ac 2 -i default audiorecording.mp3

Shrink file size

To be able to upload files on Discord (or just have easier time to edit the video if your computer is low end) you can shrink the file isze by a lot this way:

ffmpeg -i input.mkv -vcodec libx265 -crf 28 output.mp4
ffmpeg -i input.mp4 -movflags faststart output.mp4