Skip to content
nanakira edited this page Apr 3, 2016 · 5 revisions

Install motion

$ sudo apt-get install -y motion

Edit config

$ sudo emacs /etc/motion/motion.conf
width 640  # depends on camera device
height 480  # depends on camera device
framerate 25  # depends on camera device
minimum_frame_time 10
threshold  1500
output_pictures on
target_dir /tmp/motion
stream_localhost off
;stream_authentication username:password
webcontrol_localhost off

Test by browser

$ sudo motion -n

Access http://(Raspberry Pi's IP address):8081

Firefox だとそのままアクセスできない? html をはさむと見える

<html>
<body>
<img src="http://192.168.XX:XX:8081">
</body>
</html>

Daemonize

$ sudo emacs /etc/motion/motion.conf
daemon on

$ sudo emacs /etc/default/motion
start_motion_daemon=yes

$ sudo service motion start
$ sudo service motion stop
Clone this wiki locally