3 Identical Cameras, Only one shows video: SOLVED

Forum for questions and support relating to the 1.29.x releases only.
Locked
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

3 Identical Cameras, Only one shows video: SOLVED

Post by Eric0321 »

I have ZM up and running but it will only pull video from one of my three cameras. They are all the same model, DCS-932L, and each camera has identical settings on the camera and within ZM other than the IP address. I verified that all three cameras are working and producing an image by going to their corresponding jpeg.cgi URL (which is the host name and path I am using under each monitor's settings):


http://192.168.1.50/image/jpeg.cgi
http://192.168.1.51/image/jpeg.cgi
http://192.168.1.52/image/jpeg.cgi

All three show images and refresh correctly when I browse them directly. ZM will only consume from http://192.168.1.50/image/jpeg.cgi The other three monitors show up as red under the Source column and will not display the video from 192.168.1.51 and 192.168.1.52. Any ideas why it would do that? I also created a cameras.html file that shows each jpeg.cgi feed above, it works for all three cameras.

Any help appreciated.

Image
Image
Last edited by Eric0321 on Mon Dec 19, 2016 3:23 am, edited 2 times in total.
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Very odd development...
If I change the pixels for the width and height for each camera ZM will then see all of them, not ideal obviously as I'd like to use 640x480 for all.

So:
Monitor-1 is 640x480
Monitor-2 is 320x240
Monitor-3 is 160x120

If I change them all back to being 640x480 only Monitor-1 can be viewed from ZM again... This doesn't make any sense to me.
marco123
Posts: 25
Joined: Thu Mar 12, 2015 7:38 am

Re: 3 Identical Cameras, Only one shows video

Post by marco123 »

i have 2 cam ...
1) edimax
2) DCS-931
my remote host name is : admin:1234@192.168.1.133 / 134 (login & password are admin:1234 )
my remote host port are 8081 ... 8080 ...
931.jpg
931.jpg (41.93 KiB) Viewed 14374 times
edimax.jpg
edimax.jpg (41.34 KiB) Viewed 14374 times
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: 3 Identical Cameras, Only one shows video

Post by PacoLM »

Check your memory, maybe you do not have enough memory to support your 3 cams using the same resolution, so when you lower it, you are able to see the image.

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Thanks for the above suggestions.

-Authentication for Snapshot Viewing is disabled on each camera so I don't need to put the user:pass@IPADDRESS, verified working by directly viewing the jpeg.cgi stream from a web browser.

-I tried changing the port of 192.168.1.51 to 81 but it still would not be seen by ZM

-The server I am running ZM on has 64GB of RAM with 2x Xeon E5-2660 CPUs. Though it is running inside of a docker container https://hub.docker.com/r/aptalca/zoneminder-1.29/ I'll check to see how much memory is being allocated within the container. I couldn't imagine that three streams of 640x480 would be a problem for it but worth checking. -UPDATE- The memory from the server appears to pass through to the container, memory isn't a problem.

So far the only thing that I can change for ZM to see all three is change the pixel dimensions to be different for each camera.
mikb
Posts: 661
Joined: Mon Mar 25, 2013 12:34 pm

Re: 3 Identical Cameras, Only one shows video

Post by mikb »

Try: Change the FIRST one to 160x -- the 2nd to 320x and the third to 640x480 -- and restart ZM -- which one works *now*?

Could be the order of start up will allow only the first camera?

Could be a memory issue if you now get camera 1 and 2, but not 3 ... if you see what I mean!

Or Try: set them all to 160x and see if they work better, temporarily, and for fault finding only :)

What changes? What stays the same?
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Swapping Monitor-1 and Monitor-2 so that 1 is 160x120 and 2 is 640x480 allows 2 and 1 to be seen by ZM, 3 is still at 640x480 and isn't seen. So it appears that whichever camera is setup as 640x480 first is seen. If I set the others to different resolutions it will see them.

Setting all cameras to 160x120 allows ZM to see them all. So perhaps it is indeed a memory issue, which I don't understand because it has oodles available to it. Maybe there is a setting actually limiting the container's memory? When I open a bash shell from within the container it gives the same memory available as outside of the container, which I would assume means that it has that much memory available inside the container.

