Above my cat's automatic pet feeder I placed a motion sensor connected to a Raspberry Pi. The Pi also has a USB camera. Every time the sensor trips, the Pi starts recording (and turns on some LEDs). Subsequent detections in a one-minute time window extend the recording window by another minute. A thumbnail image is extracted and both the MP4 and image are uploaded to a secured public AWS S3 bucket. Picture here.