motion

In this one we install motion so we can see our cloud via a web cam.

Link to video: https://youtu.be/RRkQp8u_M14

Link to motion documentation:

http://www.lavrsen.dk/foswiki/bin/view/Motion/MotionGuideInstallation

After you have plugged in your webcam, install motion
sudo apt install motion

Make a hidden motion directory in your home directory:
mkdir ~/.motion

Copy the motion config file to your new directory:
cp /etc/motion/motion.conf ~/.motion/motion.conf

Edit the config file:
sudo nano ~/.motion/motion.conf

Make sure your webcam is device video0

ls /dev |grep video
video0

Edit the following:

Make daemon start in the background, set daemon on

# Start in daemon (background) mode and release terminal (default: off)
daemon on

Make sure this file says video0

# Videodevice to be used for capturing  (default /dev/video0)
# for FreeBSD default is /dev/bktr0
videodevice /dev/video0

Adjust resolution here:

# Image width (pixels). Valid range: Camera dependent, default: 352
width 640

# Image height (pixels). Valid range: Camera dependent, default: 288
height 480


Make sure this is set to off if you want to do live video only. It can fill up your disk.

############################################################
# Image File Output
############################################################

# Output 'normal' pictures when motion is detected (default: on)
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
output_normal off

Make sure this is set to off or you will not be able to access you cam from outside the localhost:

# Restrict webcam connections to localhost only (default: on)
webcam_localhost off

Make sure this is set to off or you will not be able to control your motion from outside the local host:

# Restrict control connections to localhost only (default: on)
control_localhost off

Save your config.

Make a var run directory for motion
sudo mkdir /var/run/motion

Start motion:
sudo motion


NOT IN THE VIDEO!!!!

Make motion start on boot

 sudo nano /etc/default/motion

Change this to yes.

# set to 'yes' to enable the motion daemon
start_motion_daemon=yes

If you use auto start you will need to copy your config file back to its root location

sudo cp ~/.motion/motion.conf /etc/motion/motion.conf 


Comments