RS Components Raspberry Pi model A Instrukcja Użytkownika Strona 5

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 8
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 4
sudo mv motion /usr/bin/motion
sudo mv motion-mmalcam.conf /etc/motion.conf
You also need to enable the motion daemon so that motion will always run:
sudo nano /etc/default/motion
and change the line to:
start_motion_daemon=yes
We're pretty sure that the official build of motion will shortly also support the Raspberry camera module as well.
A very important command to edit the motion configuration file is
sudo nano /etc/motion.conf
Note: in the standard motion installation, the motion.conf is in /etc/motion/, but in the special motion-mmal build from our url (see above) it's in /etc/. If you
follow this tutorial with all steps, this is no problem at all.
Be sure to have the file permissions correct: when you install motion via ssh while being logged in as user "pi", you need to make sure to give the user
"motion" the permissions to run motion as service after reboot:
sudo chmod 664 /etc/motion.conf
sudo chmod 755 /usr/bin/motion
sudo touch /tmp/motion.log
sudo chmod 775 /tmp/motion.log
We've made some changes to the motion.conf file to fit our needs. Our current motion.conf file is included in the zip package which can be downloaded
here: raspberry_surveillance_cam_scavix.zip. Just download, unzip and copy the containing motion.conf to /etc/motion.conf if you would like to use the
exact config options we describe below.
Some of the main changes are:
Make sure that motion is always running as a daemon in the background:
daemon on
We want to store the logfile in /tmp instead (otherwise autostart user won't be able to acces it in /home/pi/ folder):
logfile /tmp/motion.log
As we want to use a high quality surveillance video, we've set the resolution to 1280x720:
width 1280
height 720
We don't need real-time video, 2 pictures per second are totally ok for our needs:
framerate 2
This is a very handy feature of the motion software: record some (2 in our configuration) frames before and after the motion in the image was detected:
pre_capture 2
post_capture 2
We don't want endless movies. Instead, we want to have max. 10 minutes slices of the motion videos. This config option was renamed from
max_movie_time to max_mpeg_time in motion. If you use the motion-mmal build, this one will work. If you get an error 'Unknown config option
"max_mpeg_time"' either change this one to max_movie_time or make sure to really use the motion-mmal build as shown above.
max_mpeg_time 600
As some media players like VLC are unable to play the recorded movies, we've changed the codec to msmpeg4. Then, the movies play correctly in all
players:
ffmpeg_video_codec msmpeg4
Enable access to the live stream from anywhere. Otherwise only localhost (= the Raspberry device) would be allowed to access the live stream:
stream_localhost off
If you want to protect the live stream with a username and password, you should enable this:
stream_auth_method 2
stream_authentication SOMEUSERNAME:SOMEPASSWORD
All configuration parameters are explained in detail in the motion config documentation.
After your changes to the motion.conf, reboot the Raspberry:
sudo reboot
After the reboot, the red light of the camera module should be turned on, which shows that motion currently is using the camera to detect any movement.
Save videos on Windows shared folder
As the SD card of the Raspberry Pi is a pretty limited resource, we've decided to let the Raspberry cam store the videos on one of our Windows Servers.
This is pretty easy:
Przeglądanie stron 4
1 2 3 4 5 6 7 8

Komentarze do niniejszej Instrukcji

Brak uwag