Hi,
I have a few hikvision DS-2CD2135F-IS cameras that i'm trying to setup, just to monitor in zoneminder.
FFmpeg sometimes works - it seems very intermittent but, only ever works for a single camera - as soon as I add a second camera, that camera won't work (even if it's configured identically, for an identical camera). And even when just one is setup, sometimes the source is red and, when i click on it i get the broken image logo. Sometimes it works and I get a solid blue screen.
libVLC also only sometimes works but when it works, half the preview is green and, it has a horrendous refresh rate (1fps). Using VLC media player (from another machine as I have no gui on the raspberry pi 3 which zoneminder is installed on), it works just fine.
All of these are using RTSP, with urls that have been tested to work in VLC.
I can't find a lot of information on these particular cameras, and I have tried all of the suggested configurations in the wiki: https://wiki.zoneminder.com/Hikvision
I'm using Debian Jessie on a raspberry pi 3.
I have also tried setting kernel shmall and shmax values as suggested somewhere - but this didn't seem to make any difference.
If anyone has any suggestions, it would be most appreciated. I have put my logs on pastebin: http://pastebin.com/BPuryh4g - but i'm not sure if they actually have anything of use in them... I notice the mention something about using jpeg - which seems odd given that I configured it to use RTSP:
05/18/16 15:24:37.521780 zms[2377].DB1-zms.cpp/102 [Query: mode=jpeg&scale=100&m axfps=30&buffer=1000&monitor=11&connkey=314367&rand=1463556277]
Thanks
Hikvision 2135/only one works at a time
-
- Posts: 494
- Joined: Sun Jun 29, 2014 1:12 pm
- Location: Melbourne, AU
Re: Hikvision 2135/only one works at a time
1 camera fine 2 cameras breaks sounds like resource issues.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Random Selection of Cameras (Dahua and Hikvision)
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
Re: Hikvision 2135/only one works at a time
Ignore anything you read about setting shmall and shmax. That will have no effect. ZoneMinder has not used those values in a long time.
You have not told us your camera configuration, particularly the resolution. Based on what you've told us, you are likely running out of memory. ZoneMinder uses mapped memory, which defaults to using /dev/shm (a.k.a. tmpfs). By default it will only expand to 50% of your physical ram, which for you means 512MB. If you are using an HD camera, you could certainly use more than half of that with just a single camera, which leaves insufficient room for the second camera.
It is possible to configure your /dev/shm to use more than 50% of your physical ram, but in your case you will starve the rest of your OS of memory, which will cause other problems. Not only will swapping to disk be really slow, you will also wear out your sd card.
You have not told us your camera configuration, particularly the resolution. Based on what you've told us, you are likely running out of memory. ZoneMinder uses mapped memory, which defaults to using /dev/shm (a.k.a. tmpfs). By default it will only expand to 50% of your physical ram, which for you means 512MB. If you are using an HD camera, you could certainly use more than half of that with just a single camera, which leaves insufficient room for the second camera.
It is possible to configure your /dev/shm to use more than 50% of your physical ram, but in your case you will starve the rest of your OS of memory, which will cause other problems. Not only will swapping to disk be really slow, you will also wear out your sd card.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/
-
- Posts: 2
- Joined: Wed May 18, 2016 7:13 am
Re: Hikvision 2135/only one works at a time
Looks like you're both right - it's resources. Resolution is 2536x1944 on each of the cameras. I thought that since I was going to use the motion detection built into the cameras as opposed to in zoneminder, resources wouldn't be an issue.
What I neglected to account for is that zoneminder is also decoding the rtsp stream, which i suppose is chewing up resources. It works at lower resolutions and, ultimately I setup the pi as an openvpn server - and I can access the streams just fine from my phone/other computers even though the traffic is passing through it.
Thanks for your help! At least it lead me to realise that what I was doing wasn't actually feasible as opposed to being a configuration issue.
What I neglected to account for is that zoneminder is also decoding the rtsp stream, which i suppose is chewing up resources. It works at lower resolutions and, ultimately I setup the pi as an openvpn server - and I can access the streams just fine from my phone/other computers even though the traffic is passing through it.
Thanks for your help! At least it lead me to realise that what I was doing wasn't actually feasible as opposed to being a configuration issue.