I made a terminal record with the script
tool.
mediainfo video
General
Complete name : video
File size : 1.29 KiB
I can play it with scriptreplay
. Is it possible to convert it to a GIF, for example with ffmpeg
or another program?
To clarify, I mean script
from the bsdutils
package, not a program script. I thought that the saved file is a kind of video, so I can grep some frames/pictures and create a GIF of it.
I hope it is more clear now.
A nice option is to use
ttyrec
to record your terminal activity and then convert it to a GIF usingttygif
.Install the
ttyrec
andttygif
packages:Open a terminal and start
ttyrec
to record your terminal:Running
ttyrec
without an argument will save the recording in a file namedttyrecord
in your current folder. You can specify a filename as an argument to save the file with this name.Use your terminal.
Press Ctrl+D to stop recording.
To convert the recording to a GIF, run:
If you saved the recording with another filename, change
ttyrecord
to the filename you used.This command will save the recording as a GIF with the name
tty.gif
.Here is a GIF I created with the above procedure that contains the above procedure:
Notes
If you get this error when you run
ttygif
:you need to run the following command before running
ttygif
:The above command needs
xodtool
. You can install it using:Reference: https://github.com/icholy/ttygif#additional-notes
ttygif
does not work with qterminal for some reason. Use another terminal for the conversion instead.I have confirmed that it works fine with kitty, it's slow with GNOME terminal, and it's extremely fast with XTerm.
The
ttygif
command can produce big-size directories in/tmp
. I recommend removing them manually after the conversion using: