Strange MJPEG frame rate behaviour

Forum for questions and support relating to the 1.29.x releases only.
Locked
krasnal
Posts: 7
Joined: Sat Apr 23, 2016 8:45 am

Strange MJPEG frame rate behaviour

Post by krasnal »

I'm new to Zoneminder and have recently (and successfully) installed v1.29.0 on a Debian 8 server build, running on a 4-(real)-core machine with 6GB of memory. The LAN is gigabit and, for now, the only camera is a 2.0 Mpixel dome camera from a company called BCS, model number BCS-DMIP3200IR-E, which is capable of up to 25 fps x 1920x1080 in either MJPEG or H264.

I'm still exploring and fine tuning things but have hit what seems to be some odd behaviour when using the main MJPEG stream. (I've found no issues with H264, so far, so this issue is specific to MJPEG.)

The instructions I have for the camera state that the H264 stream should be accessed via RTSP (and works as expected) and the MJPEG stream should be accessed via the HTTP URL http://<ip address>/axis-cgi/mjpg/video.cgi. (Yep, there's no user/password required!)

The issue is this: I'd like to use the secondary stream for motion detection and online viewing, and the main stream to record at 5fps MJPEG 1920x1080 only when an alarm is triggered. However, when I set the frame rate on the main stream to 5 fps MJPEG, Zoneminder only gives me 2.5 fps, as indicated in the log, as shown in the browser and as written to disk. That is to say, it looks like it realy is only 2.5fps. Using top, cpu for the relevant zmc process is hovering around 20% and memory use is around 8%. Overall shm use is only 11-12% and overall machine load, including the use of a lo-res secondary stream currently set at only 2fps, averages around 0.22.

If I increase the frame rate on the camera, to 12 fps, the cpu of the zmc process jumps to about 50%, which is a pro-rata increase from the 5fps cpu usage, memory remains at 8%, and Zoneminder now gives around 9.5-10 fps.

If I reduce the frame rate on the camera to 1 fps, the cpu falls to arounf 4% (again a pro-rata reduction) but the frame rate falls to one frame every 2.5-3 seconds.

Nowhere in the log can I see any errors about dropped frames at any MJPEG setting. Setting the picture from 24-bit to 32-bit, which is sometimes recommended on this forum, seems to make no difference, except to increase memory usage of zmc from 8% to 10.5%.

Clearly, the process is not cpu-bound, since the processor usage is only around 50% at 12 fps. Neither does memory look to be a problem, the disk is currently an SSD but the problem also occurs in the monitor state, so isn't likely to be i/o bound either. And, perversely, the number of frames I get for a given amount of cpu is actually worse at lower frame rates than at higher frame rate.

Though I can get a real 5fps by increasing the camera to somewhere around 8-9 fps, clearly something strange is happening. If anyone could provide some pointers to debugging this issue, I'd be most grateful. It could, of course, be a problem in the camera but, although VLC will show the HTTP stream, it does not show the frame rate coming from the camera. I have yet to find anything that can show this.

Edited to add screenshots:
Attachments
General Tab
General Tab
hall2.jpeg (68.29 KiB) Viewed 1705 times
Source Tab
Source Tab
hall1.jpeg (67.65 KiB) Viewed 1705 times
Locked