Raspberry Pi motion detector
main example of working with MMAL -> https://github.com/tasanakorn/rpi-mmal-demo.git
Device:
Raspberry Pi 2 Model B Rev 1.1
Raspberry Pi Camera Module
3,5” RPi LCD 480×320
FPS
motion-h264-detect-opencv ~ max 4 FPS
motion-h264-detect-vector ~ max 29 FPS
motion-final ~ 15 FPS
Examples ( directory - 'images' ) :
creates files in the directory(variable "DirSave"):
*-f.jpg, *-f-small.jpg - first frame motion detect
*-s.jpg, *-s-small.jpg - frame after ~ 1.5sec from the motion detect
*.mp4 - Video
* - yyyymmdd_hhmmss
Start the alert in ~1.5 sec:
running script(send.sh), parameter($1): "varable Dirsave"+20231009_142258-s.jpg
running script(sendvideo.sh) after video file recording is complete, parameter($1): "varable Dirsave"+20231009_142258.mp4
-
Install pre-required packages
libopencv-dev ffmpeg ffmpeg-devel
-
Place Raspberry Pi userland project in /home/pi/src/raspberrypi/userland
$ mkdir -p /home/pi/src/raspberrypi
$ cd /home/pi/src/raspberrypi
$ git clone --depth 1 https://github.com/raspberrypi/userland.git
-
Build pre-required libraries
$ make -C /opt/vc/src/hello_pi/libs/vgfont
-
Build project
$ mkdir build
$ cd build
$ cmake ../
$ make