• Stars
    star
    966
  • Rank 47,364 (Top 1.0 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created about 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Blazingly fast terminal recorder that generates animated gif images for the web written in rust

t-rec: Terminal Recorder

License: GPL v3 crates.io dependency status Build Status LOC

Blazingly fast terminal recorder that generates animated gif images for the web written in rust.

Demo

demo

Features

  • Screenshotting your terminal with 4 frames per second (every 250ms)
  • Generates high quality small sized animated gif images or mp4 videos
  • Build-In idle frames detection and optimization (for super fluid presentations)
  • Applies (can be disabled) border decor effects like drop shadow
  • Runs on MacOS, Linux and NetBSD
  • Uses native efficient APIs
  • Runs without any cloud service and entirely offline
  • No issues with terminal sizes larger than 80x24
  • No issues with fonts or colors
  • No issues with curses based programs
  • No issues with escape sequences
  • No record and replay - just one simple command to rule them all
  • Can record every arbitrary window you want (e.g. browser, ide)
  • Written in Rust 🦀

Installation on MacOS

with homebrew

brew install t-rec

with macports

sudo port selfupdate
sudo port install t-rec

with cargo

NOTE t-rec depends on imagemagick.

brew install imagemagick
cargo install -f t-rec 

NOTE -f just makes sure the latest version is installed

Installation on Linux

as .deb

sudo apt-get install imagemagick
wget https://github.com/sassman/t-rec-rs/releases/download/v0.5.0/t-rec_0.5.0_amd64.deb
sudo dpkg -i t-rec_0.5.0_amd64.deb

as snap

Get it from the Snap Store

TL;DR:

sudo snap install t-rec --classic
/snap/bin/t-rec --version
t-rec 0.4.3

from AUR

t-rec can be installed from available AUR packages using an AUR helper. For example,

paru -S t-rec

If you prefer, you can clone the AUR packages and then compile them with makepkg. For example,

git clone https://aur.archlinux.org/t-rec.git
cd t-rec
makepkg -si

Installation on NetBSD

pkgin install t-rec

Or, if you prefer to build from source,

cd /usr/pkgsrc/multimedia/t-rec
make install

with cargo

sudo apt-get install libx11-dev imagemagick
cargo install -f t-rec
tested on those distros
ubuntu 20.10 on GNOME
demo-ubuntu
ubuntu 20.10 on i3wm
demo-ubuntu-i3wm
linux mint 20 on cinnamon
demo-mint
ArcoLinux 5.4 on Xfwm4
demo-arco

Usage

t-rec

or with specifying a different program to launch

t-rec /bin/sh

Full Options

t-rec 0.7.0
Sven Assmann <[email protected]>
Blazingly fast terminal recorder that generates animated gif images for the web written in rust.

USAGE:
    t-rec [OPTIONS] [shell or program to launch]

ARGS:
    <shell or program to launch>    If you want to start a different program than $SHELL you can
                                    pass it here. For example '/bin/sh'

OPTIONS:
    -b, --bg <bg>                     Background color when decors are used [default: transparent]
                                      [possible values: white, black, transparent]
    -d, --decor <decor>               Decorates the animation with certain, mostly border effects
                                      [default: none] [possible values: shadow, none]
    -e, --end-pause <s | ms | m>      to specify the pause time at the end of the animation, that
                                      time the gif will show the last frame
    -h, --help                        Print help information
    -l, --ls-win                      If you want to see a list of windows available for recording
                                      by their id, you can set env var 'WINDOWID' or `--win-id` to
                                      record this specific window only
    -m, --video                       Generates additionally to the gif a mp4 video of the recording
    -M, --video-only                  Generates only a mp4 video and not gif
    -n, --natural                     If you want a very natural typing experience and disable the
                                      idle detection and sampling optimization
    -q, --quiet                       Quiet mode, suppresses the banner: 'Press Ctrl+D to end
                                      recording'
    -s, --start-pause <s | ms | m>    to specify the pause time at the start of the animation, that
                                      time the gif will show the first frame
    -v, --verbose                     Enable verbose insights for the curious
    -V, --version                     Print version information
    -w, --win-id <win-id>             Window Id (see --ls-win) that should be captured, instead of
                                      the current terminal

Disable idle detection & optimization

If you are not happy with the idle detection and optimization, you can disable it with the -n or --natural parameter. By doing so, you would get the very natural timeline of typing and recording as you do it. In this case there will be no optimizations performed.

Enable shadow border decor

In order to enable the drop shadow border decor you have to pass -d shadow as an argument. If you only want to change the color of the background you can use -b black for example to have a black background.

Record Arbitrary windows

You can record not only the terminal but also every other window. There 3 ways to do so:

  1. use -w | --win-id argument to name the Window Id that should be recorded
t-rec --ls-win | grep -i calc
Calculator | 45007

t-rec -w 45007 
  1. use the env var TERM_PROGRAM like this:
  • for example lets record a window 'Google Chrome'
  • make sure chrome is running and visible on screen
TERM_PROGRAM="google chrome" t-rec

Frame cache dir: "/var/folders/m8/084p1v0x4770rpwpkrgl5b6h0000gn/T/trec-74728.rUxBx3ohGiQ2"
Recording window: "Google Chrome 2"
Press Ctrl+D to end recording

this is how it looks then: demo-chrome

  1. use the env var WINDOWID like this:
  • for example let's record a VSCode window
  • figure out the window id program, and make it
  • make sure the window is visible on screen
  • set the variable and run t-rec
t-rec --ls-win | grep -i code
Code | 27600

# set the WINDOWID variable and run t-rec
WINDOWID=27600 t-rec

Frame cache dir: "/var/folders/m8/084p1v0x4770rpwpkrgl5b6h0000gn/T/trec-77862.BMYiHNRWqv9Y"
Press Ctrl+D to end recording

this is how it looks then: demo-vscode

Contribute

To contribute to t-rec you can either checkout existing issues labeled with good first issue or open a new issue and describe your problem. Also every PR is welcome. Support for Linux and Windows needs to be done.

On the web & social media

License

More Repositories

1

ssd-benchmark-rs

Super Simple Disk Benchmark - benchmarks the writing performance of your disk
Rust
47
star
2

srp6-rs

A safe implementation of the secure remote password authentication and key-exchange protocol (SRP and SRP6a)
Rust
14
star
3

putzen-rs

"putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely.
Rust
9
star
4

son-of-grab

Based on apples original showcase of the CG Window API Sons of grab updated for macOS 11
Objective-C
8
star
5

deployment_shell

CakePHP based Application Deployment Shell
PHP
6
star
6

monitoring

CakePHP general metrics monitoring plugin
PHP
5
star
7

django-gitana

Git repository management app for django
Python
4
star
8

edu-sql-parser-rs

SQL Types transpiles `CREATE TABLE` SQL code into type definitions in other languages such as TypeScript or Rust.
Rust
3
star
9

django-vagrant-template

a project start template for django projects with vagrant, puppet, mysql, gunicorn, twitter bootstrap and lot of other handy things
Ruby
3
star
10

edu-macosx-development

some macos projects for demo and learning purpose
Swift
2
star
11

rust-munich-meetup-5

Rust Munich Meetup #5 talk about unikernels and rusty-hermit
Rust
2
star
12

rust-deb-builder

Builds statically linked binaries and packages it as .deb using docker
Makefile
2
star
13

hermit-template-rs

a cargo-generate template for a rusty-hermit application
Rust
1
star
14

kx-rust-I

Demo for Rust I - KX
Rust
1
star
15

wasm-js

WebAssembly showcase for node.js
HTML
1
star
16

net-proxy-rs

a naive tcp and udp network proxy server, written in rust
Rust
1
star
17

stegano.kde4

Steganography tool for KDE
C++
1
star
18

rust-domain-rs

a tool to create a `.rs` domain for your rust project from the shell
CSS
1
star
19

cli-template-rs

my personal cli app template for rust
Rust
1
star
20

django-benchmark

extend the yii performance benchmark with django benchmark
PHP
1
star