mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 08:25:54 +02:00
[PR #453] [CLOSED] WIP - feat(camera): Printer Page - Print farm camera grid #1051
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy-maziggy-1#1051
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/maziggy/bambuddy/pull/453
Author: @aneopsy
Created: 2/19/2026
Status: ❌ Closed
Base:
0.2.1← Head:printers-camera-grid📝 Commits (5)
182020dfeat(camera): shared stream hub, canvas grid viewer, multiplexed streaming, and bandwidth optimizationbd5e56afeat(camera): add pause, resume, and stop controls to camera cardsEnhances camera grid with print controlsf252bcbfeat(camera-grid): worker decoding, IntersectionObserver, reconnect, quality switching, and UX improvements2c5447afeat(camera-grid): HMS error notifications, ETA tooltip, control loading states, and backend hardening8ed9b2f.📊 Changes
24 files changed (+10565 additions, -8985 deletions)
View changed files
📝
.gitignore(+2 -0)📝
.pre-commit-config.yaml(+1 -1)📝
backend/app/api/routes/camera.py(+708 -219)📝
backend/app/main.py(+13 -2)📝
backend/app/services/camera.py(+28 -4)📝
backend/app/services/external_camera.py(+57 -51)📝
frontend/src/components/Card.tsx(+4 -2)📝
frontend/src/components/EmbeddedCameraViewer.tsx(+1 -1)📝
frontend/src/components/HMSErrorModal.tsx(+14 -0)📝
frontend/src/i18n/locales/de.ts(+17 -0)📝
frontend/src/i18n/locales/en.ts(+17 -0)📝
frontend/src/i18n/locales/fr.ts(+17 -0)📝
frontend/src/i18n/locales/it.ts(+17 -0)📝
frontend/src/i18n/locales/ja.ts(+17 -0)📝
frontend/src/i18n/locales/pt-BR.ts(+17 -0)📝
frontend/src/index.css(+5 -0)📝
frontend/src/pages/PrintersPage.tsx(+871 -16)➕
frontend/src/workers/cameraGridDecoder.worker.ts(+69 -0)➕
static/assets/cameraGridDecoder.worker-JysGdQBP.js(+1 -0)➕
static/assets/index-Cmk7uc2U.css(+1 -0)...and 4 more files
📄 Description
Description
Print farm dashboard with real-time CCTV-style camera grid:
The multiplexed stream sends all camera feeds over a single HTTP connection using binary framing ([4B printer_id][4B length][jpeg_data]). This solves the browser's 6-connection-per-origin limit — previously, opening 7+ cameras would saturate all connections and freeze the UI (no API calls, no WebSocket updates). Now 20 cameras use 1 connection, leaving 5 free for the rest of the app. (8 cameras on the grid, medium quality (5fps) use 1 mb/s bandwidth)
Canvas renders frames via createImageBitmap() (off-main-thread JPEG decode) with cached 2D contexts and dimension tracking, no per-frame React re-renders, no blob URLs, and bitmap.close() frees GPU memory immediately, material optimisation.
Changes
Backend - SharedStreamHub rewrite:
ref counts, async generator lifecycle bugs, and lock contention
Backend - Stream quality/bandwidth controls:
Backend - Multiplexed grid-stream endpoint:
Frontend - CameraGridCard canvas renderer:
(img.src='' does NOT close MJPEG connections, saturating browser 6-conn limit)
Frontend - Enhanced camera grid cards:
Frontend - EmbeddedCameraViewer:
Frontend - Misc cleanup:
Related Issue
Fixes #451
Type of Change
Screenshots
Frontend:
Backend optimisation - CPU usage for camera stream:
Before:

After:

Testing
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.