RTSP issue: streaming plugin connects to remote server but doesn't receive any media

Hello, I’m trying to set up janus to broadcast some IP cameras, unfortunately I’m having some issues.
From the logs i get:
[b1f1-CCTV1] 5s passed with no media, trying to reconnect the RTSP stream
and
No c-line or source for RTSP video address, resolving server address...
So, janus connects to the RTSP server but doesn’t receive anything back and thus a reconnection is triggered:

*   Trying 211.132.61.124:554...
* Connected to 211.132.61.124 (211.132.61.124) port 554 (#0)
> DESCRIBE rtsp://211.132.61.124/axis-media/media.amp RTSP/1.0
CSeq: 1
Accept: application/sdp

< RTSP/1.0 200 OK
< CSeq: 1
< Content-Type: application/sdp
< Content-Base: rtsp://211.132.61.124/axis-media/media.amp/
< Server: GStreamer RTSP server
< Date: Tue, 05 Sep 2023 11:29:15 GMT
< Content-Length: 584
<
* Connection #0 to host 211.132.61.124 left intact
DESCRIBE answer:RTSP/1.0 200 OK
CSeq: 1
Content-Type: application/sdp
Content-Base: rtsp://211.132.61.124/axis-media/media.amp/
Server: GStreamer RTSP server
Date: Tue, 05 Sep 2023 11:29:15 GMT
Content-Length: 584

v=0
o=- 17005178830703211578 1 IN IP4 172.29.93.2
s=Session streamed with GStreamer
i=rtsp-server
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
a=control:rtsp://211.132.61.124/axis-media/media.amp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:50000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d0029;sprop-parameter-sets=Z00AKeKQCgC3YC3AQEB4eJEV,aO48gA==
a=control:rtsp://211.132.61.124/axis-media/media.amp/stream=0
a=framerate:30.000000
a=transform:1.000000,0.000000,0.000000;0.000000,1.000000,0.000000;0.000000,0.000000,1.000000

* Found bundle for host 211.132.61.124: 0x5648dfadfa40 [serially]
* Re-using existing connection! (#0) with host 211.132.61.124
* Connected to 211.132.61.124 (211.132.61.124) port 554 (#0)
> SETUP rtsp://211.132.61.124/axis-media/media.amp/stream=0 RTSP/1.0
CSeq: 2
Transport: RTP/AVP/UDP;unicast;client_port=10002-10003

< RTSP/1.0 200 OK
< CSeq: 2
< Transport: RTP/AVP;unicast;client_port=10002-10003;server_port=50004-50005;ssrc=92E98CCF;mode="PLAY"
< Server: GStreamer RTSP server
< Session: WgCzHZ1bHHg23cTP; timeout=60
< Date: Tue, 05 Sep 2023 11:29:16 GMT
<
* Connection #0 to host 211.132.61.124 left intact
SETUP answer:RTSP/1.0 200 OK
CSeq: 2
Transport: RTP/AVP;unicast;client_port=10002-10003;server_port=50004-50005;ssrc=92E98CCF;mode="PLAY"
Server: GStreamer RTSP server
Session: WgCzHZ1bHHg23cTP; timeout=60
Date: Tue, 05 Sep 2023 11:29:16 GMT


  -- RTP port (video): 50004
  -- RTCP port (video): 50005
  -- SSRC (video): 2464779471
  -- RTSP session timeout (video): 60

and is successful. Then it sends a PLAY request:

RTSP video latching: 211.132.61.124:50004
  -- RTCP: 211.132.61.124:50005
Sending PLAY request...
* Found bundle for host 211.132.61.124: 0x5648dfadfa40 [serially]
* Re-using existing connection! (#0) with host 211.132.61.124
* Connected to 211.132.61.124 (211.132.61.124) port 554 (#0)
> PLAY rtsp://211.132.61.124/axis-media/media.amp RTSP/1.0
CSeq: 3
Session: WgCzHZ1bHHg23cTP
Range: npt=0.000-

< RTSP/1.0 200 OK
< CSeq: 3
< RTP-Info: url=rtsp://211.132.61.124/axis-media/media.amp/stream=0;seq=22599;rtptime=4176080931
< Range: npt=now-
< Server: GStreamer RTSP server
< Session: WgCzHZ1bHHg23cTP; timeout=60
< Date: Tue, 05 Sep 2023 11:29:16 GMT
<
* Connection #0 to host 211.132.61.124 left intact
PLAY answer:RTSP/1.0 200 OK
CSeq: 3
RTP-Info: url=rtsp://211.132.61.124/axis-media/media.amp/stream=0;seq=22599;rtptime=4176080931
Range: npt=now-
Server: GStreamer RTSP server
Session: WgCzHZ1bHHg23cTP; timeout=60
Date: Tue, 05 Sep 2023 11:29:16 GMT

Everithing looks ok but still no media after 5 secs. I thought it was a network issue but if i try opening the rtsp stream with VLC everything works just fine. Any suggestions?

VLC is not representative, it can open a can of tuna too. Our RTSP stack is much more simple: we don’t support RTP over TCP for instance. It most definitely is a networking issue, so try looking with Wireshark or tcpdump if you see those RTP packets leaving, and if there are private addresses or firewalls involved.

Yeah, it seems to be the case. Wireshark shows that VLC receives RTP data in TCP packets, that’s why it works. Looking at the RTSP responses I see:

* Connection #0 to host 211.132.61.124 left intact
SETUP answer:RTSP/1.0 200 OK
CSeq: 2
Transport: RTP/AVP;unicast;client_port=10020-10021;server_port=50004-50005;ssrc=9C30516D;mode="PLAY"
Server: GStreamer RTSP server
Session: JFOKvAB72Wp0mTKA; timeout=60
Date: Tue, 05 Sep 2023 14:06:22 GMT


  -- RTP port (video): 50004
  -- RTCP port (video): 50005
  -- SSRC (video): 2620412269
  -- RTSP session timeout (video): 60

The IP camera is sending RTP data from 50004/udp and I should receive them at 10020/udp right? I tried opening the entire 10000-20000 UDP range on my firewall but I still do not receive anything. Is there anything else I can try to make this work?