Sidecar/1: metadata a transcode stripped, put back by fingerprint

Per-frame measurement records ride inside the H.264 stream as SEI NAL units, one Sidecar/1 JSON envelope per access unit. Every copy path keeps them; a re-encode destroys every one. Each envelope also carries a 64-bit fingerprint of its own frame, so a receiver holding the envelopes from somewhere else can re-attach them to the transcoded pictures by aligning fingerprint sequences. Tab A reads the metadata out of the stream. Tab B loads the transcoded file, whose SEI is gone, decodes every frame in your browser, hashes it, and rebinds.

Everything runs on your device: the page fetches only its own files (sidecar.mp4, sidecar_transcoded.mp4, sidecar_rows.json, parity.json). No CDN, no server, no model download.

Measured on this file (600 frames, 640×360, one Sidecar/1 envelope per frame)
loading parity.json …

Fingerprint survival on the same material, Python reference: the same frame before and after the 480×270 CRF 28 re-encode differs by – bits (median), max –; consecutive frames of this moving scene differ by –; monotone alignment rebinds – rows to the frame they came from, nearest-neighbour –.

Measured on: x264 output re-encoded and re-muxed by ffmpeg 8.0 on one machine, over one synthetic 640×360 scene (ffmpeg testsrc2 with a moving block) — a rendered test clip, not a recording. Deployment domain not tested: hardware encoders, RTSP/RTP camera pipelines, WebRTC SFUs, HLS through a CDN, HEVC (SEI is codec-specific), and real scenes of any kind.

Named failure: fingerprint rebinding cannot work on a static scene. Consecutive frames of a held picture are 0 bits apart, so the hash carries no ordering information and the alignment is arbitrary within a run (measured 0.10 correct on one degradation of a static clip and 1.00 on another — luck, not signal). The ambiguous flag is the detector: read it together with the consecutive-frame Hamming median, and when that median is 0 the receiver must bind by timestamp instead. Tab B prints both and refuses if it sees that combination.

Source: nanolab/sidecar1.py (envelope, validator, fingerprint, rebind) · docs/SIDECAR1.md (the spec) · nanolab/sidecar.py (the SEI transport) · make_sample.py (how both files were built) · sidecar_demux.js, sidecar_fp.js (the browser side, also runnable in Node).

Spec is the parity lab clip (moving test pattern). Real drive is a 12 s Tesla cabin crop around an overpass — dashboard-forward, road mostly occluded; road.lane is refused when windshield detail is under the Johnson 8 px recognise line. Filmed by the author; no faces.

loading sidecar.mp4 …
frame (display / decode)
–
t –
lum — mean luminance, 0–255
–
pixels measure: –
sharp — Laplacian variance
–
from the stream
changed_blocks — of 880 (16×16) vs previous
–
from the stream
fp — 64-bit frame fingerprint
–
the rebinding key that tab B uses
gate — the only validity signal
–
whole-frame scalars, no target
lum (0–255)changed_blocks (of 880)last 300 frames, playhead at the right edge; touch or hover to read a value

One envelope, as carried

…

The envelope is sidecar/1: f the display index, t seconds, fp the fingerprint, src.res the original sensor frame, and m the measurement rows. Every row names what produced it (by.model, by.kind) and carries a gate whose passed is the only field a consumer may read as a validity signal — not p, which under distribution shift is worse than random. These three rows are cheap scalars over the whole frame (by.kind = "scalar"), so their gate has no pixels-on-target: nothing here is a nano model, and the page does not pretend otherwise. d is stamped by the transport at injection, because only the injector knows decode order.