File format

Static Stream

A stream stopped in a file, and let go again.

Richeson: Static Stream — Systems

Summary—A stream written into a .sstr file with its order, its pace and its tolerance for damage intact — protected by Reed–Solomon codes and parity, checkpoints signed with your SSH key.

Light can be slowed until it seems to stand still, and released. A static stream does that with bytes: a stream is written into a .sstr file with its order, its pace and its tolerance for damage intact, and later let go again as a stream — into a new file, to a player at the pace it was recorded, or to VLC or mpv as clients while it is still being recorded. Nothing is encrypted and nothing is decoded, so no codec is involved.

The user process is five steps. sstr record cuts a stream into records, each stamped with the moment it arrived, and writes the source, licence and a note into the capture's own header, so a capture separated from its machine still says what it is. sstr verify reads the whole file and reports what was repaired, what was rebuilt, what was lost, whether the chain of checkpoints holds and who signed it. sstr play gives the bytes back, at the recorded pace with --paced, or over HTTP with --serve; sstr export writes a folder of captures back out as the files they hold, and names a file only once its capture has verified.

The protection is layered, and each layer catches what the others cannot. Every record is protected by a Reed–Solomon RS(255,223) code, interleaved so a burst lands thinly across every codeword, and its header is written twice. A parity record after every group of 16 rebuilds whole records lost outright: version 1, the default, carries two rows and brings back two lost records of a group where version 0 brought back one. A hash chain fixes the order and the set of records, and its checkpoints are signed with an SSH key through ssh-keygen, so an edit that recomputes its own CRCs and parity is still found.

For serial consoles, sstr armor turns a capture into 80-column CRC-checked lines that each name their own offset, so a lost line becomes a known gap the Reed–Solomon decoder corrects at twice the rate of an unknown error. The same repository holds ytq, Copal's clipboard-watching download queue, which archives what it downloads as Static Stream and deletes the original MP4 only once the capture verifies and its payload's SHA-256 is the MP4's; and sstr-workspace, a terminal Workspace in NeXTSTEP's words, whose every Service is a command line printed before it runs.

It is one Rust crate with no dependencies at all, so it builds on machines that never reach the internet. The format is defined by a Python prototype frozen in the repository, and make check runs 436 checks and 150 unit tests with nothing installed but cargo, including byte-for-byte crosschecks against that prototype through its whole damage battery.

Highlights

  • A stream kept with its order, its pace and its tolerance for damage
  • Reed–Solomon inner code and P+Q parity: two lost records of a group rebuilt
  • A hash chain with checkpoints signed by your SSH key
  • Played back paced, served to players while still recording, or exported
  • Armor for serial lines, with lost lines as erasures
  • Zero dependencies; ytq archives its downloads into it

At a Glance

TABLE I Static Stream
LanguageRust
PlatformLinux, macOS
Version0.2.0
LicenseMIT
Websitecrates.io/crates/staticstream
Sourcegithub.com/vonglurt/staticstream

Pictures

Fig. 1. The .sstr file, record by record: twin headers, interleaved RS(255,223) bodies, parity, and the signed hash chain

Fig. 2. sstr verify: every layer of the capture checked and reported, the signature trusted through an allowed-signers file.

Fig. 3. The same two records wiped: version 1 rebuilds both from parity, version 0 loses them.

Fig. 4. An edited record and a capture cut short, both named by the chain and the missing end record.

Fig. 5. A capture served over HTTP while still being recorded; the client joins late and gets the frame from two seconds in.

Fig. 6. sstr-workspace: the Browser over the archive folder, the Inspector showing what sstr verify says.