Site Tools


linux:raspberry:picam:motion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:raspberry:picam:motion [2018/12/20 17:44] – Discussion status changed lunetikklinux:raspberry:picam:motion [2022/06/13 18:57] (current) lunetikk
Line 3: Line 3:
 ==== Installation ==== ==== Installation ====
  
-[[http://jankarres.de/2013/12/raspberry-pi-kamera-modul-mit-motion-tracking/|Install instructions]]+<code>apt-get install motion</code>
  
 ==== Configuration ==== ==== Configuration ====
 +
 +=== motion.conf ===
 +
 +see my configfile below...
  
 === Maskfile === === Maskfile ===
 +
 +The maskfile is used to ignore certain areas with moving objects (like trees, pedestrians, cars) which normally would cause motion to capture pictures/videos. The file must have the same width and height as the picture captured by your camera. 
 +
 +Take a captured picture, paint all the correct areas white, the ones you want to ignore black. //You can also use different gray tones for different sensitivity (never tried).//
 +
 +Copy the picture to your Raspberry and convert it to the correct format.
 +
 +<code>
 +djpeg -grayscale -pnm <YOURPICTURE> > maskfile.pgm
 +</code>
 +
 +If djpeg is missing, install the following package (libjpeg-progs - Programs for manipulating JPEG files)
 +<code>
 +apt-get install libjpeg-progs
 +</code>
 +
 +Place your maskfile next to your "motion.conf" (in /etc/motion) and set the maskfile in your config (syntax: mask_file <FILE>).
  
 [[http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaskFile|How to create a Maskfile]] [[http://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionMaskFile|How to create a Maskfile]]
-=== My configuration ===+ 
 +==== Troubleshooting ==== 
 + 
 +=== libavformat error === 
 + 
 +"motion: error while loading shared libraries: libavformat.so.53: cannot open shared object file: no such file or directory" 
 + 
 +You might have to install some dependencies 
 + 
 +<code>apt-get install -y libjpeg62 libjpeg62-dev libavformat53 libavformat-dev libavcodec53 libavcodec-dev libavutil51 libavutil-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev</code> 
 + 
 +If some are not found, try to get the right version for your current distribution via 
 + 
 +<code>apt-cache search <package></code> 
 + 
 +=== /dev/video0 not found === 
 + 
 +"vid_v4lx_start: Failed to open video device /dev/video0: No such file or directory" 
 + 
 +Activate the module, /dev/video0 should be there afterwards 
 + 
 +<code>modprobe bcm2835-v4l2</code> 
 + 
 +and add the module to /etc/modules as a new line (persistent) 
 + 
 +<code>bcm2835-v4l2</code> 
 + 
 +=== libavformat error === 
 + 
 +<code> 
 +[1:ml1] [NTC] [ALL] [Jun 13 18:42:16] mlp_actions: End of event 1 
 +[1:ml1] [NTC] [ALL] [Jun 13 18:42:16] motion_loop: Thread exiting 
 +[1:ml1] [NTC] [VID] [Jun 13 18:42:16] vid_close: Cleaning up V4L2 device 
 +[1:ml1] [NTC] [VID] [Jun 13 18:42:16] v4l2_cleanup: Closing video device /dev/video0 
 +[0:motion] [NTC] [ALL] [Jun 13 18:42:17] main: Threads finished 
 +[0:motion] [NTC] [ALL] [Jun 13 18:42:17] main: Motion terminating 
 +</code> 
 + 
 +Motion just stops. If you activated "daemon mode" via config you might need to edit your servicefile. 
 + 
 +Edit /lib/systemd/system/motion.service 
 + 
 +<code> 
 +ExecStart=/usr/bin/motion 
 +to 
 +ExecStart=/usr/bin/motion -n 
 +</code> 
 + 
 +then 
 +<code> 
 +systemctl daemon-reload 
 +systemctl restart motion.service 
 +</code> 
 + 
 +[[https://github.com/Motion-Project/motion/pull/303/commits/34faa49adf33a1e12da74644800455139886a241|Github commit]] 
 + 
 + 
 +==== My configurationfile ==== 
 + 
 +This is the dozencrows config with my values, some things have changed in the current "apt-get"-version. Most of the config is the same, just compare it with the new one 
 <code sh motion.conf> <code sh motion.conf>
 # /etc/motion.conf # /etc/motion.conf
linux/raspberry/picam/motion.1545324272.txt.gz · Last modified: 2018/12/20 17:44 by lunetikk