shm issue

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Soph
Posts: 3
Joined: Wed May 15, 2024 9:56 am

shm issue

Post by Soph »

Greetings zoneminder users,

I am a new user of this program and i installed it following this guide :
https://zoneminder.readthedocs.io/en/1. ... ebian.html

My rtsp camera feed works correctly in VLC

I'm trying to monitor my camera with remote/ffmpeg/vlclib, But i have errors in my logs and i can't view the camera feed :

Code: Select all

Monitor shm is not connected
Unable to connect to monitor id 1 for streaming
Can't open memory map file /dev/shm/zm.mmap.1: No such file or directory
Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested
Failed to prime capture of initial monitor
This seems to be a memory issue but the zoneminder console shows /dev/shm is at 1%
I have tried to chmod 777 /dev/shm or chown www-data:www-data and it did not resolve the issue.
The file zm.mmap.1 is however created each time and has the correct permissions and user:group

Thank you in advance for your help and your patience.

Here are the specs of my camera:
Camera : UVC G3 Flex
Width: 1920 px
Height: 1080 px
Bitrate: 2047 kbps
FPS : 25
RTSP Url : rtsp://10.2.43.101:554/s0
- Ubiquidi confirmed that its compatible with zoneminder

Specs of my VM running zoneminder:
OS : Debian 12 x64 bits
Ram : 8GB (shared memory = 70%)
CPUs: 2
one HDD for the OS and zoneminder
one HDD for the /events and /images of zoneminder
Mariadb v15.1 database for zoneminder
User avatar
iconnor
Posts: 2922
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: shm issue

Post by iconnor »

These lines tell us that capture is failing. Not sure why though if it works in vlc. Maybe turn on debug logging and you'll get more info.

Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested
Failed to prime capture of initial monitor
Soph
Posts: 3
Joined: Wed May 15, 2024 9:56 am

Re: shm issue

Post by Soph »

Hello,

Thank you for your reply,
I've enable debug logging sadly it doesn't tell me anything new :
In my firewall i allowed udp/tcp traffic on port 554, do it need more rules?

Code: Select all

zmc_m1		3538	ERR	Failed to prime capture of initial monitor	zmc.cpp	258
zmc_m1		3538	ERR	Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested	zm_ffmpeg_camera.cpp	325
zmc_m1		3538	ERR	Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested	zm_ffmpeg_camera.cpp	325
zmc_m1		3538	INF	Starting Capture version 1.36.33	zmc.cpp	220
zmdc		3538	INF	'zmc -m 1' started at 24/05/15 14:16:55	zmdc.pl	-
zmdc		1131	INF	'zmc -m 1' starting at 24/05/15 14:16:55, pid = 3538	zmdc.pl	-
zmdc		1131	INF	Starting pending process, zmc -m 1	zmdc.pl	-
zmdc		1131	INF	'zmc -m 1' exited normally	zmdc.pl	-
zmc_m1		3533	ERR	Failed to prime capture of initial monitor	zmc.cpp	258
zmc_m1		3533	ERR	Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested	zm_ffmpeg_camera.cpp	325
zmdc		1131	INF	'zmc -m 1' sending stop to pid 3533 at 24/05/15 14:16:54	zmdc.pl	-
zmwatch		1171	WAR	Restarting capture daemon for 1 cam-e094cb15, no image since startup. Startup time was 1715782565 - now 1715782614 > 45	zmwatch.pl	-
zmc_m1		3533	ERR	Failed to prime capture of initial monitor	zmc.cpp	258
zmc_m1		3533	ERR	Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested	zm_ffmpeg_camera.cpp	325
zmc_m1		3533	ERR	Failed to prime capture of initial monitor	zmc.cpp	258
zmc_m1		3533	ERR	Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested	zm_ffmpeg_camera.cpp	325
zmc_m1		3533	ERR	Unable to open input rtsp://10.2.43.101:554/s0 due to: Immediate exit requested	zm_ffmpeg_camera.cpp	325
dougmccrary
Posts: 1245
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: shm issue

Post by dougmccrary »

In my firewall i allowed udp/tcp traffic on port 554, do it need more rules?
No. Most firewalls only block unrequested traffic. ZM is requesting from the camera, so the firewall should have no effect.

Speaking of udp/tcp, did you try both with your camera? Some only work one or the other.
Soph
Posts: 3
Joined: Wed May 15, 2024 9:56 am

Re: shm issue

Post by Soph »

Hi,

I've solved my problem!
I ended up making a rule in my router to allow all traffic from Zoneminder to my camera and it ended up working!
It seems my rules i added were incorrect.

Best regards,
Soph.
mikb
Posts: 610
Joined: Mon Mar 25, 2013 12:34 pm

Re: shm issue

Post by mikb »

dougmccrary wrote: Wed May 15, 2024 10:51 pm No. Most firewalls only block unrequested traffic.
That depends on the firewall "policy" -- the usual/simplest is to block ALL incoming connections (unless allowed) and allow ALL outgoing connections (unless blocked). This mostly keeps you safe from external bad actors while allowing your computer to see out AND receive responses to those connections.

An alternative strategy is block everything IN and OUT unless explicitly allowed. This is the most secure. However it leads to numerous "Why doesn't anything work?" questions where people don't know what rules to add to allow their OUTGOING activities to escape :)

@Soph may have such a system, hence needing to add rules to make things work.
Post Reply