From cf130de75246a4b301aae415db89f78b67f3251f Mon Sep 17 00:00:00 2001 From: Saxon Date: Wed, 13 Nov 2019 13:38:33 +1030 Subject: [PATCH] revid/config/config.go: need to check frame rate here too as revid needs it --- revid/config/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/revid/config/config.go b/revid/config/config.go index 74d28618..afa0862e 100644 --- a/revid/config/config.go +++ b/revid/config/config.go @@ -79,6 +79,7 @@ const ( defaultCameraIP = "192.168.1.50" defaultBurstPeriod = 10 // Seconds defaultMinFrames = 100 + defaultFrameRate = 25 defaultClipDuration = 0 defaultAudioInputCodec = codecutil.ADPCM @@ -334,6 +335,13 @@ func (c *Config) Validate() error { return errors.New("refresh period is less than 0") } + if c.FrameRate == 0 { + c.Logger.Log(logger.Info, pkg+"no frame rate defined, defaulting", "FrameRate", defaultFrameRate) + c.FrameRate = defaultFrameRate + } else if c.FrameRate < 0 { + return errors.New("frame rate less than 0") + } + if c.ClipDuration == 0 { c.Logger.Log(logger.Info, pkg+"no clip duration defined, defaulting", "ClipDuration", defaultClipDuration) c.ClipDuration = defaultClipDuration