how to create a filter for send a mail if the signal is loss
how to create a filter for send a mail if the signal is loss
hi,
I would like create a zm filter for signaling the state down of a camera.
For example, after the theft of a camera.
I have see the options ZM_SIGNAL_CHECK_POINTS and ZM_SIGNAL_CHECK_COLOUR, but I don't know how to for setting the filter.
Some help?
THX
bye
I would like create a zm filter for signaling the state down of a camera.
For example, after the theft of a camera.
I have see the options ZM_SIGNAL_CHECK_POINTS and ZM_SIGNAL_CHECK_COLOUR, but I don't know how to for setting the filter.
Some help?
THX
bye
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
I had totally misunderstood the purpose of ZM_SIGNAL_CHECK_COLOUR.
However i think the problem is there.
We have a 1.22.1 linux system with LMLBT44 at work and i have a 1.22.3 FreeBSD with LMLBT4M system at home.
At work i checked with Gimp and the color picker for non connected cameras gave RGB 0,0,192 (0x0000C0).
At home this morning i checked with PhotoShop and it also gave 0,0,192.
I put this 0000C0 value to set ZM_SIGNAL_CHECK_COLOUR,
restared ZM and the problem was there, i could not get any Signal events, at any camera function, be it Monitor, Modect.
In the help of ZM_SIGNAL_CHECK_COLOUR it writes about the color:
However i think the problem is there.
We have a 1.22.1 linux system with LMLBT44 at work and i have a 1.22.3 FreeBSD with LMLBT4M system at home.
At work i checked with Gimp and the color picker for non connected cameras gave RGB 0,0,192 (0x0000C0).
At home this morning i checked with PhotoShop and it also gave 0,0,192.
I put this 0000C0 value to set ZM_SIGNAL_CHECK_COLOUR,
restared ZM and the problem was there, i could not get any Signal events, at any camera function, be it Monitor, Modect.
In the help of ZM_SIGNAL_CHECK_COLOUR it writes about the color:
When we say system what do we mean? driver? card?The default, which is a shade of blue, is most common but other systems may differ.
I think i got it , in
the computation of the random index was as follows:
which at least for my 32bit FreeBSD always returned 0,
since no matter what any int most probably is less than RAND_MAX=(2^31)-1.
Apart from this, for some reason i dont know, the pixel at 0 position of the buffer
always had RGB=000000, which was different than 0000C0=ZM_SIGNAL_CHECK_COLOUR, but anyway index should be random.
I changed the index computation as follows:
so index lies between pixels/3 and 2*pixels/3.
(i thought there was some noise at positions near 0, hence this hack).
Now when camera Function is other than monitor, i get Signal events!
All the above are for FreeBSD, but given the semantics are the same
(rand conforming to ISO/IEC 9899:1990), i dont see any reason why the above situation would not hold in 32bit Linuxes too.
Code: Select all
bool Monitor::CheckSignal( const Image *image )
Code: Select all
int index = (rand()*pixels)/RAND_MAX;
since no matter what any int most probably is less than RAND_MAX=(2^31)-1.
Apart from this, for some reason i dont know, the pixel at 0 position of the buffer
always had RGB=000000, which was different than 0000C0=ZM_SIGNAL_CHECK_COLOUR, but anyway index should be random.
I changed the index computation as follows:
Code: Select all
float foo = ((float) rand()) / ((float) RAND_MAX);
int index = pixels/3 + (int)((float) pixels * foo / 3.0f);
(i thought there was some noise at positions near 0, hence this hack).
Now when camera Function is other than monitor, i get Signal events!
All the above are for FreeBSD, but given the semantics are the same
(rand conforming to ISO/IEC 9899:1990), i dont see any reason why the above situation would not hold in 32bit Linuxes too.