Zoneminder works only after reboot for 20 secs

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
delumerlino
Posts: 3
Joined: Fri Nov 29, 2019 11:22 am

Zoneminder works only after reboot for 20 secs

Post by delumerlino »

Good morning,
I have installed Zoneminder 1.32.3 on my Ubuntu 18.04 LTS.
I have added this camera https://www.tibs.it/K32VK1X70BIMA/mibao ... a-app-p450 and configured onvif

VLC and onvif device manager can stream without any problem. Its path is rtsp://<user>:<pass>@<ip>:554/realmonitor?channel=0&stream=0.sdp

I have added the monitor, and if I set as FFmpeg source type I can log
Unable to open input rtsp://<user>:<pass>@<ip>:554/realmonitor?channel=0&stream=0.sdp due to: Operation now in progress

No other monitors are running and I have rebooted the camera...

If I set the source type as libvlc (after installing obviously) I can log

getStreamCmdResponse stream error: Socket /var/run/zm/zms-055163s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors()

Socket /var/run/zm/zms-055163s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information.

Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0

If I restart the service normally works for some seconds and then a lot of errors...

Please help me!
Thanks
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Zoneminder works only after reboot for 20 secs

Post by snake »

Do you have the right resolution? VLC will output it.

What FPS and Resolution? Try lowering it. If you are on a SBC or an old system, it might not be able to keep up. You can also try passthrough.

Are you using x86-64 or ARM?
delumerlino
Posts: 3
Joined: Fri Nov 29, 2019 11:22 am

Re: Zoneminder works only after reboot for 20 secs

Post by delumerlino »

Yep, the resolution is right (1920x1080) and already tried for different (1280x720) and so on...
Maximum FPS is set to 30 while the camera works with 20, and tried to lower to 25...

The system is running on a dedicated Microserver N54L, htop shows the memory (8 Gigs) is used under 20% and the processor is idle...

I am unsing a X64 system

Thanks :)
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Zoneminder works only after reboot for 20 secs

Post by snake »

Is that maximum FPS setting on ZM? Blank that out. Max FPS on ZM can cause these types of issues.

On the camera website, set it to 720p and say 5 FPS, and then try the stream path in ZM. Get it working, check the CPU load, then increase either resolution or FPS afterwards. Don't try to start with 2K, and 20FPS. It's better to start at a lower resolution. Passthrough may be able to run at higher FPS, but first you want the stream to be stable.
delumerlino
Posts: 3
Joined: Fri Nov 29, 2019 11:22 am

Re: Zoneminder works only after reboot for 20 secs

Post by delumerlino »

I have cleared FPS on zoneminder without success...
I cannot set any value in the camera...

Here is the output of ffmpeg, if I google it I cannot find any relevant solution:

ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://<user>:<pass>@<ip>/realmonitor?channel=0&stream=0.sdp" -c copy -map 1 foo.mp4
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-i' ... matched as input url with argument 'rtsp://<user>:<pass>@<ip>/realmonitor?channel=0&stream=0.sdp'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '1'.
Reading option 'foo.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://<user>:<pass>@<ip>/realmonitor?channel=0&stream=0.sdp.
Successfully parsed a group of options.
Opening an input file: rtsp://<user>:<pass>@<ip>/realmonitor?channel=0&stream=0.sdp.
[tcp @ 0x558b74920260] No default whitelist set
[rtsp @ 0x558b7491e100] SDP:
v=0
o=- -1102587409 -1102587409 IN IP4 192.168.1.100
t=0 0
c=IN IP4 192.168.1.100
a=packetization-supported:Puwell
m=video 0 RTP/AVP 96
a=control:trackID=0
a=rtpmap:96 H264/90000
a=framerate:0S
a=fmtp:96 profile-level-id=640028; packetization-mode=1; sprop-parameter-sets=Z2QAKKw7UDwBE/LCAAADAAIAAAMAUQg=,aO484QBCQgCEhARMUhuTxXyfk/k/J8nm5MkkLCJCkJyeT6/J/X5PrycmpMA=
m=audio 0 RTP/AVP 8
a=control:trackID=1
a=rtpmap:8 PCMA/8000

[rtsp @ 0x558b7491e100] video codec set to: h264
[rtsp @ 0x558b7491e100] RTP Profile IDC: 64 Profile IOP: 0 Level: 28
[rtsp @ 0x558b7491e100] RTP Packetization Mode: 1
[rtsp @ 0x558b7491e100] Extradata set to 0x558b749206c0 (size: 75)
[rtsp @ 0x558b7491e100] audio codec set to: pcm_alaw
[rtsp @ 0x558b7491e100] audio samplerate set to: 8000
[rtsp @ 0x558b7491e100] audio channels set to: 1
rtsp://<user>:<pass>@<ip>/realmonitor?channel=0&stream=0.sdp: Invalid data found when processing input
User avatar
snake
Posts: 337
Joined: Sat May 21, 2016 2:20 am

Re: Zoneminder works only after reboot for 20 secs

Post by snake »

It's possible that the camera is not supported. Did you try libVLC after removing max FPS? If you can get it to work for 20 seconds, it's likely there is a way to get it to work 100%. It sounds like an issue of memory, or CPU not being able to keep up. However, it looks like ffmpeg doesn't like the stream. You can try remote, and adjust the settings, RTP vs RTSP, UDP, etc... I'm not knowledgeable about the protocol, but there is a chance you can get it to work.

Getting access to the camera configuration, via either tool or website would be important also.
Post Reply