All the MPEG-2 patents have expired as of February 14, 2020. Therefore, we can use this codec freely on FFMPEG for desktop recording. It is light weight codec, similar to MPEG-1, so the encoding speed is fast and it does not use a large amount of CPU cycle.
It is very easy to use, almost same as MPEG-1:
ffmpeg -f x11grab -filter:v fps=30 -s 1920x1080 -i :0.0 -f pulse -ac 2 -i default -c:v mpeg2video -q:v 1 -c:a pcm_s16le output.mkv
Have fun; be free!