From a81160bea1e05e465be2abf5c2acff464ff2ff80 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Mon, 3 Oct 2022 21:12:27 +0300 Subject: [PATCH] Fix support Escam Q6 camera --- pkg/rtsp/conn.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/rtsp/conn.go b/pkg/rtsp/conn.go index e80fa41c..69a06446 100644 --- a/pkg/rtsp/conn.go +++ b/pkg/rtsp/conn.go @@ -392,12 +392,16 @@ func (c *Conn) SetupMedia( // we send our `interleaved`, but camera can answer with another // Transport: RTP/AVP/TCP;unicast;interleaved=10-11;ssrc=10117CB7 - // Transport: RTP/AVP/TCP;unicast;destination=192.168.1.123;source=192.168.10.12;interleaved=0 + // Transport: RTP/AVP/TCP;unicast;destination=192.168.1.111;source=192.168.1.222;interleaved=0 // Transport: RTP/AVP/TCP;ssrc=22345682;interleaved=0-1 s := res.Header.Get("Transport") // TODO: rewrite if !strings.HasPrefix(s, "RTP/AVP/TCP;") { - return nil, fmt.Errorf("wrong transport: %s", s) + // Escam Q6 has a bug: + // Transport: RTP/AVP;unicast;destination=192.168.1.111;source=192.168.1.222;interleaved=0-1 + if !strings.Contains(s, ";interleaved=") { + return nil, fmt.Errorf("wrong transport: %s", s) + } } i := strings.Index(s, "interleaved=")