Intermittent zmc issue with monitors (start/terminate/restart loop)

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
User avatar
llama
Posts: 1
Joined: Sat Jan 05, 2019 4:26 am

Intermittent zmc issue with monitors (start/terminate/restart loop)

Post by llama » Sat Jan 05, 2019 4:41 am

I've set up a new installation of Zoneminder 1.32.3 (installed via pkg within FreeBSD 11.2, 3.6GHz modern i3 processor and 32GB RAM) and am having issues getting a stable monitor feed. I'm using ffmpeg 4.1 and installed ZM's dependencies, MySQL etc following the FreeBSD port's instructions.

For a given monitor, it seems that zmc is started up but gives a lot of warnings (

Code: Select all

Unable to receive frame 0: Resource temporarily unavailable, continuing
). After these warnings, zm_monitor indicates that some frames are being captured but at an unusual FPS (either 50 or 100fps when it should be 25). zmc is eventually restarted because it was detected to *not* have been capturing frames past the WATCH_MAX_DELAY setting (I tried bumping this setting up to 60+ seconds but makes no difference). zmc gets terminated and then restarted and this process of start, fail, restart continues ad infinitum. Frames captured can be seen occasionally in the montage so zmc is at least partially working before it gets terminated and restarted. The full debug log for the zmc process is below.

Code: Select all

