Page 1 of 1

Missing keepalive message in REMOTE RTSP

Posted: Mon Nov 13, 2017 1:56 pm
by osk
Hi

I have purchased several 5Mpix IP cameras from Aliexpress seller Ganvis (https://www.aliexpress.com/store/540241). These are inexpensive cameras with great resolution and moderate night capability. I am using these cameras with ZM 1.30.4 in RTP/RTSP method (Source Type REMOTE). The only problem in this configuration is that process zmc will be jammed very often and the process will be automatically restarted. Restart of zmc process was causing every now and then false alarm event as the received image was corrupted during restart.

I investigated this problem and after hours of debugging found out, that the camera requires keepalive messages from zm_rtsp.cpp, but these messages were missing. Zm_rtsp.cpp expects to get "GET_PARAMETER" command from camera in order to send keepalive messages, but my cameras did not send the this option.

The workaround I am currently using is to force zm_rtsp.cpp send keepalive messages.
Code changes:

Line 365 zm_rtsp.cpp
-- bool sendKeepalive = false;
++ bool sendKeepalive = true;

Line 508 zm_rtsp.cpp
-- int timeout = 0;
++ int timeout = 60;

This change made the trick and now all my cameras have been working over a week without any jamming.

I think that ZoneMinder monitor configuration should have an option to force keepalive message sending. Most likely my cameras are not the only ones needing keepalive messages.

Cheers
osk

Re: Missing keepalive message in REMOTE RTSP

Posted: Tue Nov 28, 2017 11:54 am
by iconnor
Hey thanks for this post, I'll consider merging your changes.

Have you tried using the ffmpeg input method with these cameras?

Re: Missing keepalive message in REMOTE RTSP

Posted: Thu Dec 07, 2017 4:15 pm
by osk
iconnor wrote: Tue Nov 28, 2017 11:54 am Have you tried using the ffmpeg input method with these cameras?
I have tried ffmpeg input method, but the result was even worse than with remote method. Quite often when the video feed was broken from camera due to missing keepalive message, ffmpeg method generated broken image that caused false alarm recording.