Skip to content

vid9p: a .y4m file replayed as a live feed (-r, ctl replay) - #1132

Open
pdfinn wants to merge 4 commits into
masterfrom
feat/vid9p-replay
Open

pdfinn wants to merge 4 commits into
masterfrom
feat/vid9p-replay

Conversation

@pdfinn

@pdfinn pdfinn commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

A feed with no camera behind it was either a static clip (complete at once, eof=1, which vision(4) looks at whole and then ends) or a host decoder spawned through os, which a bare-metal board does not have. Neither stands in for a camera on a board without one.

vid9p -r file.y4m, or replay file.y4m written to ctl, copies the file into the live path as one endless stream: the header once, each frame when it is due at the header's rate, the first again after the last. The feeder, ring, -w window and follow take it from there, so readers see a live feed: streaming, eof=0, frames gained in time and numbered on past the file's end, the oldest expiring. All Limbo, so it runs on bare metal.

For the vision demo: a Pi 5 with no camera serves a CC0 street clip at /mnt/video/0 exactly as camsrv would, and the Orin's visionfs follows it live.

Tests:

  • tests/host/vid9p_replay_test.sh (new, in CI's vid9p job): fmt; live (streaming, eof=0); 21 frames after 2 s at 10 fps; frames 0, 8, 13 byte-identical to the file's 0, 0, 5. Passes on macOS arm64.
  • Checked by hand with a 640x360 10 fps clip of 240 frames: 50 frames every 5 s, past 240 without a break, first= sliding with -w 10.

Also: a frame read past a live feed's window is now refused as frame expired, as camsrv refuses it and as every reader (wm/camera, vision(4), vidplay9p, Matrix's video pane) matches it to skip to the newest frame. vid9p added (retention window), so on its live feeds a reader that fell behind stopped instead (wm/camera: "no camera: camera: frame expired (retention window)"). The replay test checks the words.

A feed with no camera behind it had two forms: a static clip, complete
from the start (eof=1), which vision(4) looks at whole and then ends,
and a host decoder spawned through os, which a bare-metal board does
not have.  Neither stands in for a camera on a board without one.

-r file.y4m (or "replay file.y4m" written to ctl) copies the file into
the live path as one endless stream: the header once, then each frame
when it is due at the header's rate, the first again after the last.
The feeder, the ring, -w's window and follow take it from there, so
the feed is a live one in every way a reader can tell: streaming,
eof=0, frames gained in time and numbered on past the file's end, the
oldest expiring.  All Limbo, so it runs on bare metal.

tests/host/vid9p_replay_test.sh replays an 8-frame clip and checks fmt,
that the feed is live, about 20 frames after 2 s at 10 a second, and
frames 0, 8 and 13 byte for byte against the file's 0, 0 and 5.  It
runs in CI's vid9p job.
A frame read below a live feed's window was refused as "frame expired
(retention window)".  camsrv refuses it as "frame expired", vid9p's own
comments say so, and every reader matches those words exactly to go on
from the newest frame: wm/camera, vision(4)'s follower, vidplay9p and
Matrix's video pane.  On vid9p's live feeds a reader that fell behind
stopped instead: wm/camera showed "no camera: camera: frame expired
(retention window)" a minute into following a replayed feed mounted
from a Pi.

tests/host/vid9p_replay_test.sh reads a frame past a one-second window
and checks the words.
It was written before 0.10.0 was cut and sat in that section; #1152
puts it under [Unreleased] with the others'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant