ttyrec2video
converts ttyrec
files (recordings of terminal sessions, including timing data) to video files
(MP4, WMV, and whatever other formats imageio's ffmpeg writer supports). You
may be familiar with ttyrecs from their use in recording NetHack games on
nethack.alt.org.
ttyrec2video
requires Python 3.6 or higher to run and pip 19.0 or higher to install. You can install
ttyrec2video
and its dependencies by running:
python3 -m pip install git+https://github.com/jwodder/ttyrec2video.git
Installing inside a virtual environment is recommended.
Note that ttyrec2video
uses imageio, which in
turn needs the ffmpeg program in order to create
videos. If you don't have a suitable version of ffmpeg already installed, one
will be downloaded for the program to use instead.
ttyrec2video [<options>] <ttyrec>[.gz|.bz2] [<outfile>]
<ttyrec>
may be either a path to a local ttyrec file or an HTTP(S) URL
pointing to a remote ttyrec. Files compressed with gzip or bzip2 will be
uncompressed automatically.
If no output filename is supplied, the resulting video is written to the input
filepath/URL basename with its extension changed to ".mp4
."
-E ENCODING, --encoding ENCODING | |
Specify the character encoding to use for reading the ttyrec file's text; defaults to UTF-8 | |
--font-file TTF-FILE | |
Specify the path to a TrueType font (.ttf ) file
containing the font to use for rendering normal
(non-bold) text. The font is assumed to be monospaced.
The default is to use the Ubuntu Monospace font. | |
--bold-font-file TTF-FILE | |
Specify the path to a TrueType font (.ttf ) file
containing the font to use for rendering bold text.
The font is assumed to be monospaced. The default is
to use the bold Ubuntu Monospace font. | |
--font-size INT | |
Set the font size (in points) of rendered text; defaults to 16 | |
--fps INT | Set the FPS (frames per second) rate of the output video; defaults to 12 |
--ibm | Synonym for "--encoding cp437 " (CP437 is the
character encoding used by NetHack's IBMgraphics
option) |
--info | Instead of converting the ttyrec file to a video, output the ttyrec's total duration and number of screen updates as a JSON object |
--info-all | Like --info , but also include a list of the time &
byte offsets of each screen update |
--size COLUMNS_LINES | |
[Specify COLUMNS and LINES as separate
arguments] Set the dimensions of the terminal screen on
which the ttyrec was recorded; defaults to 80×24 |
The source code for ttyrec2video
is licensed under the MIT license.
ttyrec2video
contains a bundled copy of the Ubuntu Monospace font, regular and bold weight, version 0.83, copyright
2010, 2011 Canonical Ltd, licensed under the Ubuntu Font Licence, Version 1.0.