Hardware Reference
In-Depth Information
he irst coniguration you want to change will make Motion run in daemon mode, which
will make sure that it is always running in the background. his means if you log of from
your Raspberry Pi, the webcam will still run as long as it is plugged into power. You will see a
setting called daemon close to the top of the coniguration ile. Change the setting from of to
on. hen continue to make the coniguration changes in Table 13-4.
Table 13-4 Motion Coniguration Changes
Coniguration
New Value
Comment
framerate
30
threshold
500
gap
10
max_mpeg_time
30
output_normal
center
ffmpeg_video_codec
msmpeg4
For viewing video footage in Windows; other-
wise choose your preferred codec.
target_dir
/home
You can choose any other directory where you
want your video footage to be stored.
webcam_motion
on
webcam_maxrate
30
webcam_port
8085
Or any other port.
webcam_localhost
off
Save the ile and exit (Ctrl + X, Y, Enter) to complete editing the coniguration. After you're
back at the command prompt you need to restart Motion so that the new coniguration can
take efect. You do this by typing the following:
service motion stop
motion
If your webcam has an activity light on it, you should have noticed it come on. Check that it
is working by doing a directory listing of the /home directory (type dir /home ) and see if
there are .avi and .jpg iles being written. It is conigured so that it will store video foot-
age only when motion is detected, and it will store a maximum of 30 seconds of footage per
ile. You probably noticed when you were editing the coniguration that this application is
highly conigurable and can be changed to suit your needs. Next you will test that the real-
time video streaming is working.
Open a browser other than Internet Explorer on a PC, tablet or smartphone connected to
your home network. (Internet Explorer does not support MJPEG streaming, so you need to
Search WWH ::




Custom Search