I work for the housing department of a university and I'm trying to get zoneminder up and running to test the feasiblity of using it as our surveillance system for about 40 Axis 2120 IP cameras. I love the software, the interface is great, etc. The issue I'm running into however, is terribly poor performance when I try to enable more than a couple cameras for motion detection. I installed fresh from the LiveCD to a 2.8 Ghz Pentium 4 with 512 MB of RAM. I went in and changed the shared memory allocation from 128 MB to 256 MB. I've even tried setting the cameras to about 5 fps. I'm pretty stumped now on what to try. I'm getting to the point where I'm going to have to move on to considering other software packages (which I don't want to do because I really wanted to go open-source and really like zoneminder).
Does anyone have any suggestions on what to do? Has anyone else out there successfully setup a system with a large number of cameras (20-40) and been satisfied with the overall performance? My whole zoneminder installation just seems to slow to a crawl once 3 or 4 cameras are running with motion detection. Any and all suggestions are welcomed. Thanks.
Matt Kernan
Performance issues
performance
I am running 5 IP cams at 640x480 3fps and Zoneminder is using all of my 1GB of RAM
(Pentium 4 2.8 GHz)
I have a couple of theories on ZM performance:
I think that IP cameras need more resources than if you use cameras with a capture card.
Processor performance is not so much an issue, as is physical RAM which results out of the resolution, color depth and frame rate you are using.
You might also need to take in accout disk speed.
One thing I have no experience with, but which probably matters is your network speed.
Getting video data from 20 to 40 cams might be a little to much for a 100 Mbit network, especially on a single network card.
As I said these are opinions based on my experience rather than scientific benchmark tests.
I believe you can use ZM for your needs.
What you will definitly need is a lot more RAM.
Also you can set the FPS to 1 and allow "Should any Maximum FPS be ignored if an alarm occurs" in the OPTIONS, this way you reduce activity and still get detail when an event occurs.
I also believe that other software solutions, will also need similiar hardware setups to deliver acceptable performance.
(Pentium 4 2.8 GHz)
I have a couple of theories on ZM performance:
I think that IP cameras need more resources than if you use cameras with a capture card.
Processor performance is not so much an issue, as is physical RAM which results out of the resolution, color depth and frame rate you are using.
You might also need to take in accout disk speed.
One thing I have no experience with, but which probably matters is your network speed.
Getting video data from 20 to 40 cams might be a little to much for a 100 Mbit network, especially on a single network card.
As I said these are opinions based on my experience rather than scientific benchmark tests.
I believe you can use ZM for your needs.
What you will definitly need is a lot more RAM.
Also you can set the FPS to 1 and allow "Should any Maximum FPS be ignored if an alarm occurs" in the OPTIONS, this way you reduce activity and still get detail when an event occurs.
I also believe that other software solutions, will also need similiar hardware setups to deliver acceptable performance.
hmmm
I guess what has been baffling me is that I have also tried a program called SecuritySpy for Mac OS X. I can easily run it on my 867 Mhz Powerbook G4 with 30 cameras doing motion detection and the performance is just fine. Obviously, the software works differently, but still I was a bit surprised to find ZoneMinder choking with just a couple cameras.
I have ZM running with 16 cameras (recording continually, no motion detection yet) on an AMD 2500+ and it doesn't have any problem at all keeping up. I was astounded at how efficient zoneminder is at what it does. I'm only capturing at 320x240 because of drive space requirements, but 16 cameras recording 24x7 and the CPU being 70+% free is unbelievable to me.
If you know somebody with a capture card and cameras, you may want to try them in order to isolate the problem to ZM and not the cameras or network infastructure. I have no experience with the netcams you mentioned
If you know somebody with a capture card and cameras, you may want to try them in order to isolate the problem to ZM and not the cameras or network infastructure. I have no experience with the netcams you mentioned
please please help
OK, here's the deal: I REALLY like ZoneMinder. I like that it's open source, I like that its highly configurable, I like the web interface, I like almost everything about it. It has everything I need to implement the surveillance system I have in mind. But I'm getting terrible performance and I am stumped as to why that is.
Could anyone please help me? I could use detailed information, from square one, on what you recommend for my particular situation. I have a slew of Axis 2120 cameras deployed and I want to grab image streams from them. They are capable of 25-30 fps but I know I'll never get that high quality through ZoneMinder with 40 cameras doing motion detection. They are stationed in hallways and entry ways in dorms at a university so there is quite a bit of motion to be detected. I'm a bit of a Linux novice, so there's only so much I can do as far as tuning the system itself so any and all info would be appreciated.
I installed the current version of ZM from the LiveCD and I'm running on a 2.8 Ghz P4 w/ 512 MB of RAM (I can up that to 2 GB if needed). What would you do if you needed to run ZM with 40 cameras doing motion detection (in high-traffic areas)?
Could anyone please help me? I could use detailed information, from square one, on what you recommend for my particular situation. I have a slew of Axis 2120 cameras deployed and I want to grab image streams from them. They are capable of 25-30 fps but I know I'll never get that high quality through ZoneMinder with 40 cameras doing motion detection. They are stationed in hallways and entry ways in dorms at a university so there is quite a bit of motion to be detected. I'm a bit of a Linux novice, so there's only so much I can do as far as tuning the system itself so any and all info would be appreciated.
I installed the current version of ZM from the LiveCD and I'm running on a 2.8 Ghz P4 w/ 512 MB of RAM (I can up that to 2 GB if needed). What would you do if you needed to run ZM with 40 cameras doing motion detection (in high-traffic areas)?
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
There is a basic optimisation brief in the FAQ which perhaps might be worth trying in the first instance. For motion detection perhaps the main thing is changing the detection method from blobs to just alarmed or filtered pixels. This significantly reduces the amount of CPU and can be just as effective.
You don't actually need all that much RAM for a system to run, really for a ring buffer of 40 images you would need may 40-50 Mb per camera. When you say all your RAM is being used, do you know where it is being used?
Having said all that I think there is a performance issue with netcams as ZM currently uses the pcre regular expression library to parse the image stream. This is because all netcams use slightly different formats and they are all different so it's a pig to handle all special cases. I am currently testing a version that doesn't use regexps which hopefully will be substantially faster.
One final thing which can screw up systems with netcams is that if you want to limit the frame rate you need to ensure that you limit it at the camera end (either in config or in the initial request) rather than just at the ZM end. Otherwise the cameras just shove images down at ZM at their full rate and ZM can never keep up as it's trying to go slower.
Phil
You don't actually need all that much RAM for a system to run, really for a ring buffer of 40 images you would need may 40-50 Mb per camera. When you say all your RAM is being used, do you know where it is being used?
Having said all that I think there is a performance issue with netcams as ZM currently uses the pcre regular expression library to parse the image stream. This is because all netcams use slightly different formats and they are all different so it's a pig to handle all special cases. I am currently testing a version that doesn't use regexps which hopefully will be substantially faster.
One final thing which can screw up systems with netcams is that if you want to limit the frame rate you need to ensure that you limit it at the camera end (either in config or in the initial request) rather than just at the ZM end. Otherwise the cameras just shove images down at ZM at their full rate and ZM can never keep up as it's trying to go slower.
Phil
-
- Posts: 14
- Joined: Sun Apr 24, 2005 1:52 am
Thanks for the suggestions
I'm up and running now. I was using a path of:
/axis-cgi/mjpg/video.cgi?
to connect to the Axis 2120s but when I changed it to:
/axis-cgi/jpg/image.cgi?resolution=352x240
the problems went away. I only get about 5 FPS on average but I think that's going to be fine. Once I figured out that was the issue I went ahead and installed FC3 and ZM on a dual Xeon with 4 GB of RAM, which certainly never hurts. =) Does anyone know of a way to use that video.cgi? but with some parameter that will limit the FPS the camera shoves out to zm? Let me know, thanks.
matt
/axis-cgi/mjpg/video.cgi?
to connect to the Axis 2120s but when I changed it to:
/axis-cgi/jpg/image.cgi?resolution=352x240
the problems went away. I only get about 5 FPS on average but I think that's going to be fine. Once I figured out that was the issue I went ahead and installed FC3 and ZM on a dual Xeon with 4 GB of RAM, which certainly never hurts. =) Does anyone know of a way to use that video.cgi? but with some parameter that will limit the FPS the camera shoves out to zm? Let me know, thanks.
matt
Here ya go.
For mjpeg:
http://<servername>/axis-cgi/mjpg/video.cgi
[?<parameter>=<value>[&<parameter>=<value>...]]
Using either req_fps or des_fps (these cannot be used at the same time) it is possible to specify the frame rate from the server.
req_fps = required FPS
des_fps = desired FPS
Required FPS has higher priority than desired FPS if these are used in two different requests simultaneously.
Use req_fps for streams with high priority and des_fps for less important streams.
If you want to just capture by frame:
http://<servername>/axis-cgi/jpg/image.cgi
[?<parameter>=<value>[&<parameter>=<value>...]]
These values work for both jpeg and mjpeg:
resolution=<int>x<int>
Specify the resolution as <width> times <height> number of pixels of the returned image.
compression=<int>
Value 1 to 100
Adjusts the compression level of the image. Higher values correspond to higher compression, i.e. lower quality and smaller image size.
Note: This value is internally mapped and is therefore product-dependent.
rotation=<int>
0, 90, 180, 270
Rotates the image clockwise.
Cheers,
Cordel
For mjpeg:
http://<servername>/axis-cgi/mjpg/video.cgi
[?<parameter>=<value>[&<parameter>=<value>...]]
Using either req_fps or des_fps (these cannot be used at the same time) it is possible to specify the frame rate from the server.
req_fps = required FPS
des_fps = desired FPS
Required FPS has higher priority than desired FPS if these are used in two different requests simultaneously.
Use req_fps for streams with high priority and des_fps for less important streams.
If you want to just capture by frame:
http://<servername>/axis-cgi/jpg/image.cgi
[?<parameter>=<value>[&<parameter>=<value>...]]
These values work for both jpeg and mjpeg:
resolution=<int>x<int>
Specify the resolution as <width> times <height> number of pixels of the returned image.
compression=<int>
Value 1 to 100
Adjusts the compression level of the image. Higher values correspond to higher compression, i.e. lower quality and smaller image size.
Note: This value is internally mapped and is therefore product-dependent.
rotation=<int>
0, 90, 180, 270
Rotates the image clockwise.
Cheers,
Cordel
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Axis is very good at publishing their API. This link takes you to the http api spec for instance.
Phil
Phil