01/05/19 12:27:04.985995 zmc_m4[102133].DB1-zm_logger.cpp/251 [LogOpts: level=DB1/DB1, screen=OFF, database=INF, logfile=DB1->/var/log/zm/zm_debug.log.33128, syslog=INF]
01/05/19 12:27:04.986118 zmc_m4[102133].DB1-zm_utils.cpp/281 [Detected a x86\x86-64 processor with AVX2]
01/05/19 12:27:04.986358 zmc_m4[102133].DB1-zm_monitor.cpp/2059 [Got 1 for v4l_captures_per_frame]
01/05/19 12:27:04.986511 zmc_m4[102133].DB1-zm_monitor.cpp/406 [monitor purpose=1]
01/05/19 12:27:04.986521 zmc_m4[102133].DB1-zm_monitor.cpp/416 [mem.size SharedData=600 TriggerData=560 VideoStoreData=4128 total=62213512]
01/05/19 12:27:04.986532 zmc_m4[102133].DB1-zm_storage.cpp/94 [No id passed to Storage constructor.  Using default path /opt/zoneminder/events instead]
01/05/19 12:27:04.986540 zmc_m4[102133].DB1-zm_monitor.cpp/420 [Storage path: /opt/zoneminder/events]
01/05/19 12:27:05.006547 zmc_m4[102133].DB1-zm_monitor.cpp/486 [Monitor Front Porch has function 2]
01/05/19 12:27:05.006583 zmc_m4[102133].DB1-zm_monitor.cpp/487 [Monitor Front Porch LBF = '%N - %d/%m/%y %H:%M:%S', LBX = 0, LBY = 0, LBS = 1]
01/05/19 12:27:05.006598 zmc_m4[102133].DB1-zm_monitor.cpp/488 [Monitor Front Porch IBC = 20, WUC = 0, pEC = 0, PEC = 50, EAF = 1, FRI = 100, RBP = 6, ARBP = 6, FM = 0]
01/05/19 12:27:05.006822 zmc_m4[102133].DB1-zm_zone.cpp/862 [Got 1 zones for monitor Front Porch]
01/05/19 12:27:05.015136 zmc_m4[102133].DB1-zm_monitor.cpp/2322 [Loaded monitor 4(Front Porch), 1 zones]
01/05/19 12:27:05.015174 zmc_m4[102133].INF-zmc.cpp/223 [Starting Capture version 1.32.3]
01/05/19 12:27:05.029052 zmc_m4[102133].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://10.0.0.123/unicast]
01/05/19 12:27:05.039919 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/344 [Calling avformat_open_input for rtsp://10.0.0.123/unicast]
01/05/19 12:27:05.105156 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/376 [Opened input]
01/05/19 12:27:05.105191 zmc_m4[102133].INF-zm_ffmpeg_camera.cpp/378 [Stream open rtsp://10.0.0.123/unicast, parsing streams...]
01/05/19 12:27:06.786408 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/503 [Failed to find decoder (h264_mmal)]
01/05/19 12:27:06.786455 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/514 [Video Found decoder h264]
01/05/19 12:27:06.786464 zmc_m4[102133].DB1-zm_ffmpeg.cpp/267 [Dumping stream index i(0) index(0)]
01/05/19 12:27:06.786472 zmc_m4[102133].DB1-zm_ffmpeg.cpp/272 [    Stream #0:0]
01/05/19 12:27:06.786478 zmc_m4[102133].DB1-zm_ffmpeg.cpp/280 [, frames:42, timebase: 1/90000]
01/05/19 12:27:06.786500 zmc_m4[102133].DB1-zm_ffmpeg.cpp/282 [: Video: h264 (High), yuv420p(progressive), 1920x1080]
01/05/19 12:27:06.786512 zmc_m4[102133].DB1-zm_ffmpeg.cpp/227 [25 fps, ]
01/05/19 12:27:06.786524 zmc_m4[102133].DB1-zm_ffmpeg.cpp/229 [90k stream tb numerator , ]
01/05/19 12:27:06.786531 zmc_m4[102133].DB1-zm_ffmpeg.cpp/229 [180k codec time base:]
01/05/19 12:27:06.786538 zmc_m4[102133].DB1-zm_ffmpeg.cpp/337 [
]
01/05/19 12:27:06.786545 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/521 [Calling avcodec_open2]
01/05/19 12:27:06.786629 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/544 [HWACCEL not in use]
01/05/19 12:27:06.786649 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/556 [Audio Found decoder]
01/05/19 12:27:06.786656 zmc_m4[102133].DB1-zm_ffmpeg.cpp/267 [Dumping stream index i(1) index(0)]
01/05/19 12:27:06.786663 zmc_m4[102133].DB1-zm_ffmpeg.cpp/272 [    Stream #0:1]
01/05/19 12:27:06.786670 zmc_m4[102133].DB1-zm_ffmpeg.cpp/280 [, frames:18, timebase: 1/8000]
01/05/19 12:27:06.786682 zmc_m4[102133].DB1-zm_ffmpeg.cpp/282 [: Audio: pcm_alaw, 8000 Hz, 1 channels, s16, 64 kb/s]
01/05/19 12:27:06.786691 zmc_m4[102133].DB1-zm_ffmpeg.cpp/337 [
]
01/05/19 12:27:06.786698 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/563 [Calling avcodec_open2]
01/05/19 12:27:06.786713 zmc_m4[102133].DB1-zm_ffmpeg_camera.cpp/600 [Calling sws_isSupportedInput]
01/05/19 12:27:06.791611 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.825456 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.830325 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.859885 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.883509 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.903845 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.932981 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.960299 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:06.984979 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:07.018688 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:07.034148 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:07.052239 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:07.065444 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:07.078798 zmc_m4[102133].WAR-zm_ffmpeg_camera.cpp/900 [Unable to receive frame 0: Resource temporarily unavailable, continuing]
01/05/19 12:27:07.097715 zmc_m4[102133].INF-zm_monitor.cpp/2477 [Front Porch: images:1 - Capturing at 50.00 fps, capturing bandwidth 65928bytes/sec]
01/05/19 12:27:24.483984 zmc_m4[102133].INF-zm_signal.cpp/40 [Got signal 15 (Terminated), exiting]
01/05/19 12:27:24.544555 zmc_m4[102133].DB1-zm_logger.cpp/255 [Terminating Logger]
The Zoneminder issue is intermittent — yesterday I had 2 of the same cameras functioning fine but saw the same issue occurring when adding a third camera. Now today, I can't get a single camera to stream correctly; I disabled the other cameras when trying to debug this issue.

Cameras are cheap Xiaofang cameras (ZM monitor config screenshots attached), but the cameras stream fine via RTSP on the network — ffmpeg streams/records to a file for hours on end without error; I tested this on the same machine as Zoneminder to ensure there's nothing odd about the network configuration. Likewise VLC plays the streams without issue from another computer. For note, the post-event image count is up at 50 because of the "empty H264" files issue (viewtopic.php?p=107703); without it this high the result is events (when capture was working) would be empty video files.

Cameras are being streamed at 1080p and 25fps but it's worth noting the same issues were seen when dropping the resolution to 720p and 10fps. Other posts suggest RAM issues or availability of tmpfs or shared memory; there's sufficient RAM on the machine and plenty available (eg writing 8GB to /tmp works fine). For note, both ZM_PATH_MAP and ZM_PATH_SWAP are on separate tmpfs mounts.

Let me know if there's any other info I can provide, options I can tweak or tests to run. As mentioned, I'd tried tweaking WATCH_MAX_DELAY and also WATCH_CHECK_INTERVAL without any difference, tried tweaking the camera's internal settings for FPS/resolution, but also Zoneminder's monitor settings for storage, buffers and even Source Type (eg tried as "Remote" but that fails entirely with 400 Bad Request, as expected as it is deprecated/non-recommended to use this).

Thanks!
Attachments
zm3.png
zm3.png (55.83 KiB) Viewed 49 times
zm2.png
zm2.png (53.34 KiB) Viewed 49 times
zm1.png
zm1.png (66.57 KiB) Viewed 49 times

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests