Skip to content

Add camera-manager service and Video-page camera selection#98

Draft
dakejahl wants to merge 1 commit into
mainfrom
claude/rtsp-usb-camera-support-cm1d2o
Draft

Add camera-manager service and Video-page camera selection#98
dakejahl wants to merge 1 commit into
mainfrom
claude/rtsp-usb-camera-support-cm1d2o

Conversation

@dakejahl

Copy link
Copy Markdown
Contributor

Summary

Lets you pick which camera the RTSP server streams from the web UI, the companion to USB-camera support in ARK-Electronics/rtsp-server#13.

Following the existing *-manager pattern (each service exposes its own API + page; the TOML config is persistence, not a data channel), this adds a dedicated camera API and a picker on the Video page.

camera-manager service

A new FastAPI microservice (port 3005, proxied at /api/camera):

  • GET /cameras — enumerates connected V4L2 capture devices via VIDIOC_QUERYCAP, classifying CSI vs USB the same way the rtsp-server does (UVC metadata-only nodes filtered out), and flags the one currently being streamed.
  • POST /select — writes [camera].device into rtsp-server.toml and restarts rtsp-server.service (uses the existing service-user polkit grant, which already lists rtsp-server.service).

Video page

A camera dropdown that appears only when more than one camera is connected. It lists each camera (CSI/USB + device path), switches the active source through the API, and reconnects the WebRTC stream once the server restarts. If the camera-manager is unreachable, the picker stays hidden and playback is unaffected.

Wiring

  • assemble_tree.sh (python services list), postinst (enable list), ark-ui-backend (proxy + health), mypy.ini (contract set).
  • jetson + pi systemd units; visible:false manifest (no Services-page tile / config editor).
  • Seeds device = "" in the packaged rtsp-server.toml.
  • Bumps the rtsp-server submodule to the commit adding the matching USB pipeline. Note: once both PRs merge, the submodule should be re-pointed at the merged rtsp-server commit.

Testing

  • mypy passes across all 5 contract services (including the new one); node --check passes on the changed JS.
  • The Vue SFC was reviewed by hand (frontend deps aren't installed in the build env). No camera hardware was available for a live end-to-end test.

🤖 Generated with Claude Code


Generated by Claude Code

Adds a camera-manager FastAPI microservice (port 3005, proxied at /api/camera)
that enumerates connected V4L2 capture devices — classifying CSI vs USB the
same way the rtsp-server does — and selects which one the RTSP server streams
by writing [camera].device into rtsp-server.toml and restarting the unit.

The Video page gains a camera picker (shown only when more than one camera is
connected) that lists detected cameras and switches the active source via the
new API, then reconnects the WebRTC stream once the server restarts.

Wires the service through assemble_tree.sh, the postinst enable list, the
ark-ui-backend proxy, and the mypy contract set; seeds device = "" in the
packaged rtsp-server.toml. Bumps the rtsp-server submodule to the commit that
adds the matching USB-camera pipeline support.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EQxVPD2yiCqSQd8KeZsZfv
@dakejahl
dakejahl marked this pull request as draft July 15, 2026 21:12
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.

2 participants