This is the sort of thing that you can knock up quite quickly using OpenCV and Python.
- Free (both gratis and FLOSS)
- Cross platform: Windows, Linux, Android and Mac OS
- Motion Detection algorithms built in, (including being able to set thresholds).
- VideoWriter class to save your results
- Active user community.
Just download and install: Python, OpenCV, the python libraries Numpy and pyopencv.
Example of motion detection in OpenCV in python
This example came from the blog of Matthias Stein.
import cv2
def diffImg(t0, t1, t2):
d1 = cv2.absdiff(t2, t1)
d2 = cv2.absdiff(t1, t0)
return cv2.bitwise_and(d1, d2)
cam = cv2.VideoCapture(0)
winName = "Movement Indicator"
cv2.namedWindow(winName, cv2.CV_WINDOW_AUTOSIZE)
# Read three images first:
t_minus = cv2.cvtColor(cam.read()[1], cv2.COLOR_RGB2GRAY)
t = cv2.cvtColor(cam.read()[1], cv2.COLOR_RGB2GRAY)
t_plus = cv2.cvtColor(cam.read()[1], cv2.COLOR_RGB2GRAY)
while True:
diff = diffImg(t_minus, t, t_plus)
cv2.imshow(winName, diff) # This shows the delta image
# Here you would use diffImag to save the frame if the difference is bigger than some threashold
# Read next image
t_minus = t
t = t_plus
t_plus = cv2.cvtColor(cam.read()[1], cv2.COLOR_RGB2GRAY)
key = cv2.waitKey(10)
if key == 27:
cv2.destroyWindow(winName)
break
print "Goodbye"