Hardware Reference
In-Depth Information
Configuring Motion for multiple input streams
To incorporate our new webcam stream into Motion, we will need to rework the
configuration so that each camera runs in its own thread. We do this by taking all
the configuration directives that are unique to each webcam and putting them in
separate configuration files:
~/.motion/thread1.conf
for camera one,
~/.motion/
thread2.conf
for camera two, and so on. The steps are as follows:
1. Let's begin with our first webcam, the one plugged into the Pi. The following
directives are unique to camera one and will be moved into
thread1.conf
:
°
netcam_url http://localhost:8080/?action=stream
: This line is
the primary identifier for camera one. It should be commented out in
motion.conf
and added to
thread1.conf
.
°
webcam_port 8081
: This port is also unique to camera one, and
should be commented out in
motion.conf
and added to
thread1.
conf
.
2.
Then we add the new stream to
thread2.conf
:
°
netcam_url http://[WinIP]:8080/cam_1.cgi
or
http://
[MacIP]:8080/stream.mjpg
: This line is unique to our second
camera.
°
webcam_port 8082
: We specify this port to see the live feed from
camera two.
3.
Now the last thing we have to do is to enable the threads in
~/.motion/
motion.conf
. At the bottom of the file, you'll find the thread directives.
Change two of them to include your new thread configurations:
thread /home/pi/.motion/thread1.conf
thread /home/pi/.motion/thread2.conf
As a final touch, you can uncomment the
text_left
configuration directive
to enable text labels that'll make it easier to tell the camera feeds apart.