Robotics · Systems
Concurrent Camera Streaming Service
A versioned camera API with fresh-frame reads, streaming JPEGs, health checks, and one shared latest-frame cache per camera.
Shared camera worker
GetFrameGetStreamCheckHealthThe problem
Multiple clients need live camera frames without opening the same device repeatedly or building an ever-growing queue. A fresh read also needs a precise definition.
Implementation
One worker owns each camera and publishes immutable JPEGs into a shared slot. A fresh request snapshots the capture sequence at server acceptance and waits for a later capture. Slow streaming clients skip frames. Request IDs, capture timestamps, and monotonic durations make latency and failures inspectable.
Evidence
The included tests use injected cameras and real loopback gRPC to exercise concurrent requests, captures awaiting encoding, stale frames, recovery, cancellation, deadlines, and decoding. The protocol and runnable server/client are included.
Limits
Capture time means completion of the software camera read. Sensor exposure and device buffering require hardware validation. The default service is local and uses an insecure loopback channel. Remote use requires authentication and TLS.