2 years ago I successfully set up Pikrellcam for the Raspberry Pi for motion capture detection. An open source package that sets up nginx and a custom PHP Web application that communicates with a series of server side scripts written in C to analyze the content coming through the Camera.
Raspberry Pi Camera Module V2 with Open Source PiKrellCam detecting reflections of water off ceiling.