Multicam (b) yaml

This commit is contained in:
chk
2026-06-06 08:17:43 +02:00
parent 7baec1ab37
commit 81bebc0158
2 changed files with 15 additions and 9 deletions

View File

@@ -47,17 +47,19 @@ services:
volumes: volumes:
- ${APP_PATH:-.}:/usr/src/app - ${APP_PATH:-.}:/usr/src/app
devices: devices:
- /dev/video0:/dev/video0 # Jede Kamera aus cameras.json muss hier aufgeführt sein.
- /dev/video2:/dev/video2 # Empfehlung: statt /dev/videoN → persistente by-id-Pfade verwenden
- /dev/video2:/dev/video2 # (ls -la /dev/v4l/by-id/ auf dem Server zeigt die Namen)
- /dev/video0:/dev/video0 # C270 (046d:0825) → cam0 in cameras.json
- /dev/video2:/dev/video2 # C270 (046d:081b) → cam1 in cameras.json
- /dev/video4:/dev/video4 # C920 HD Pro → cam2 in cameras.json
group_add: group_add:
- video - video
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=8444 - PORT=8444
# Optional: Geräte/Auflösung überschreiben (sonst Auto-Detect + Defaults) # Kamera-Konfiguration (Gerät, Name, Auflösung) → cameras.json im APP_PATH
# - DEV0=/dev/video0 # Globale Fallback-Werte (gelten wenn cameras.json keinen Wert hat):
# - DEV1=/dev/video2
# - LIVE_SIZE=640x480 # - LIVE_SIZE=640x480
# - LIVE_FPS=30 # - LIVE_FPS=30
# - HIRES_SIZE=1280x960 # - HIRES_SIZE=1280x960

View File

@@ -34,11 +34,15 @@ for (const cam of camsConfig) {
if (!cam.id || !cam.device) { if (!cam.id || !cam.device) {
console.error(`cameras.json: Eintrag ohne id/device: ${JSON.stringify(cam)}`); process.exit(1); console.error(`cameras.json: Eintrag ohne id/device: ${JSON.stringify(cam)}`); process.exit(1);
} }
// Per-Kamera-Felder in cameras.json überschreiben die globalen Env-Werte
switches[cam.id] = new CameraSwitch({ switches[cam.id] = new CameraSwitch({
id: cam.id, device: cam.device, id: cam.id, device: cam.device,
liveSize: LIVE_SIZE, liveFps: LIVE_FPS, liveSize: cam.liveSize ?? LIVE_SIZE,
hiresSize: HIRES_SIZE, hiresFps: HIRES_FPS, liveFps: cam.liveFps ?? LIVE_FPS,
encode: ENCODE_MODE, onDemand: ON_DEMAND, idleGraceMs: IDLE_GRACE_MS, hiresSize: cam.hiresSize ?? HIRES_SIZE,
hiresFps: cam.hiresFps ?? HIRES_FPS,
encode: cam.encode ?? ENCODE_MODE,
onDemand: ON_DEMAND, idleGraceMs: IDLE_GRACE_MS,
}); });
camsMeta.push({ camsMeta.push({
id: cam.id, id: cam.id,