Skip to content
2026.08.07 How to, 9 minute read

Motion detection software for webcam setups, done properly

A working setup for a USB webcam: placement, exposure, sensitivity, minimum duration and the zone that removes most false triggers.

Interior, after hours

Fixed camera, low light, two subjects

00:00.0

Clip

Decoded in your browser. Your video is never uploaded.

6

Sets the luma delta threshold and the smallest region that counts.

0.4s

Kills the one frame flicker that no operator wants paged about.

Exclude zone

Put it over the road, the tree, the neighbour's window. Events inside it stop alerting.

The frame an event was found on shows up here.

00 00:00.0

Nothing selected yet

Hover a row in the event table to preview its frame, click it to hold the frame and jump the clip there.

Length
0.0s
Confidence
0%
Area
0.0%

0

Motion events found

0

Dropped by zone

0

Dropped, too short

0

Alerts you would get

# Start Length Class Conf. Area

Reading the clip. Events appear here as they are found.

A USB webcam pointed at a door, a garage, a stockroom or a till is a genuinely useful camera, and the reason most people give up on it is not the camera. It is that the default motion detection setup fires on a passing shadow at four in the afternoon and then on nothing at all when it matters.

This is a working setup, in order, with the reasoning for each step. It is written to be useful with whatever software you choose, including the free ones, and it applies just as well to an IP camera as to a webcam.

What you need

  • A webcam that holds a stable exposure. Almost any current model does. A cheap one that hunts for exposure will generate false triggers no software can fully remove.
  • A machine that stays on. A laptop that sleeps is the most common cause of a detector that mysteriously stopped working.
  • A USB cable long enough to place the camera properly, or a powered extension. Placement matters more than the sensor, and a five metre cable is the cheapest quality upgrade available.
  • Somewhere for the events to go, whether that is a folder of clips, a notification or a timeline.

Placement, which decides everything downstream

Every hour spent on placement saves several hours of fighting thresholds.

  1. Point across the space, not along it. A person walking across the frame moves many more pixels than a person walking towards the lens, so a detector sees them far more reliably.
  2. Keep the sky, the street and the neighbour's windows out of frame. Every one of them moves, none of them are yours, and excluding them in software is always worse than not seeing them.
  3. Mount above head height, angled down. Roughly two and a half metres is the usual compromise: high enough not to be knocked, low enough that a face is not just the top of a head.
  4. Watch what the light does at every hour. A window that puts a hard sunbeam across the floor at 16:00 is a moving object every single afternoon. Come back at four and look.
  5. Never point at a screen, a television or a fish tank. They move continuously and they are bright.

Exposure and autofocus, the two settings that cause phantom motion

Most webcams default to automatic everything, and automatic exposure is a frame differencing detector's worst enemy: when the camera re rates the scene, every pixel in the frame changes at once, and a naive detector reports a very large event.

  • Lock the exposure if your camera exposes the setting, and set it for the darkest hour you care about rather than the brightest.
  • Turn off autofocus for a fixed scene. A camera that hunts for focus generates motion every time it hunts.
  • Fix the white balance. Automatic white balance shifting under a cloud is another whole frame change.
  • Cap the frame rate at 10 to 15. Higher rates give a detector more noise to trip on and buy you nothing for this job.

The software options

motion and MotionEye are the classic answer on Linux and on a small board, and they are frame differencing done well, with thresholds you can actually reach. Frigate does real object detection if you can give it a machine and an accelerator, and it accepts a USB camera through a stream wrapper. Blue Iris is the usual Windows choice. Motiondetection, this product, takes a clip from any of them and returns a classified event timeline; the demo does the whole loop in your browser, on your own footage, without an account.

The distinction that matters is the one described in video analytics tools: frame differencing tells you that pixels changed, classification tells you what changed. For a webcam pointed at one indoor door, frame differencing tuned properly is usually enough. For anything outdoors, or anything at night under infrared, it is not, and no amount of tuning makes it so.

The four settings that matter

Sensitivity, or threshold

This is how much a pixel must change before it counts as changed. Too high and a person in dark clothing at distance disappears, too low and camera sensor noise in a dim room becomes an event. Start in the middle, then adjust it in the dark, at the darkest hour the camera has to work, because that is where sensor noise is worst and where every detector is at its weakest.

Minimum object size

Expressed as a pixel count or a percentage of frame. Raise it until an insect close to the lens stops qualifying. Then walk to the far edge of the area you care about and confirm you still register. If both cannot be true at once, the camera is looking at too much ground and you are back to placement.

Minimum duration

The single most underrated setting in the category. A one to two second minimum removes almost all flicker: a moth crossing the lens, a raindrop, a single frame of compression artefact. Real events involving people last several seconds. If your software has no duration setting, that is a reason to change software.

Cooldown, or event gap

How long after an event ends before a new one can start. Too short and one person walking past becomes six notifications, which is how a channel gets muted even when every alert was technically correct.

The one zone that fixes most of it

After placement, exclude zones do more than every threshold combined. Draw a polygon over whatever is not yours and not still: the pavement, the road, the tree, the neighbour's window, the doorway of the shop next door. Events whose centroid falls inside the polygon are dropped before anything alerts.

Two rules make zones work. Draw them at the boundary you actually care about rather than at the edge of your property, so somebody approaching your door is still an event. And exclude rather than include: a small include region misses the person who enters from an angle you did not anticipate. You can practise both in the demo on a bundled clip, and watch the dropped count move as you close the polygon.

Testing it in twenty minutes

  1. Walk the scene at your normal pace, across the frame and towards the camera. Every pass should produce exactly one event.
  2. Walk it again slowly, close to a wall, in the darkest condition the camera faces. This is the test most setups fail.
  3. Leave it running through one full night, then read the events in the morning rather than as they arrive.
  4. For each junk event, name the cause: light change, insect, weather, reflection, screen, or something outside your boundary. Fix the cause, not the threshold.
  5. Repeat once after a week. Two rounds of this is usually the difference between a channel you read and a channel you mute.

What a webcam will never do

Be honest about the boundary. A USB webcam has a small sensor and no infrared illumination, so in a genuinely dark space it sees nothing useful no matter what software you point at it. It has a fixed lens, so it either covers a wide area badly or a narrow area well. And it is tethered to a machine, which caps where it can go.

If the job is a lit indoor doorway, a garage, a stockroom or a reception desk, a webcam plus the settings above is a genuinely good answer that costs nothing. If the job is a yard at night, a forecourt or a drive aisle, you want a proper IP camera with infrared, and then the question becomes what software reads its stream. That is what RTSP software and person detection camera software are about on this site.

Written by the people building Motiondetection. Prices quoted for other products are those vendors' own published positioning at the time of writing, not quotes we were given, and they change. Check them yourself before you decide anything.

Record a clip, then run it through the demo.

Sixty seconds of your own footage, detection computed in your browser, and a classified event timeline at the end of it. No account, no card.