It would be convenient to clone zones along with the monitor. That seems to be the only thing not cloned.
Thanks!
jt
Clone monitor + zones
Re: Clone monitor + zones
Good gesture it will be very useful because I have 120 camera's same brand and same settings, if I can clone these cams the only thing to change is the port.
Re: Clone monitor + zones
You can already clone a monitor, but we didn't have it clone the zones because we can't imagine any two cameras having the same zones.
-
- Posts: 12
- Joined: Thu Aug 10, 2017 10:32 pm
Re: Clone monitor + zones
I'm not sure how most folks are using this feature but I use it to clone monitors and will only tweak settings for colorscale and frames captured in order to be able to switch back and forth the same camera with different qualities and load on the CPU/disk. In that case copying the zones would be helpful.
-
- Posts: 91
- Joined: Fri Nov 10, 2017 6:05 pm
Re: Clone monitor + zones
Another use case: using duplicate monitors to change motion detection sensitivities at different times of the day.
viewtopic.php?f=36&t=26716
viewtopic.php?f=36&t=26716
Re: Clone monitor + zones
Had the same question, hope that it helps some-one:
Let's say you have Zones Id=1 which is applied to MonitorId=1
You want this to copy to MonitorId=2
Do the Following (login to mysql, use zm database):
the select part:
you need to enter first the new Zones-Id (check first if there is already this Id. I've used for simplicity Id=2)
Then you need to apply it to your MonitorId which is the second '2' in the select part
Let's say you have Zones Id=1 which is applied to MonitorId=1
You want this to copy to MonitorId=2
Do the Following (login to mysql, use zm database):
Code: Select all
insert into Zones (Id, MonitorId , Name , Type , Units , NumCoords , Coords , Area , AlarmRGB , CheckMethod , MinPixelThreshold , MaxPixelThreshold , MinAlarmPixels , MaxAlarmPixels , FilterX , FilterY , MinFilterPixels , MaxFilterPixels , MinBlobPixels , MaxBlobPixels , MinBlobs , MaxBlobs , OverloadFrames , ExtendAlarmFrames)
select 2, 2 , Name , Type , Units , NumCoords , Coords , Area , AlarmRGB , CheckMethod , MinPixelThreshold , MaxPixelThreshold , MinAlarmPixels , MaxAlarmPixels , FilterX , FilterY , MinFilterPixels , MaxFilterPixels , MinBlobPixels , MaxBlobPixels , MinBlobs , MaxBlobs , OverloadFrames , ExtendAlarmFrames
from Zones
where Id = 1;
you need to enter first the new Zones-Id (check first if there is already this Id. I've used for simplicity Id=2)
Then you need to apply it to your MonitorId which is the second '2' in the select part
-
- Posts: 2
- Joined: Mon Feb 24, 2020 10:18 pm
Re: Clone monitor + zones
Totally agree with you on this use case. If you have already found a solution, I'd love to hear it...montagdude wrote: ↑Mon Nov 13, 2017 8:38 pm Another use case: using duplicate monitors to change motion detection sensitivities at different times of the day.
viewtopic.php?f=36&t=26716
Re: Clone monitor + zones
I'd be willing to make this work for 1.35/1.36.
At the moment my personal financing is in trouble due to COVID-19, so I'm going to create an issue, and a bounty.
If people want this sooner rather than later, they might consider posting bounties, become a patron on patreon.com, or at least do some social media sharing about ZM.
https://github.com/ZoneMinder/zoneminder/issues/2906
At the moment my personal financing is in trouble due to COVID-19, so I'm going to create an issue, and a bounty.
If people want this sooner rather than later, they might consider posting bounties, become a patron on patreon.com, or at least do some social media sharing about ZM.
https://github.com/ZoneMinder/zoneminder/issues/2906
Re: Clone monitor + zones
I use different Zones for Day/Night and have a cron job that runs to set the Active/Inactive setting on the zone depending on the time of day and sunrise/sunset. I also manually clone zones using SQL, not very difficult but would be nice to have this directly in the Zones page for cloning within the same monitor.
To get the Zones, I run this SQL code:
Then, I edit my zone_duplicate.sql file to change the Id of the Zone I want as the source, then in ZM GUI you can rename it. The key is the Zone name must be prefixed with "Day - " or "Night - " for the next part to function correctly.
The key to all this is, save the files in the attached Zip to a known location, I have mine on a NFS share on my NAS, and edit the switcher.sh file with the path you saved these as and on line 7, which monitor you want. Copy that line for each monitor you want, at some point I want to have this troll all monitors with Day/Night zones, just haven't gotten that far yet. Finally, create a crontab like such
Lot's of room for improvements, including getting the stuff into a GitHub repo for some proper colab.
To get the Zones, I run this SQL code:
Code: Select all
select Id,MonitorId,Name from Zones;
The key to all this is, save the files in the attached Zip to a known location, I have mine on a NFS share on my NAS, and edit the switcher.sh file with the path you saved these as and on line 7, which monitor you want. Copy that line for each monitor you want, at some point I want to have this troll all monitors with Day/Night zones, just haven't gotten that far yet. Finally, create a crontab like such
Code: Select all
## Autoswitch the camera zones
*/10 * * * * /nfs/swarm/zoneminder/scripts/switcher.sh 2>&1 | /usr/bin/logger -t switcher
- Attachments
-
- ZMFiles.zip
- (18.06 KiB) Downloaded 232 times