Page 1 of 1

Troubleshooting two cameras that won't work at the same time [Solved]

Posted: Tue Sep 01, 2020 11:10 am
by Grewen
I could need some help with troubleshooting an issue configuring two cheap aliexpress cameras to work at the same time.
They both work if only one is connected. If both are hooked up only one will show video and record events.
I´ve tried reducing the resolution of the stream to all the differnent ones reading that it might be a memory issue but it doesn't help.
I have one camera with green name, function(modect) and source and it is recording and showing events. The second camera has red name and source while function (modect) is green...?
I then disconnect the first camera and then the second camera turns all green and start recording events.
Could it be some confict in the setup?

Running ZM v1.34.16 on a raspi 4 (4GB) running Raspberry Pi OS booting from a 250gb SSD.
/dev/shm: 10%
grabbing the stream url from onvif device manager they look something like this:
camera1: rtsp://10.0.0.10:554/user=admin_password=xyz987_channel=0_stream=0.sdp?real_stream
camera2: rtsp://10.0.0.11:554/user=admin_password=abc123_channel=0_stream=0.sdp?real_stream

cheers

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 12:41 pm
by Magic919
Can you configure both monitors to look at one camera and see how it behaves.

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 12:47 pm
by Grewen
Magic919 wrote: Tue Sep 01, 2020 12:41 pm Can you configure both monitors to look at one camera and see how it behaves.
Do you mean clone the working camera? if so, no only one camera works at the time also if they are identical...

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 1:08 pm
by Magic919
What's the lowest resolution and frame rate the cameras can produce? is it at the level the Pi should cope with?

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 4:03 pm
by Bluemax
Maybe they have the same mac address?

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 4:33 pm
by Grewen
Magic919 wrote: Tue Sep 01, 2020 1:08 pm What's the lowest resolution and frame rate the cameras can produce? is it at the level the Pi should cope with?
I've tried setting both to 176x120 QCIF... but only one will work

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 4:36 pm
by Grewen
Bluemax wrote: Tue Sep 01, 2020 4:03 pm Maybe they have the same mac address?
Good point, but no, they have different mac address and get different IP from DHCP

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 5:17 pm
by fontiano
Can you post logs?

It's a very strange problem.. try to configure and add third camera to zoneminder. If you don't have other cameras available you can install an application that transform your smartphone in ip camera and attach it to zoneminder (via wifi) to see if the problem is your zoneminder installation or if those "strange" cameras are the problem.

Re: Troubleshooting two cameras that won't work at the same time

Posted: Tue Sep 01, 2020 10:53 pm
by burger
You didn't mention what FPS you are running. Lower FPS to something like 5 to start.

https://wiki.zoneminder.com/Single_Board_Computers

RPI is limited. Not a good place to start with ZM. Lower FPS, lower resolution. Don't use 'cheap aliexpress cameras'. That is a recipe for disaster. Start with Monitor, not Record, or Mocord, etc.

Re: Troubleshooting two cameras that won't work at the same time

Posted: Wed Sep 02, 2020 7:21 am
by Magic919
Grewen wrote: Tue Sep 01, 2020 4:33 pm
Magic919 wrote: Tue Sep 01, 2020 1:08 pm What's the lowest resolution and frame rate the cameras can produce? is it at the level the Pi should cope with?
I've tried setting both to 176x120 QCIF... but only one will work
Can you confirm you have set this on the cameras, not ZM.

Then have you validated the camera output? VLC, ffprobe or whatever will do this.

Re: Troubleshooting two cameras that won't work at the same time

Posted: Wed Sep 02, 2020 12:50 pm
by Beetleboy
I have seen this problem on Raspberry pi as well. What worked for me was increasing the amount of memory allocated to the GPU, a setting that can be modified using the raspi-config command, advanced options, memory split. I allocated 256 meg on my Pi 4 and I can support three cameras with that at 6 frames per second

Re: Troubleshooting two cameras that won't work at the same time

Posted: Thu Sep 03, 2020 10:07 am
by Grewen
Beetleboy wrote: Wed Sep 02, 2020 12:50 pm I have seen this problem on Raspberry pi as well. What worked for me was increasing the amount of memory allocated to the GPU, a setting that can be modified using the raspi-config command, advanced options, memory split. I allocated 256 meg on my Pi 4 and I can support three cameras with that at 6 frames per second
YES! This solved it. Default was set to 64. I upped it to 512 and now they both work at 960p (dev/shm at 11%). Also checked with zmninja and it worked too.

Thanks to all for your help!

Re: Troubleshooting two cameras that won't work at the same time [Solved]

Posted: Wed Sep 16, 2020 8:44 pm
by Grewen
Just an update. Now running 3 cameras, all connected through WiFi, including the raspberry. I upped the split memory to 800 (going above will crash the raspberry)