Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3799  / 1 Year ago, sat, february 25, 2023, 6:30:44

Using ttyrec I can record any console program (ttyrec invokes a shell and records the session until the shell exits). The record is saved by default in a ttyrecord file and can be played using ttyplay ttyrecord command.



Now, I want to convert this ttyrecord file in a .gif file. I found this phyton script (tty2gif.py), but, no matter how I do, I can not manage to make it to work...



Any other solutions will be appreciated!


More From » tty

 Answers
3

Ok I have ran a test with the tty2gif script that you mentioned on your question and I -somehow- succeeded getting the gif animation as shown in the next screenshot:



enter image description here



I needed to install python-opster in order to make the script work without a problem, otherwise you may receive a "Line 7 Error" message when running the script from the terminal. Then simply sudo apt-get install python-opster in the terminal, provide your user password and get the complement installed.



Now, if you run the script with no parameters you'll see the options as shown in the next screenshot:



enter image description here



We'll send the script's command with the "typing" option in order to get the individual gif shots as follows:



enter image description here



This will reproduce your keypresses in the terminal and will get an individual screenshot for each iteration. Which will result in several gif images in the folder, the images will be named "step???.gif" as seen in the next screenshot:



enter image description here



Now, we will use the convert command from the Imagemagick package in order to drop the next line in the terminal so that we can get a one-file gif animation made from these step???.gif image files, as follows:



convert -delay 50 -loop 0 *.gif terminal.gif


Please note that I am using *.gif having in mind that there are no other .gif files in the same folder, otherwise they may be merged in the resulting animation.



Here you can change the -delay and the -loop parameters, the same as the resulting filename.



You can also import these step???.gif files in gimp or any other image manipulation program in order to make a better (optimized) gif animation which will result in a smaller file size.



Please let us know if you succeed with this workaround or if you are experiencing a different kind of an issue, don't hesitate to let us know also.



Good luck!


[#30141] Sunday, February 26, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
panshow

Total Points: 454
Total Questions: 98
Total Answers: 122

Location: Philippines
Member since Sat, Jul 11, 2020
4 Years ago
;