Documentation
¶
Index ¶
- Constants
- type Alert
- type AlertConfig
- type AlertTimes
- type Config
- type Map
- type Monitor
- func (m *Monitor) GetAlertTimes() (result AlertTimes)
- func (m *Monitor) GetReaderInStats() *videosource.VideoStats
- func (m *Monitor) GetReaderOutStats() *videosource.VideoStats
- func (m *Monitor) SetAlert(notifier *notify.Notify, notifyRxConf *notify.RxConfig, saveDirectory string, ...)
- func (m *Monitor) SetFace(config *face.Config)
- func (m *Monitor) SetMotion(config *motion.Config)
- func (m *Monitor) SetRecord(saveDirectory string, recordConf *RecordConfig)
- func (m *Monitor) SetStaleConfig(timeout int, maxRetry int)
- func (m *Monitor) SetTensor(config *tensor.Config)
- func (m *Monitor) Start()
- func (m *Monitor) Stop()
- func (m *Monitor) Subscribe(key string) <-chan videosource.ProcessedImage
- func (m *Monitor) Unsubscribe(key string)
- func (m *Monitor) Wait()
- type Record
- type RecordConfig
Constants ¶
const ( MaxTextFileSize = 300000 // 300 KB NewLine = "<br>" )
Alert Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { LastAlert AlertTimes // contains filtered or unexported fields }
Alert buffers ProcessedImages and sends notifications
func NewAlert ¶
func NewAlert(name string, notifier *notify.Notify, notifyRxConf *notify.RxConfig, saveDirectory string, alertConf *AlertConfig) *Alert
NewAlert creates a new Alert
func (*Alert) Push ¶
func (a *Alert) Push(img videosource.ProcessedImage)
Push a processed image to buffer
type AlertConfig ¶
type AlertConfig struct { IntervalMinutes int `yaml:"intervalMinutes,omitempty"` MaxImagesPerInterval int `yaml:"maxImagesPerInterval,omitempty"` MaxSendAttachmentsPerHour int `yaml:"maxSendAttachmentsPerHour,omitempty"` SaveQuality int `yaml:"saveQuality,omitempty"` SaveOriginal bool `yaml:"saveOriginal,omitempty"` SaveHighlighted bool `yaml:"saveHighlighted,omitempty"` SaveObjectsCount int `yaml:"saveObjectsCount,omitempty"` SaveFacesCount int `yaml:"saveFacesCount,omitempty"` TextAttachments bool `yaml:"textAttachments,omitempty"` DeleteAfterHours int `yaml:"deleteAfterHours,omitempty"` DeleteAfterGB int `yaml:"deleteAfterGB,omitempty"` }
AlertConfig contains the parameters for alert notification settings
func NewAlertConfig ¶
func NewAlertConfig(configPath string) *AlertConfig
NewAlertConfig creates a new AlertConfig
type AlertTimes ¶
AlertTimes for alerts
type Config ¶
type Config struct { Filename string `yaml:"filename,omitempty"` URL string `yaml:"url,omitempty"` MaxSourceFps int `yaml:"maxSourceFps,omitempty"` MaxOutputFps int `yaml:"maxOutputFps,omitempty"` Quality int `yaml:"quality,omitempty"` StaleTimeout int `yaml:"staleTimeout,omitempty"` StaleMaxRetry int `yaml:"staleMaxRetry,omitempty"` MotionFilename string `yaml:"motion,omitempty"` TensorFilename string `yaml:"tensor,omitempty"` CaffeFilename string `yaml:"caffe,omitempty"` FaceFilename string `yaml:"face,omitempty"` NotifyRxFilename string `yaml:"notifyRx,omitempty"` AlertFilename string `yaml:"alert,omitempty"` RecordFilename string `yaml:"record,omitempty"` }
Config contains the parameters for Monitor
type Monitor ¶
type Monitor struct { Name string ConfigPaths []string StaleRetry int StaleMaxRetry int IsStale bool // contains filtered or unexported fields }
Monitor contains the video source
func NewMonitor ¶
func NewMonitor(name string, reader *videosource.VideoReader) *Monitor
NewMonitor creates a new Monitor
func (*Monitor) GetAlertTimes ¶
func (m *Monitor) GetAlertTimes() (result AlertTimes)
GetAlertTimes returns the alert times
func (*Monitor) GetReaderInStats ¶
func (m *Monitor) GetReaderInStats() *videosource.VideoStats
GetReaderInStats returns the reader source stats
func (*Monitor) GetReaderOutStats ¶
func (m *Monitor) GetReaderOutStats() *videosource.VideoStats
GetReaderOutStats returns the reader output stats
func (*Monitor) SetAlert ¶
func (m *Monitor) SetAlert(notifier *notify.Notify, notifyRxConf *notify.RxConfig, saveDirectory string, alertConf *AlertConfig)
SetAlert sets the alert notification
func (*Monitor) SetRecord ¶
func (m *Monitor) SetRecord(saveDirectory string, recordConf *RecordConfig)
SetRecord sets the recorder
func (*Monitor) SetStaleConfig ¶
SetStaleConfig sets the stale configuration
func (*Monitor) Subscribe ¶
func (m *Monitor) Subscribe(key string) <-chan videosource.ProcessedImage
Subscribe to video images
type Record ¶
type Record struct { RecordConf *RecordConfig // contains filtered or unexported fields }
Record buffers ProcessedImages and writes to disk
func NewRecord ¶
func NewRecord(name string, saveDirectory string, recordConf *RecordConfig, outFps int) *Record
NewRecord creates a new Record
func (*Record) Close ¶
func (r *Record) Close()
Close notified by caller that input stream is done/closed
func (*Record) Send ¶
func (r *Record) Send(img videosource.ProcessedImage)
Send a processed image to buffer
type RecordConfig ¶
type RecordConfig struct { RecordObjects bool `yaml:"recordObjects,omitempty"` MaxPreSec int `yaml:"maxPreSec,omitempty"` TimeoutSec int `yaml:"timeoutSec,omitempty"` MaxSec int `yaml:"maxSec,omitempty"` DeleteAfterHours int `yaml:"deleteAfterHours,omitempty"` DeleteAfterGB int `yaml:"deleteAfterGB,omitempty"` }
RecordConfig contains the parameters for record settings
func NewRecordConfig ¶
func NewRecordConfig(configPath string) *RecordConfig
NewRecordConfig creates a new RecordConfig