Author Topic: Motion and masks  (Read 8215 times)

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Motion and masks
« on: April 10, 2013, 10:15:30 pm »
So it seems that even if you tinker with the /etc/motion/motion.conf, it gets rewritten every time the device is restarted.

Arrrghh... so you can't actually use a PGM mask to mask out areas of your image from motion detection or take advantage of any of the other features of motion? Is that correct.

Ouch. Guess I either need to dig out the rubber gloves and get into the code or it's back to zoneminder.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Motion and masks
« Reply #1 on: April 11, 2013, 02:04:57 am »
Add your additional parameters to the 'Extra Parameters' device data in the webadmin for motion_wrapper.  These will be re-written to motion.conf every time the device starts.

J.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Motion and masks
« Reply #2 on: April 11, 2013, 08:36:51 am »
Yay, that's brilliant! Not at my system now but will give it a go as soon as I can, thanks for the reply.

If it works I will wikify. If it's in the wiki I will self-flagellate. Many thanks for pointing it out. I had over 300 motion notifications from my camera yesterday so I need to get the mask going pronto.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Motion and masks
« Reply #3 on: April 11, 2013, 02:38:09 pm »
Let me know how it goes!  :)

J.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Motion and masks
« Reply #4 on: April 16, 2013, 10:11:32 am »
Super- it's there and when I add the motion_mask setting and quick-reload it definitely updates /etc/motion/motion.conf.

And I can confirm that the masked-out areas are no longer firing motion events which is certainly an improvement in my case.

The odd thing, though, and still to be confirmed, is that I didn't seem to have any video files. I had snapshots being generated, and definitely motion events because my gtalk is being notified, but there were no video files in /home/cameras/....

Will check that one out. Maybe I mucked up the config file somehow.

I've never set up more than one camera but I'm close - he camera is there, the cat-6 cable is there, I just need to hook it all up. Now, when I do, will there be a new motion-wrapper for the new camera? Presumably there is one wrapper "device" for each camera? Otherwise things will go South as I can't use the same mask for each camera!

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Motion and masks
« Reply #5 on: April 16, 2013, 11:34:07 am »
* posde didn't know there should be video files.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Motion and masks
« Reply #6 on: April 16, 2013, 11:42:48 am »
* posde didn't know there should be video files.

Yup. I think, from memory, it's in a folder called "recordings" somewhere in the same area as the snapshots. If I recall, they're .avi files of all the motion events with a datetime name.

But not at the moment... due to something I mucked up, I think. When I get them back I'll post more detail.

Very useful for reviewing what caused the event.

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Motion and masks
« Reply #7 on: April 16, 2013, 02:19:15 pm »
:) Now you are outside my area of knowledge.  As I have not used cameras yet.  I was unaware that motion wrapper would create videos.  I thought everything was .jpg

J.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Motion and masks
« Reply #8 on: April 16, 2013, 04:59:22 pm »
The Motion Wrapper talks to Motion, to get both individual JPEG frames, that we process, as well as generate Sensor Tripped events that we use for security events.

-Thom

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Motion and masks
« Reply #9 on: April 16, 2013, 05:44:47 pm »
I vaguely remember, that motion itself did store avi's someplace... but it is wayyy too long ago. ;)

bulek

  • Administrator
  • wants to work for LinuxMCE
  • *****
  • Posts: 909
  • Living with LMCE
    • View Profile
Re: Motion and masks
« Reply #10 on: April 16, 2013, 08:07:17 pm »
Hi,

under Dianemo we have KMotion now. But I still remember that motion did movies into /home/cameras tree. Somewhere deeper are jpegs, higher are avi's...

I still have this settins under Motion Wrapper device ("Extra Parameters") :

Quote
#extra parameters defined by user

#image settings
frequency 0
rotate 0
width 320
height 240
framerate 10
auto_brightness on
brightness 128
contrast 128
saturation 128
hue 128

#http control
control_localhost off
control_html_output on
control_port 8888

#filters
despeckle EedDl
lightswitch 50
minimum_motion_frames 5

#detection
noise_tune on
threshold_tune on
smart_mask_speed 5
gap 5
post_capture 5
pre_capture 3

#output
locate on
text_double on
webcam_quality 70
webcam_maxrate 5
text_changes on
text_right %d-%m-%Y\\\\n%T

#movies
ffmpeg_cap_new on
ffmpeg_timelapse 60
ffmpeg_timelapse_mode daily
#ffmpeg_video_codec msmpeg4

#snapshot config
snapshot_interval 60
snapshot_filename %Y/%m/%d/%H/%M_%S
jpeg_filename %Y/%m/%d/%H/%M_%S
movie_filename movies/%d_%m_%Y_%H_%M_%S
timelapse_filename %Y/%m/%d-timelapse

Maybe you can figure out what you need for your case...

HTH,

regards,

Bulek.

Thanks in advance,

regards,

Bulek.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Motion and masks
« Reply #11 on: April 16, 2013, 09:40:43 pm »
Hey, no sweat, it's working. At 4.30pm for some reason motion starting recording AVIs. It records them in /home/cameras/<device>/year/month/day/recordings.

Very neat. Well done guys... may be old but it works.

And the mask is definitely working too. May need a bit of refinement but a good start.

jamo

  • Guru
  • ****
  • Posts: 463
    • View Profile
    • LMCE user Page
Re: Motion and masks
« Reply #12 on: April 24, 2013, 04:27:58 pm »
Add your additional parameters to the 'Extra Parameters' device data in the webadmin for motion_wrapper.  These will be re-written to motion.conf every time the device starts.

J.
This worked very nicely for me.... only thing now is that I have another camera I'm trying to incorporate. I say "trying" because it hasn't shown anything but a blue screen yet but rule#1 should solve that one.

So... in other posts I got the impression that you have a single "Motion Wrapper" device and multiple Camera devices controlled by it. However, this will be a problem if the masking settings (or any other custom settings) need to be different for the different cameras (since they are set at the Motion Wrapper level).

So the question is-

Can I have multiple Motion Wrapper devices in order to allow me to customise the settings for each Camera? Anyone know? I know you can create them, I've tried, but will they work (I had the blue-screen for my 2nd camera when I tried but that may be due something else since I have it when I share a motion wrapper as well).

[Update: Rule #1 has solved my blue screen on camera 2 - a few regens and reboots later, both cams available sharing a motion wrapper device as parent but, presumably, also sharing the motion config settings... will leave it at this until after poker evening on Fri night so I can show off my neat security cams from the MDs. Thereafter I'll try switching back to two motion wrappers and apply Rule #1 a bit to see if I can get them going separately]
« Last Edit: April 25, 2013, 10:29:18 am by jamo »

phenigma

  • LinuxMCE God
  • ****
  • Posts: 1758
    • View Profile
Re: Motion and masks
« Reply #13 on: April 25, 2013, 09:15:57 pm »
My short answer is "I don't know"  :-)  Let us know how your testing goes!

J.