Standbild
This commit is contained in:
@@ -54,8 +54,9 @@ function createSnapshotRouter(switches, cameras) {
|
||||
const sw = switches[req.params.id];
|
||||
if (!sw) return res.status(404).json({ error: `Unbekannte Kamera: ${req.params.id}` });
|
||||
try {
|
||||
// getFrame() startet die Kamera bei Bedarf on-demand und wartet auf ein frisches Bild
|
||||
const frame = await sw.getFrame();
|
||||
// grabSnapshot(): liefert das Live-Frame falls vorhanden, sonst (Snapshot-Modus,
|
||||
// stream:false) ein one-shot Bild – öffnet das Gerät kurz und schliesst es wieder.
|
||||
const frame = await sw.grabSnapshot();
|
||||
res.set({
|
||||
'Content-Type': 'image/jpeg',
|
||||
'Content-Length': frame.length,
|
||||
|
||||
Reference in New Issue
Block a user