Welcome to another Raspberry Pi Post, this time we will get to know more about Motion, A highly configurable program that monitors video signals from many types of cameras. We will configure and Install MotionEye on Raspberry Pi raspbian stack, and see how to setup, record and activate motion services across your home or office.
What Is Motion/Eye?
Motion (Github) is a Unix CLI-tool to watch, record and manage multiple types of cameras under one roof. In Short it can:
- Create videos or save pictures of the activity
- Passthrough recording from many IP cameras
- View live stream of cameras
- Invoke scripts when activities occur
- Log activity into multiple types of databases
- Fully customizable masks for privacy or motion detection
- Full TLS (https) support with authentication for web control and streams
MotionEye (GitHub) is a Web-Frontend written in Python. It sets up a very aesthetic view on a defined port, which you can access over network via IP address or a Domain name.
Does MotionEye suffice your project requirements?
MotionEye is a utility to collect video via different camera hardware’s, it provides us with hitbox type of Motion Detection, also it can send you notifications, Save video streams and control camera functions.
People often mistake MotionEye for a Computer Vision program, IT IS NOT. For facial-recognition, Speed tracking and object detection, Frigate is what you want.
Installing MotionEye On Raspberry Pi :
We shall install Motion, Its repos and the GUI on our Raspbian stack on a Raspberry Pi 3B+. We have also set another Pi zero as a sleeper camera (Active Medicenter) inside the house, and we have another IP Camera mounted outside the house. Assuming our Pi is updated, and we have root access by issuing sudo -i,
we start the installation progress:
- Install
ffmpeg
and othermotion
dependencies:
apt-get install ffmpeg libmariadb3 libpq5 libmicrohttpd12
- Install
motion
:
wget https://github.com/Motion-Project/motion/releases \
/download/release-4.2.2/pi_buster_motion_4.2.2-1_armhf.deb
dpkg -i pi_buster_motion_4.2.2-1_armhf.deb
- Get the dependencies from the repositories:
apt-get install python-pip python-dev libssl-dev libcurl4-openssl-dev libjpeg-dev libz-dev
- Install
motioneye on Raspberry Pi
, which will automatically pull Python dependencies (tornado
,jinja2
,pillow
andpycurl
):pip install motioneye
- Prepare the configuration directory:
mkdir -p /etc/motioneye cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
- Prepare the media directory:
mkdir -p /var/lib/motioneye
- Add an init script, configure it to run at startup and start the
motionEye
server:cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service systemctl daemon-reload systemctl enable motioneye systemctl start motioneye
8. To upgrade to the newest version of motionEye, just issue:
pip install motioneye --upgrade
systemctl restart motioneye
Setting Up MotionEye and our Cameras:
After completing the above steps, Our MotionEye on Raspberry Pi will be visible at IPaddressofPi:8765. When accessing the portal for the first time, you can use root as username and login, No password is necessary. It’s a good choice to update it after log-in.
Go to Add Camera and paste the address of the stream of your camera. Once successfully paired, Motion-eye will present you with dozens of options.
You can now enable Video Recording, Motion Detection and other features by following on-screen steps. Congratulations on having a successful setup of MotionEye on Raspberry Pi, and a step towards making your home more secure.