# video-setup A graph-based multi-peer video routing system written in C11. Nodes are media processes connected by typed transport edges; the graph carries video streams between sources, relays, and sinks with **priority** as a first-class property — so a low-latency monitoring feed and a high-quality archival feed can coexist on the same source. Designed to run on resource-constrained hardware (Raspberry Pi capturing raw MJPEG, forwarding over TCP) alongside more capable machines that handle processing, relay, display, and archival. ## Documentation - [architecture.md](architecture.md) — system design: graph model, transport protocol, relay design, codec layer, discovery, multi-site plan, device resilience, X11 integration - [docs/protocol.md](docs/protocol.md) — wire protocol reference: frame format, all message types, payload schemas, stream lifecycle, discovery - [planning.md](planning.md) — module build order and current status - [conventions.md](conventions.md) — C code and project conventions ### CLI Tools - [docs/cli/media_ctrl_cli.md](docs/cli/media_ctrl_cli.md) — media device and topology tool - [docs/cli/v4l2_ctrl_cli.md](docs/cli/v4l2_ctrl_cli.md) — V4L2 camera control tool ## Structure ``` src/modules/ C modules, one directory each include/ public headers dev/cli/ CLI driver programs for each module dev/web/ development web UI (Node.js/Express) — connects to live nodes for V4L2 inspection and control docs/ documentation ``` ## Status Core modules and the video node binary are working. The node can be queried over the wire protocol for device enumeration and V4L2 camera control. The development web UI connects to live nodes for inspection and control. Frame capture and relay have not started. | Module | Status | Notes | |---|---|---| | `common` | done | Error types, base definitions | | `config` | done | INI file loader, schema-driven defaults, typed getters | | `media_ctrl` | done | Media Controller topology, pad format config | | `v4l2_ctrl` | done | V4L2 control enumeration, get/set | | `serial` | done | Little-endian binary serialization primitives | | `transport` | done | Framed TCP stream, single-write send | | `discovery` | done | UDP multicast announcements, peer table, found/lost callbacks | | `protocol` | done | Typed write/read functions for all message types | | `node` | done | Video node binary — config, discovery, transport server, V4L2/media request handlers | | `dev/web` | done | Development web UI — connects to live nodes, V4L2 inspection and control | | `frame_alloc` | not started | Per-frame allocation with byte budget and ref counting | | `relay` | not started | Input dispatch to output queues (low-latency and completeness modes) | | `ingest` | not started | V4L2 capture loop — dequeue buffers, emit frames | | `archive` | not started | Write frames to disk, control messages to binary log | | `codec` | not started | Per-frame encode/decode (MJPEG, QOI, ZSTD-raw, VA-API H.264) | | `xorg` | not started | X11 geometry (XRandR), screen grab source, frame viewer sink | | `web node` | not started | Node.js peer — binary protocol socket side + HTTP/WebSocket to browser |