Every frame, at the rate you ask for

A 10 s clip at 120 fps has 1,196 frames. Every one.

What it does

prec doesn't capture the screen while the app runs. It runs your app in a real pty, records its output bytes with their timestamps, then steps a virtual clock at exactly 1/fps and draws each frame in headless Chromium, so a clip has the shown time times the fps in frames, however heavy the frame or the rate.

Frame n sits at n × 1001/24000 s at 24000/1001, never a rounded float. Ask for 24, 30, 48, 60 or 120 fps, or the NTSC rates as exact rationals, at any size up to 3840x2160.

VHS v0.11.0, on the same 10-second tape, captured in real time and wrote a 25 fps file at every setting, shorter than the tape. prec's clips are 9.97 s at 30, 60 and 120 fps.

  • Every rate, exactly

    --fps takes 24, 30, 48, 60 or 120 (the default), or 24000/1001, 30000/1001, 48000/1001 and 60000/1001, also written 23.976, 29.97, 47.952 or 59.94. Another decimal is refused with the rational to use.

  • Native pixels at every size

    The grid is fixed and the font is fitted to each size, so 4K shows exactly what 720p shows, drawn at its own pixels rather than scaled.

  • A real terminal

    xterm.js 5.5 with Unicode 11 widths draws truecolor, box drawing, wide CJK and Nerd Font glyphs.

  • Masters, not deliveries

    A clip is one silent H.264 master (CRF 14, BT.709 limited range, tagged), encoded inside prec by pito-codecs with no ffmpeg, with a poster PNG and a JSON manifest holding each file's sha256.

Measured

frames in a 10 s clip at 120 fps; VHS v0.11.0 on the same tape: 214
1,196
How it was measured
frames at 60 fps; VHS: 228, in a 25 fps file
598
How it was measured
prec's wall time at 30 to 120 fps; VHS finishes sooner, in 13.9 to 15.2 s, because it keeps only what it captures in real time
20.5–23.4 s
How it was measured

How to use it

  1. Record a shot at 1080p and 60 fps.

    prec clip myapp tour --size 1080p --fps 60
  2. Or at an NTSC rate, as its exact rational.

    prec clip myapp tour --size 1080p --fps 30000/1001

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.