Motion

From XennisWiki
Jump to: navigation, search

Motion, a software motion detector, is a free software CCTV software application developed for Linux. (Wikipedia)

Installation

Debian

apt-get install motion

Configuration

Give Motion user access to directory where it stores recordings. Add a user to this group.

chown motion:motion /var/lib/motion/
usermod -a -G motion <user>

Adjust configuration in /etc/motion/motion.conf if neeeded.

Enable the daemon in the file /etc/default/motion

start_motion_daemon=yes

Enable the service and show its status

systemctl enable motion
service motion status

Camera settings

width 1280
height 720
framerate 15

Stream to network

Enable a stream at <ip>:8081/ by

stream_localhost off

Change recordings file name pattern

movie_filename %Y%m%d%H%M%S-%v

Errors and problems

The logs can be found in /var/log/motion/motion.log.

Device or resource busy

Error message
[1:ml1] [ERR] [VID] [Apr 11 01:32:20] v4l2_select_input: Error selecting input 0 VIDIOC_S_INPUT: Device or resource busy
[1:ml1] [ERR] [ALL] [Apr 11 01:32:20] mlp_capture: Video device fatal error - Closing video device
Solution

Disable the other services that is using the webcam and restart the motion service

systemctl stop webcamd.service
/etc/init.d/motion restart

External links