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
Next revision
Previous revision
video [2022/11/29 15:03] – [MJPEG Plugin:] James Sentmanvideo [2023/05/12 14:56] (current) – [Stream Stalled Handler:] added better reboot handling example James Sentman
Line 8: Line 8:
  
 Those plugins can then load camera API plugins to provide an interface to the controls of specific cameras or brands of cameras. This allows you the most flexibility in getting the video into XTension and still having control of the camera features though scripting in XTension. I can add more stream types and more camera API support without having to change any of the existing ones now. Those plugins can then load camera API plugins to provide an interface to the controls of specific cameras or brands of cameras. This allows you the most flexibility in getting the video into XTension and still having control of the camera features though scripting in XTension. I can add more stream types and more camera API support without having to change any of the existing ones now.
 +
 +**Note:** the new video system requires a more recent OS version than is required by the program overall. You must be running at least MacOS 10.15 Catalina in order to use these plugins.
  
 ----- -----
Line 37: Line 39:
 =====Options Shared By All Plugins===== =====Options Shared By All Plugins=====
 There are several settings that are the same for all the video plugins. Those will be documented here with everything else being discussed on the specific wiki pages for the plugins. There are several settings that are the same for all the video plugins. Those will be documented here with everything else being discussed on the specific wiki pages for the plugins.
 +
 +====Stream Name:====
 +In most cases you would want the name of the plugin instance in the Interface List window to be the same as the name of the stream. This is also the name you would use when sending script commands to the camera and see in all the popups or lists of available video sources. If you wish to have a different name for the video stream than you do for the plugin instance you can enter a different name in this field and then that will be used in all the video lists and user interface elements. You must still use the regular plugin name when sending scripting commands to the plugin instance.
  
 ====Recording FPS:==== ====Recording FPS:====
Line 78: Line 83:
 Most computers now days use SSD drives which are wonderfully fast but do not last forever under heavy use. Recording video all the time uses a lot of disk sectors over and over again slowly reducing their lifespan faster than they would normally. I would recommend that video recording be done to external drives, preferably of the spinning platter type, or at least SSDs that are not internal to the Mac and therefore irreplaceable. Since the plugin instances each have their own recording directory you could easily place each video camera on a separate external drive if you wished. I would not recommend recording video to the internal drive of a modern Mac. Most computers now days use SSD drives which are wonderfully fast but do not last forever under heavy use. Recording video all the time uses a lot of disk sectors over and over again slowly reducing their lifespan faster than they would normally. I would recommend that video recording be done to external drives, preferably of the spinning platter type, or at least SSDs that are not internal to the Mac and therefore irreplaceable. Since the plugin instances each have their own recording directory you could easily place each video camera on a separate external drive if you wished. I would not recommend recording video to the internal drive of a modern Mac.
  
 +-----
 +=====Script Handlers:=====
 +====Stream Stalled Handler:====
 +All Camera types implement a script handler that is called when the stream stalls. It is passed a count of the attempts to recover since it went down. This way  you can ignore a single stall that is recovered by closing and opening the connection again but can take other measures to recover if the camera does not recover on the first try. 
 +
 +Use the “Insert...” toolbar item on the Edit Interface Script window to insert the template for the event.
 +<code>
 +(* S T R E A M   S T A L L E D
 +
 + This handler is called when a camera stops sending frames. StallCount is passed that is the count
 + of stalls in a row. This way you can tell if a camera is not recovering and take other action like
 + rebooting or power cycling it if needed. The count will increase until the interface is restarted or
 + 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)
 + write log "Attempted to restore camera " & stallCount & " times.” color red
 +        
 +        if stallCount ≠ 0 and stallCount mod 15 = 0 then
 +            write log “Attempting to restart camera due to extended outage” color red
 +            reboot()
 +        end if
 +
 +end streamStalled
 +
 +</code>
  
 ----- -----
video.1669734188.txt.gz · Last modified: 2023/02/13 14:51 (external edit)