← All updates

Pluggable motion detection with five built-in algorithms

Motion detection is now a trait with five implementations (Census default, FrameDiff, MOG2, Optical Flow, Ensemble) plus a Frigate-as-source option. Per-camera selection. A golden-replay benchmark ships with the recorder.

Backend motionarchitecture

Motion detection used to be one big function. Now it's a MotionDetector trait with five interchangeable implementations:

  • Census (default): illumination-invariant 3x3 census transform foreground.

Best general-purpose detector for outdoor scenes.

  • Frame Diff: classic frame differencing. Cheapest. Good for indoor.
  • MOG2: Mixture-of-Gaussians background model. Better at slow scenes.
  • Optical Flow: flow-based foreground. Better for low-contrast motion.
  • Ensemble: weighted combination of the above. The "I'll try everything"

mode.

Plus a sixth option: use Frigate as the motion source. If Frigate is already doing detection for a camera, CrumbVMS can subscribe to those events instead of running its own pass.

Why pluggable

Different cameras, different scenes, different problems. Outdoor in California sun is a completely different motion problem than indoor under fluorescent flicker. One algorithm doesn't win them all. Per-camera selection means each camera gets the right one.

Reproducible benchmarks

A golden-replay test ships with the recorder. It plays a known clip through each detector and asserts the detection result hasn't regressed. Adding a new detector means proving it against the golden set first. Adding a new clip to the golden set means thinking carefully about what "correct" detection actually means for that scene.

Detection icons on the timeline still come from Frigate; the trait change is about how CrumbVMS itself decides where to cut motion segments.

Don't miss the next one.

Watch the repo on GitHub for releases, or grab the RSS.

Get it on GitHub