User Tools

Site Tools


video

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
video [2023/02/13 14:52] – external edit 127.0.0.1video [2023/05/12 14:56] (current) – [Stream Stalled Handler:] added better reboot handling example James Sentman
Line 96: Line 96:
  rebooting or power cycling it if needed. The count will increase until the interface is restarted or  rebooting or power cycling it if needed. The count will increase until the interface is restarted or
  the camera starts responding again.  the camera starts responding again.
 +
 +        By checking for a mod 15 you will attempt to restart the camera only every 15 times it tries to restore
 +        and so will not just keep rebooting it every 10 seconds and potentially never let it actually come 
 +        back up again. 
 +        
 +        The “reboot()” command comes from the Camera API for Amcrest Cameras, but others have similar commands.
 +
 *) *)
  
 on streamStalled( stallCount) on streamStalled( stallCount)
- write log "Attempted to restore camera " & stallCount & " times.” + write log "Attempted to restore camera " & stallCount & " times.” color red 
-        if (stallCount as number) > 4 then +         
-            write log “running a failed camera restart" +        if stallCount ≠ 0 and stallCount mod 15 = 0 then 
-            -- send it a reboot, power cycle or whatever to bring it back online +            write log “Attempting to restart camera due to extended outage” color red 
 +            reboot()
         end if         end if
 +
 end streamStalled end streamStalled
  
video.txt · Last modified: 2023/05/12 14:56 by James Sentman