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 (

). 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.

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).