Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

The relay serves /camera/<id>/video from ARM_H264_<n> sources, flags h264 in /cameras, and allows the Pi's H.264 ports in egress #267

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

The relay now serves WS /camera/ /video from ARMH264 , reports h264 per camera in GET /cameras, and has the Pi's H.264 ports in egress. The type check is clean and 35 tests pass across relay-video, video-feed, cameras and relay. I did not run the whole bun --cwd Software/so101 test suite here; the forge's check will.

Notes

shipped merged

opened this

The relay now serves WS /camera/<id>/video from ARM_H264_<n>, reports h264 per camera in GET /cameras, and has the Pi's H.264 ports in egress. The type check is clean and 35 tests pass across relay-video, video-feed, cameras and relay. I did not run the whole bun --cwd Software/so101 test suite here; the forge's check will.

  • Source: I took the relay and video-feed code from pull #207's branch, not the whole branch. src/video-fanout.ts and src/h264.ts are already on main (#264), so I left them. I also left out #207's player UI, which is outside this issue.
  • src/relay.ts: parseVideo reads ARM_H264_1 and ARM_H264_2 (720p=url,480p=url,…) and throws on an unknown rung or a non-http(s) URL. The video socket is same-origin only, and a camera with no source gets 404. Guests get frames; the driver gets the best rendition.
  • src/video-feed.ts: it fetches each rendition through proxyFor, so the fetches go through egress.
  • bench/fake-serve.ts: it calls parseVideo. A bad value logs a message and leaves the cameras on MJPEG, so the app still starts.
  • Egress: forge.json adds 100.89.95.68:8082, :8083 and :8084.
  • README: it documents the variable, the ladder and the egress ports. I corrected the port list from #207's wording, which left out 8081.
  • Test change: cameras.test.ts expected the old /cameras shape, so I updated it for the new h264 flag.
  • Stale copies: #207's branch is behind main, so I did not copy its forge.json or README wholesale. Doing so would have undone the moderator, mute and moderation-log docs and the --network-concurrency install flag. I added only the H.264 parts to main's versions.

🤖 Generated with Claude Code

Closes #259

commented

The relay now serves WS /camera/<id>/video from ARM_H264_<n>, reports h264 per camera in GET /cameras, and has the Pi's H.264 ports in egress. The type check is clean and 35 tests pass across relay-video, video-feed, cameras and relay. I did not run the whole bun --cwd Software/so101 test suite here; the forge's check will.

  • Source: I took the relay and video-feed code from pull #207's branch, not the whole branch. src/video-fanout.ts and src/h264.ts are already on main (#264), so I left them. I also left out #207's player UI, which is outside this issue.
  • src/relay.ts: parseVideo reads ARM_H264_1 and ARM_H264_2 (720p=url,480p=url,…) and throws on an unknown rung or a non-http(s) URL. The video socket is same-origin only, and a camera with no source gets 404. Guests get frames; the driver gets the best rendition.
  • src/video-feed.ts: it fetches each rendition through proxyFor, so the fetches go through egress.
  • bench/fake-serve.ts: it calls parseVideo. A bad value logs a message and leaves the cameras on MJPEG, so the app still starts.
  • Egress: forge.json adds 100.89.95.68:8082, :8083 and :8084.
  • README: it documents the variable, the ladder and the egress ports. I corrected the port list from #207's wording, which left out 8081.
  • Test change: cameras.test.ts expected the old /cameras shape, so I updated it for the new h264 flag.
  • Stale copies: #207's branch is behind main, so I did not copy its forge.json or README wholesale. Doing so would have undone the moderator, mute and moderation-log docs and the --network-concurrency install flag. I added only the H.264 parts to main's versions.

🤖 Generated with Claude Code

Approved

Does what #267 asks: /camera/<id>/video is same-origin only, 404 without a source, open to guests like /stream, and only the configured rungs are offered. /cameras reports h264, egress has the Pi ports, parseVideo is validated and tested, README is updated, and the preview answers with the new h264 field. Two things next: (1) in src/relay.ts the video socket is handed to the shared wss, whose maxPayload is MAX_FRAME_BYTES, so a viewer can send a large message before video-fanout drops anything over 200 bytes; give video viewers their own small maxPayload. (2) Add a smoke check so a down source shows as the MJPEG fallback in the preview.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs