Community discussions

MikroTik App
 
cichoo
just joined
Topic Author
Posts: 1
Joined: Wed Dec 06, 2023 3:55 pm

RTSP forwarding

Wed Dec 06, 2023 4:03 pm

Hi.

I have a problem with forwarding cameras via RTSP. Namely, after port forwarding, connection occurs after about 10 seconds. What could be the reason?

Thanks
Michal
 
tangent
Forum Guru
Forum Guru
Posts: 1404
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: RTSP forwarding

Wed Dec 06, 2023 7:02 pm

RTSP is merely the "VCR buttons" protocol for video streaming: play, pause, stop, fast-forward… It sets up the actual A/V streams, but it does not carry them. Those go out over separate streams, most commonly raw UDP or RTP.

When you put the RTSP server on the other side of a firewall, unless that firewall digs into the RTSP protocol exchange to figure out what the two ends negotiated and let that through, too, the negotiated streams won't start. I would guess that the 10 seconds is taken up as both ends negotiate one thing after another and find that each fails in turn, finally hitting on something that happens to bypass the firewall.

The easiest fix is to set up a VPN and connect over that, since it puts everything onto a single network, allowing the RTSP negotiations to succeed on the first try.

If for whatever reason that cannot work, then you will have to set up some kind of RTSP gateway at the border that knows how to proxy streams across the boundary. Working out how to achieve that will require knowing what the two ends are trying to negotiate, so that you can facilitate that.

Or, plan B: give up on RTSP and use a protocol meant to carry both the "VCR buttons" commands and the A/V streams over a single TCP connection, avoiding the need for clever deep-packet inspection and/or proxying techniques, something like HLS.

Who is online

Users browsing this forum: No registered users and 3 guests