diff options
| author | Luke Hoersten <[email protected]> | 2026-06-15 08:10:49 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-06-15 08:10:49 -0500 |
| commit | fc15eccfb6bb891f63b0ad37f14850464b0d90a6 (patch) | |
| tree | dfcc5e846b1b1d40bcc21aba562967466fd2c80c /main/CMakeLists.txt | |
| parent | 93c5194756e501bede25c9c9f67c40e1a114e5ae (diff) | |
scrypted: auto-restart ffmpeg if it exits while the stream timer is alive
Cameras occasionally drop their H.264 stream mid-event — RTSP source
rotation, brief network glitch, etc. ffmpeg exits clean and the script
previously logged the exit and stopped feeding /frame, leaving the
panel stuck on the last successful frame until the next camera event
fired a fresh startStream.
Restructure the spawn into a closure-captured spawnFfmpeg() that the
on('close') handler can call again. Rolling restart cap of 5 per 60 s
prevents tight loops if the source is genuinely down.
On clean exit during an active stream: log + setTimeout(spawnFfmpeg, 250).
On too-many restarts: log a warning, stopStream, wait for the next
camera event.
The streams map no longer stores the ffmpeg proc (it changes across
restarts); abort.signal kills whatever's current via its listener.
Diffstat (limited to 'main/CMakeLists.txt')
0 files changed, 0 insertions, 0 deletions
