Merged in less-frames-fix (pull request #345)

Less frames fix

Approved-by: Saxon Milton <saxon.milton@gmail.com>
This commit is contained in:
Scott Barnard 2020-01-23 02:07:34 +00:00 committed by Saxon Milton
commit 65bc98efbf
1 changed files with 3 additions and 21 deletions

View File

@ -63,24 +63,6 @@ const (
rtmpConnectionTimeout = 10
)
// Motion filter parameters.
const minFPS = 1.0
// KNN specific parameters.
const (
knnMinArea = 25.0
knnThreshold = 300
knnHistory = 300
knnKernel = 9
)
// MOG specific parameters.
const (
mogMinArea = 50
mogThreshold = 100
mogHistory = 100
)
const pkg = "revid: "
type Logger interface {
@ -355,11 +337,11 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io.
case config.FilterNoOp:
r.filters[i] = filter.NewNoOp(dst)
case config.FilterMOG:
r.filters[i] = filter.NewMOGFilter(dst, mogMinArea, mogThreshold, mogHistory, r.cfg.ShowWindows, r.cfg.MotionInterval)
r.filters[i] = filter.NewMOGFilter(dst, r.cfg.MOGMinArea, r.cfg.MOGThreshold, int(r.cfg.MOGHistory), r.cfg.ShowWindows, r.cfg.MotionInterval)
case config.FilterVariableFPS:
r.filters[i] = filter.NewVariableFPSFilter(dst, minFPS, filter.NewMOGFilter(r.encoders, mogMinArea, mogThreshold, mogHistory, r.cfg.ShowWindows, r.cfg.MotionInterval))
r.filters[i] = filter.NewVariableFPSFilter(dst, r.cfg.MinFPS, filter.NewMOGFilter(dst, r.cfg.MOGMinArea, r.cfg.MOGThreshold, int(r.cfg.MOGHistory), r.cfg.ShowWindows, r.cfg.MotionInterval))
case config.FilterKNN:
r.filters[i] = filter.NewKNNFilter(dst, knnMinArea, knnThreshold, knnHistory, knnKernel, r.cfg.ShowWindows)
r.filters[i] = filter.NewKNNFilter(dst, r.cfg.KNNMinArea, r.cfg.KNNThreshold, int(r.cfg.KNNHistory), int(r.cfg.KNNKernel), r.cfg.ShowWindows)
default:
panic("Undefined Filter")
}