Raspberry PIs, other SBCs and usb webcams/noIR are an exercise in futility, as the inbuilt camera interface and v4l lags horribly at reasonable resolutions.
USB webcams can behave oddly if you stream constantly and are close to using the bandwidth of USB2
Zoneminder is memory hungry and will suck CPU like no tomorrow. But has a decent user interface, if you keep lots of data.
MotionEye can be configured to be unable to play back its captures which is a bug imho.