From 00f66555e2ee6a4f91a006cde77d4010680b122c Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Sat, 29 Apr 2023 22:03:38 +0200 Subject: [PATCH] fix timeout with some cameras by decreasing interval between keepalives (#265) (https://github.com/aler9/mediamtx/issues/1403) --- README.md | 2 +- client.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ba3f9e2..4259f269 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Features: * Parse RTSP elements * Encode/decode format-specific frames into/from RTP packets. The following formats are supported: * Video: H264, H265, M-JPEG, VP8, VP9 - * Audio: G711 (PCMA, PCMU), G722, LPCM, MPEG-2 Audio (MP3), MPEG-4 Audio (AAC), Opus + * Audio: G711 (PCMA, PCMU), G722, LPCM, MPEG-2 audio (MP3), MPEG-4 audio (AAC), Opus ## Table of contents diff --git a/client.go b/client.go index 91bab5f7..2fafb4c0 100644 --- a/client.go +++ b/client.go @@ -361,7 +361,8 @@ func (c *Client) Start(scheme string, host string) error { c.senderReportPeriod = 10 * time.Second } if c.udpReceiverReportPeriod == 0 { - c.udpReceiverReportPeriod = 10 * time.Second + // some cameras require a maximum of 5secs between keepalives + c.udpReceiverReportPeriod = 5 * time.Second } if c.checkStreamPeriod == 0 { c.checkStreamPeriod = 1 * time.Second