Basically three options (for terminals specifically):
1. Use asciinema, which records your terminal's stdin & -out. It generates a very small recording, but you can only play it back with the asciinema player, as it's not technically an image or movie format.
2. Script your interactions and record it with a regular screen recorder like OBS.
3. At charm we got fed up with the first two options and we wrote our own software that does the job. To be released in the next few days!