Record once, render many

Replay one recording at another size, rate or theme, without running the app again.

Bars, lower is better: seconds to replay and encode a 10-second cast with prec 1.2.0: 720p 30 fps 9.2 s, 1080p 60 fps 16.9 s, 2160p 30 fps 27.8 s, 2160p 120 fps 48.6 s.

What it does

The session is kept as an asciicast v2 cast. prec render replays a cast at another size, rate or theme without running the app again, and the same cast always gives the same bytes.

The encoder's threads are fixed, because its output follows its thread count, so a master is byte-identical on any machine. prec reads the MP4 back and checks its frame count and size before the manifest claims them.

  • Same cast, same bytes

    In the benchmark, two 720p 30 fps renders of one cast wrote the same master, sha256 4fab0be36a0ac519….

  • Many themes from one run

    --themes renders one recording in several themes at once, light and dark from the same take.

  • The release it belongs to

    --rev builds and renders a tag or commit, read from git without touching your index or tree.

  • Replays side by side

    Recording one shot is exclusive in a tree; replays of it at different sizes, rates or themes run at once.

Measured

a 10 s cast re-rendered at 720p 30 fps
9.2 s
How it was measured
at 1080p 60 fps, 598 frames
16.9 s
How it was measured
at 2160p 30 fps, 299 frames
27.8 s
How it was measured
at 2160p 120 fps, 1,196 frames
48.6 s
How it was measured

How to use it

  1. Record only, into a cast.

    prec record myapp tour
  2. Replay the cast at another size and rate.

    prec render tmp/renders/myapp/clip/myapp-clip-tour-1920x1080-60fps.cast --size 720p --fps 30
  3. Render a tag, light and dark.

    prec clip myapp tour --rev v1.4.0 --themes "Catppuccin Latte,Catppuccin Mocha"

Read it. Run it. It's MIT.

The code is MIT licensed, © Catalin Ilinca: read it, fork it, ship it in your own work. Its name and logos, and PITO MD's, are © Catalin Ilinca, all rights reserved, and are not covered by the MIT licence.

Credits

prec vendors xterm.js 5.5.0 and VHS v0.11.0's 348 colour schemes, both under the MIT licence; their notices are in its NOTICE.

Set in Archivo by Omnibus-Type and Atkinson Hyperlegible Mono by the Braille Institute, both under the SIL Open Font License.