Robobot webcam server
(→run motion) |
(→View the stream) |
||
(2 intermediate revisions by one user not shown) | |||
Line 13: | Line 13: | ||
$ sudo nano /etc/motion/motion.conf | $ sudo nano /etc/motion/motion.conf | ||
− | # File to write | + | # File to write log messages into. If not defined, stderr and syslog are used. |
log_file /home/local/.motion/motion.log | log_file /home/local/.motion/motion.log | ||
# Target directory for pictures, snapshots and movies | # Target directory for pictures, snapshots and movies | ||
Line 21: | Line 21: | ||
# The port number for the live stream. | # The port number for the live stream. | ||
stream_port 8081 | stream_port 8081 | ||
− | # Restrict stream connections to the localhost (if on). | + | # Restrict stream connections to the localhost (if 'stream_localhost on'). |
stream_localhost off | stream_localhost off | ||
# Image width in pixels. | # Image width in pixels. | ||
Line 28: | Line 28: | ||
height 480 | height 480 | ||
# Maximum number of frames to be captured per second. | # Maximum number of frames to be captured per second. | ||
− | framerate | + | framerate 5 |
=== run motion === | === run motion === | ||
Line 53: | Line 53: | ||
=== View the stream === | === 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 ' | + | To view the result, use a browser to the address of the robot and port 8081, e.g. if the robot has IP '10.197.218.248': |
− | + | 10.197.218.248:8081 | |
− | You should now see a stream of default 640x480 at | + | You should now see a stream of default 640x480 at 5 FPS as default; more options are available in /etc/motion/motion.conf. |
Latest revision as of 14:02, 10 January 2024
Back to Robobot_B
Contents |
[edit] 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.
[edit] Configuration file
Edit the configuration file
$ sudo nano /etc/motion/motion.conf # File to write log messages into. If not defined, stderr and syslog are 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 'stream_localhost on'). stream_localhost off # Image width in pixels. width 640 # Image height in pixels. height 480 # Maximum number of frames to be captured per second. framerate 5
[edit] 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
Note! Remember to stop the streamer before using the camera for other purposes. There is an alternative if you want both:
Start a loopback feature to create a copy with the same information when the camera is opened. Run:
sudo modprobe v4l2loopback
When /dev/video0 is opened a /dev/video1 will be created (with the data determined by the first user).
- not tested much.
[edit] 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 '10.197.218.248':
10.197.218.248:8081
You should now see a stream of default 640x480 at 5 FPS as default; more options are available in /etc/motion/motion.conf.