320x340 is working for all now too. Weird... I tried setting two of them at 320x240 last night with no luck. I'll try 640x480 again.
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Tried to set Monitor-3 back to 640x480 and it does not work, 2 and 1 were still at 320x240 and work

Changed all back to 640x480 and only 1 works. Infuriating :lol:
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Here is what the log is saying for Monitor-1 and Monitor-2

zmc_m3 1767 ERR Unable to decode jpeg zm_remote_camera_http.cpp 1151
zmc_m3 1767 ERR Failed requesting writeable buffer for reading JPEG image. zm_image.cpp 1051
zmc_m3 1767 ERR Held buffer is undersized for requested buffer zm_image.cpp 331

The buffer settings for each monitor are identical. It's sounding more like a memory issue, but the container appears to have full access to the 64GB of RAM so I find that confusing.

This is only when I use 640x480. I can get 320x240 working for all cameras. Want 640x480 for obvious reasons...
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Another Development:
If I reduce the Image Buffer Size (frames) setting for each camera to 25 down from 50 I can see two cameras at 640x480 now. So it is a shared memory problem. I now need to figure out how to increase this within the docker container or whether increasing it for the host OS accomplishes that.

Host OS is Ubuntu 16.04.1 LTS x86_64 Server

UPDATE:

All three cameras work now with the below settings:
Image

I want to increase the shared memory so that I can put the settings back up to default. I'm not sure how to do that yet. I have more that sufficient RAM to handle this. Not sure why it would be set so low by default.
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Here are my current share memory settings:

user@server:/etc/sysctl.d$ cat /proc/sys/kernel/shmmax
18446744073692774399

user@server:/etc/sysctl.d$ cat /proc/sys/kernel/shmall
18446744073692774399

user@server:/etc/sysctl.d$ ipcs -l

------ Messages Limits --------
max queues system wide = 32000
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 18014398509465599
max total shared memory (kbytes) = 18014398442373116
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 32000
max semaphores per array = 32000
max semaphores system wide = 1024000000
max ops per semop call = 500
semaphore max value = 32767

I'm not yet sure how to modify it or what to modify it to. I read that these settings are passed to the docker containers so modifying it on the host OS should be fine.
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video

Post by Eric0321 »

Solved!

The /dev/shm mount within the container was only 14MB and was insufficient to handle the three cameras @ 640x480.

I passed the host OS's /dev/shm in as a volume instead of using the container's /dev/shm and it fixed it. :-)

Thanks for the assistance!
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: 3 Identical Cameras, Only one shows video: SOLVED

Post by PacoLM »

Congratulations!

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Eric0321
Posts: 10
Joined: Sun Dec 18, 2016 1:06 am

Re: 3 Identical Cameras, Only one shows video: SOLVED

Post by Eric0321 »

Thanks. I had a difficult time understanding how memory could have been the issue with so much RAM available. Now that I know what the problem was it makes sense with the way shared memory and/or Mmap mapped memory is utilized.
spyderdyne
Posts: 4
Joined: Mon Aug 28, 2017 4:02 pm

Re: 3 Identical Cameras, Only one shows video: SOLVED

Post by spyderdyne »

No video at all on 1.30.4. Only stills. CGI fix doesnt seem to help. Also chmod 777 on /var/lib/zoneminder/cgi-bin/zms doesnt fix so probably not a perms issue with the nph-zms symlink. More details here:

<url>https://github.com/aptalca/docker-zonem ... es/14</url>

Camera setup here:

<url>viewtopic.php?t=26190</url>

1.30.4 also seems to break HTTP auth support, at least on AXIS IP cams.

UPDATE>>>

root@ayana-angel:~# df -m /var/lib/lxd/devices/zoneminder/disk.dev-shm/
Filesystem 1M-blocks Used Available Use% Mounted on
tmpfs 8008 199 7809 3% /var/lib/lxd/devices/zoneminder/disk.dev-shm
root@ayana-angel:~# df -m /dev/shm
Filesystem 1M-blocks Used Available Use% Mounted on
tmpfs 8008 199 7809 3% /dev/shm

mapping the container SHM to the host SHM did not change the behavior.
Locked