Robobot webcam server
From Rsewiki
Back to Robobot_B
View camera
A motion camera ser is installed called "motion", it can detect motion and save video-clip, if motion is detected.
Motion detection is the primary purpose, but being able to see what the camera sees.
Configuration file
Edit the configuration file
$ sudo nano /etc/motion/motion.conf # File to write logs messages into. If not defined stderr and syslog is used. log_file /home/local/.motion/motion.log # Target directory for pictures, snapshots and movies target_dir /home/local/Video/motion # Video device (e.g. /dev/video0) to be used for capturing. videodevice /dev/video0 # The port number for the live stream. stream_port 8081 # Restrict stream connections to the localhost (if on). stream_localhost off
run motion
To run the streamer, SSH to the robot and start motion
$ motion [0:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf [0:motion] [NTC] [ALL] motion_startup: Logging to file (/home/local/.motion/motion.log)
Stop by ctrl-C
NB! Remember to stop the streamer before trying to use the camera for other purposes.
View the stream
To view the result, use a browser to the address of the robot and port 8081, e.g. if the robot has IP '192.168.1.151':
192.168.2.151:8081
You should now see a stream of default 640x480 at 10 FPS as default; more options are available in /etc/motion/motion.conf.