Documentation
¶
Index ¶
- Constants
- type Alert
- type AlertConfig
- type AlertTimes
- type Config
- type Continuous
- type ContinuousConfig
- type Map
- type Monitor
- func (m *Monitor) GetAlertTimes() (result AlertTimes)
- func (m *Monitor) GetMonitorFrameStats(timeoutMs int) (result *videosource.FrameStatsCombo)
- func (m *Monitor) SetAlert(notifier *notify.Notify, notifyRxConf *notify.RxConfig, saveDirectory string, ...)
- func (m *Monitor) SetBufferSeconds(sec int)
- func (m *Monitor) SetContinuous(saveDirectory string, continuousConf *ContinuousConfig)
- 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(bufferSize int) (result *pubsubmutex.Subscriber[*videosource.ProcessedImage])
- 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"`
BufferSeconds int `yaml:"bufferSeconds,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"`
ContinuousFilename string `yaml:"continuous,omitempty"`
}
Config contains the parameters for Monitor
type Continuous ¶ added in v1.18.0
type Continuous struct {
ContinuousConf *ContinuousConfig
// contains filtered or unexported fields
}
Continuous buffers ProcessedImages and writes to disk
func NewContinuous ¶ added in v1.18.0
func NewContinuous(name string, saveDirectory string, continuousConf *ContinuousConfig, outFps int) *Continuous
NewContinuous creates a new Continuous
func (*Continuous) Close ¶ added in v1.18.0
func (c *Continuous) Close()
Close notified by caller that input stream is done/closed
func (*Continuous) Send ¶ added in v1.18.0
func (c *Continuous) Send(img *videosource.ProcessedImage)
Send a processed image to buffer
type ContinuousConfig ¶ added in v1.18.0
type ContinuousConfig struct {
TimeoutSec int `yaml:"timeoutSec,omitempty"`
MaxSec int `yaml:"maxSec,omitempty"`
DeleteAfterHours int `yaml:"deleteAfterHours,omitempty"`
DeleteAfterGB int `yaml:"deleteAfterGB,omitempty"`
Codec string `yaml:"codec,omitempty"`
FileType string `yaml:"fileType,omitempty"`
BufferSeconds int `yaml:"bufferSeconds,omitempty"`
PortableOnly bool `yaml:"portableOnly,omitempty"`
}
ContinuousConfig contains the parameters for record settings
func NewContinuousConfig ¶ added in v1.18.0
func NewContinuousConfig(configPath string) *ContinuousConfig
NewContinuousConfig creates a new ContinuousConfig
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) GetMonitorFrameStats ¶ added in v1.26.0
func (m *Monitor) GetMonitorFrameStats(timeoutMs int) (result *videosource.FrameStatsCombo)
GetMonitorFrameStats returns the monitor's frame 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) SetBufferSeconds ¶ added in v1.22.0
func (*Monitor) SetContinuous ¶ added in v1.18.0
func (m *Monitor) SetContinuous(saveDirectory string, continuousConf *ContinuousConfig)
SetContinuous sets the continuous recording
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(bufferSize int) (result *pubsubmutex.Subscriber[*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"`
Codec string `yaml:"codec,omitempty"`
FileType string `yaml:"fileType,omitempty"`
BufferSeconds int `yaml:"bufferSeconds,omitempty"`
PortableOnly bool `yaml:"portableOnly,omitempty"`
}
RecordConfig contains the parameters for record settings
func NewRecordConfig ¶
func NewRecordConfig(configPath string) *RecordConfig
NewRecordConfig creates a new RecordConfig