

However, if you don't want that for some reason (or don't have xdg-screensaver installed) - you might want to override it with -S flag.

It's not recommended to set it to less than number of cores. If you want to speed up the conversion though, you can try to use -m flag (tells gifsicle to keep frames in RAM) and -b option, which adjusts the maximum number of frames to queue in RAM and defaults to the number of logical cores in the machine. pyttygif defaults to try to reduce RAM usage.However, you can alter display time of the last frame of the GIF with -L option (floating point number). ttyrec format doesn't define display time of the last frame.There's also a number of advanced options available. You can also specify -s to pass (floating point) speed multiplier to speed up or slow down the output GIF and -l to specify number of times to play the GIF (0 = infinity). Reencode ttyrec to match terminal (source:target)Įnable logarithmic time compression (base = e)įor the most basic usage, you only need to specify the required positional arguments (input ttyrec file path and output GIF file path). f FPS, -fps FPS How many frames to screenshot per secondĬap the display time of single frame (in seconds) D, -dirty Don't clear screen before record l LOOP, -loop LOOP Number of times to play the GIF (0 = infinity) h, -help show this help message and exit

Imagemagick or gifsicle install#
Then, install pyttygif from pip: sudo pip3 install pyttygifįinally, you can convert a ttyrec like that: python3 -m pyttygif sample.ttyrec. If any of the required tools are missing, pyttygif will inform you of that. That is, x11-apps, imagemagick, and gifsicle.įor example, in Debian/Ubuntu, following should work: sudo apt-get install x11-apps imagemagick gifsicleĪnd in RedHat-based distros, following should do: sudo yum install xorg-x11-apps ImageMagick gifsicle Installationįirst, ensure that all required dependencies are installed. Or (if the window was minimized), it could fail the conversion outright.
Imagemagick or gifsicle windows#
It could cause artifacts, capturing portions of the overlapped windows and other undesired effects on the resulting GIF image. Warning: it's not recommended to move, resize, minimize, overlap with another window or otherwise interact with terminal emulator during the recording of GIF. For image processing, it depends on tools, such as xwd, convert (from imagemagick) and gifsicle, which are available in repos of most mainstream distros. pyttygif is implemented in pure-python and should work on any Linux system with X11 and Python 3. You could adjust GIF optimization level, enable logarithmic time compression or trade-off more RAM to reduce the processing time. pyttygif already comes with sane defaults, but if you want to adjust something - there's a variety of advanced options. Also, pyttygif merges too short ttyrec frames, so that resulting GIF looks natural. Because it screenshots the running terminal - you can precisely control the appearance of output GIF by configuring your terminal emulator appearance. Resulting GIFs are also optimized and don't take a lot of disk space. It also doesn't create huge multi-gigabyte temporary directories. pyttygif doesn't load tons of huge, uncompressed bitmaps into the RAM (at least, not by default). It delegates most heavy work to the fast commandline tools (such as convert and gifsicle) and uses multiprocessing to parallelize the work. While most ttyrec-to-GIF converters are either very slow or have a long post-processing stage, pyttygif is rather quick. Pyttygif was developed with several goals in mind: In most Linux distros, it could be easily installed from repos. Perhaps, one of most popular uses of it is to record roguelike game sessions (e.g. Ttyrec is a tool (and eponymous format) that's used to record a tty output and allow it to be played back later. Pyttygif (yet another) ttyrec to gif converter, written in PythonĬreate (optimized) animated GIFs of your terminal sessions by playing ttyrec file and screenshotting the terminal emulator.
