To create a screencast using Linux command line tools I have used the methods outlined on this page:
https://sandilands.info/sgordon/multimedia-on-linux-command-line
(Ctrl-F screencast)
This might not be the easiest method, but it was simple enough for me and uses only tools that I had installed already.