Skip to content

feat: burst-video plugin for edge compute video capture#13

Open
jimmdd wants to merge 4 commits intomainfrom
feature/0956ff75-bee-plugins
Open

feat: burst-video plugin for edge compute video capture#13
jimmdd wants to merge 4 commits intomainfrom
feature/0956ff75-bee-plugins

Conversation

@jimmdd
Copy link
Contributor

@jimmdd jimmdd commented Mar 12, 2026

Summary

  • Adds burst-video plugin that captures and uploads video data when a Bee device drives through active burst geometries (CAP-71)
  • New beeutil.geo module with ray-casting point-in-polygon for burst geometry matching (supports Polygon + MultiPolygon)
  • New beeutil.video module for listing MP4 files from /data/video/ and uploading via ODC cache proxy

How it works

  1. Plugin polls image cache for GPS location (15s loop)
  2. Fetches/caches active burst polygons from beemaps API (5min refresh)
  3. When inside a burst polygon, queues new video files for S3 upload
  4. Threaded upload workers (2 threads) handle uploads asynchronously
  5. Tracks processed videos to prevent duplicate uploads

Test plan

  • Deploy to a Bee device with devtools.py -i src/plugin/burst_video.py
  • Verify burst geometries are fetched from API with valid API key
  • Drive through a burst area and confirm video files are uploaded to S3
  • Verify deduplication: same video files are not re-uploaded
  • Verify burst geometry refresh after 5 minutes

Closes https://linear.app/hivemapper/issue/CAP-71

🤖 Generated with Claude Code

hive-claw and others added 4 commits March 11, 2026 20:45
Add a new plugin that captures and uploads video data when a Bee device
is driving through active burst geometries. The plugin polls the beemaps
API for burst polygons, uses image cache metadata for GPS location, and
uploads matching video files to S3.

New modules:
- beeutil.geo: point-in-polygon utilities for burst geometry matching
- beeutil.video: video file listing and S3 upload via ODC proxy
- plugin.burst_video: main plugin with setup/loop/main pattern

Closes CAP-71

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Check all image handles in batch for burst membership, not just the
  last one, so bursts entered and exited within a single poll window
  are not missed (P1)
- Seed video_checked_at to time.time() during setup so the first loop
  only captures newly recorded videos instead of the entire backlog (P2)
- Add in_flight_videos set to prevent duplicate upload submissions for
  files still being uploaded when the next poll runs (P2)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Only advance video watermark when no uploads are in-flight, so failed
  uploads are retried on subsequent loop iterations instead of being
  silently dropped.
- Filter out bursts whose validFrom is in the future, preventing video
  uploads before scheduled burst windows begin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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