Which version are you using?
1.11.3
Which operating system are you using?
Linux amd64 Docker
Describe how to replicate the issue
Hi,
I'm using mediamtx as proxy for RTSP streams. I noticed that when I access such a proxied stream, VLC takes quite a long time for some streams to start the playback. Upon investigation, I noticed that VLC always connects through TCP to mediamtx, which it shouldn't, as the default settings for VLC are to use UDP and I did not ask the app to use TCP.
So I checked on the server side, and I noticed that mediamtx is not exposing the configued RTSP port through UDP.
Consider the following (standard) config:
###############################################
# Global settings -> RTSP server
# Enable publishing and reading streams with the RTSP protocol.
rtsp: yes
# List of enabled RTSP transport protocols.
# UDP is the most performant, but doesn't work when there's a NAT/firewall between
# server and clients, and doesn't support encryption.
# UDP-multicast allows to save bandwidth when clients are all in the same LAN.
# TCP is the most versatile, and does support encryption.
# The handshake is always performed with TCP.
rtspTransports: [udp, multicast, tcp]
# Encrypt handshakes and TCP streams with TLS (RTSPS).
# Available values are "no", "strict", "optional".
rtspEncryption: "no"
# Address of the TCP/RTSP listener. This is needed only when encryption is "no" or "optional".
rtspAddress: :8554
# Address of the TCP/TLS/RTSPS listener. This is needed only when encryption is "strict" or "optional".
rtspsAddress: :8322
# Address of the UDP/RTP listener. This is needed only when "udp" is in rtspTransports.
rtpAddress: :8000
# Address of the UDP/RTCP listener. This is needed only when "udp" is in rtspTransports.
rtcpAddress: :8001
# IP range of all UDP-multicast listeners. This is needed only when "multicast" is in rtspTransports.
multicastIPRange: 224.1.0.0/16
# Port of all UDP-multicast/RTP listeners. This is needed only when "multicast" is in rtspTransports.
multicastRTPPort: 8002
# Port of all UDP-multicast/RTCP listeners. This is needed only when "multicast" is in rtspTransports.
multicastRTCPPort: 8003
# Path to the server key. This is needed only when encryption is "strict" or "optional".
# This can be generated with:
# openssl genrsa -out server.key 2048
# openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
rtspServerKey: server.key
# Path to the server certificate. This is needed only when encryption is "strict" or "optional".
rtspServerCert: server.crt
# Authentication methods. Available are "basic" and "digest".
# "digest" doesn't provide any additional security and is available for compatibility only.
rtspAuthMethods: [basic]
This will result in the following listeners:
# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::8554 :::* LISTEN 1/mediamtx
udp 0 0 :::8000 :::* 1/mediamtx
udp 0 0 :::8001 :::* 1/mediamtx
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
As you can see, ports 8000 (RTP) and 8001 (RTCP) are on UDP, as expected, but 8554 is only on TCP, where it should be on both TCP and UDP.
The description above for the rtspAddress setting does say it is for the Address of the TCP/RTSP listener, but how to configure the address for UDP/RTSP then?
Thanks for looking into this!
Server logs
No response
Network dump
No response
Which version are you using?
1.11.3
Which operating system are you using?
Linux amd64 Docker
Describe how to replicate the issue
Hi,
I'm using mediamtx as proxy for RTSP streams. I noticed that when I access such a proxied stream, VLC takes quite a long time for some streams to start the playback. Upon investigation, I noticed that VLC always connects through TCP to mediamtx, which it shouldn't, as the default settings for VLC are to use UDP and I did not ask the app to use TCP.
So I checked on the server side, and I noticed that mediamtx is not exposing the configued RTSP port through UDP.
Consider the following (standard) config:
This will result in the following listeners:
As you can see, ports 8000 (RTP) and 8001 (RTCP) are on UDP, as expected, but 8554 is only on TCP, where it should be on both TCP and UDP.
The description above for the
rtspAddresssetting does say it is for theAddress of the TCP/RTSP listener, but how to configure the address for UDP/RTSP then?Thanks for looking into this!
Server logs
No response
Network dump
No response