How to use PS3 EYE or any other camera with Raspberry pi 4B using the open source motion package?
What we will build?
We are going to build a Motion Detector using Raspberry pi.
What will we need?
- Raspberry pi
- PS3 EYE or any other camera. We really don’t care.
Getting Started
- Plug your pi.
- Install motion and ffmpeg:
sudo apt-get install motion
sudo apt-get install ffmpeg
- Set Configurations
# Edit the file: /etc/motion/motion.conf
nano /etc/motion/motion.conf
# Start in daemon (background) mode and release terminal (default: off)
daemon on# Videodevice to be used for capturing (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0# v4l2_palette allows one to choose preferable palette to be use by motion
# See motion_guide.html for the valid options and values. (default: 17)
v4l2_palette 15# Restrict stream connections to localhost only (default: on)
stream_localhost off# Use ffmpeg to encode videos of motion (default: off)
ffmpeg_output_movies on# Restrict control connections to localhost only (default: on)
webcontrol_localhost off# TCP/IP port for the http server to listen on (default: 0 = disabled)
webcontrol_port 8080# The mini-http server listens to this port for requests (default: 0 = disabled)
stream_port 8081# The video norm to use (only for video capture and TV tuner cards)
# Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
norm 2
Please refer to the following to get a good documentation:
Start the motion server:
motion -n