Missing keepalive message in REMOTE RTSP

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
osk
Posts: 9
Joined: Mon Nov 13, 2017 1:19 pm

Missing keepalive message in REMOTE RTSP

Post 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
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Missing keepalive message in REMOTE RTSP

Post by iconnor »

Hey thanks for this post, I'll consider merging your changes.

Have you tried using the ffmpeg input method with these cameras?
osk
Posts: 9
Joined: Mon Nov 13, 2017 1:19 pm

Re: Missing keepalive message in REMOTE RTSP

Post 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.
Post Reply