You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Config map includes custom mediamtx configuration. I have added a default rtsp stream path entry to it, And trying to access the corresponding webrtc streams.
Apply all resources, wait for medamtx pod to start. Expose mediamtx service using kubectl port-forward
Mediamtx server logs before trying to access webrtc stream
2024/09/24 06:49:37 INF MediaMTX v1.9.0
2024/09/24 06:49:37 INF configuration loaded from /mediamtx.yml
2024/09/24 06:49:37 INF [path matrixcamera] [RTSP source] started
2024/09/24 06:49:37 INF [RTSP] listener opened on :8554 (TCP)
2024/09/24 06:49:37 INF [RTMP] listener opened on :1935
2024/09/24 06:49:37 INF [HLS] listener opened on :8888
2024/09/24 06:49:37 INF [WebRTC] listener opened on 0.0.0.0:8889 (HTTP), :8189 (ICE/UDP)
2024/09/24 06:49:37 INF [SRT] listener opened on :8890 (UDP)
2024/09/24 06:49:37 INF [path matrixcamera] [RTSP source] ready: 2 tracks (H264, G711)
Mediamtx server logs after trying to access webrtc stream
2024/09/24 07:15:24 INF [WebRTC] [session 8b9d0424] created by 127.0.0.1:52060
2024/09/24 07:15:34 INF [WebRTC] [session 8b9d0424] closed: deadline exceeded while waiting connection
I am trying to access the stream at localhost:8889/mycamera after running kubectl port-forward svc/mediamtx 8889:8889
yes / no
Did you attach a network dump?
yes / no
I also tried adding stun/turn server in mediamtx config
# webrtcICEServers2:
# - url: stun:stun2.1.google.com:19302
Also tried adding webrtc address as broadcast in mediamtx config
# rtspAddress: 0.0.0.0:8554
Still I am unable to acesss I get following errrors in browser console
If there's a NAT / container between server and clients, it must be configured to route all incoming UDP packets on port 8189 to the server
If you use kubectl port-forward svc/mediamtx 8889:8889, you are just exposing TCP port 8889, not UDP port 8189. You have to expose both ports and provide a valid address inside webrtcAdditionalHosts. There are several methods to do this but this is a Kubernetes-related question, not a server bug.
Which version are you using?
v0.0.0
Which operating system are you using?
Describe the issue
Mediamtx webrtc stream is not accessible while running inside k8s cluster in minikube
Describe how to replicate the issue
The Config map include custom mediamtx.yml config
Mediamtx Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: mediamtx
labels:
app: mediamtx
spec:
replicas: 1
selector:
matchLabels:
app: mediamtx
template:
metadata:
labels:
app: mediamtx
spec:
containers:
- name: mediamtx
image: bluenviron/mediamtx
args: ["/mediamtx.yml"] # Explicitly specify the config file location
volumeMounts:
- name: config
mountPath: /mediamtx.yml
subPath: mediamtx.yml
ports:
- containerPort: 8554
- containerPort: 1935
- containerPort: 8888
- containerPort: 8889
- containerPort: 8890
- containerPort: 8189
env:
- name: MTX_PROTOCOLS
value: "tcp"
- name: MTX_WEBRTCADDITIONALHOSTS
value: "172.19.0.1"
Mediamtx Service
apiVersion: v1
kind: Service
metadata:
name: mediamtx
spec:
type: ClusterIP
ports:
port: 8554
targetPort: 8554
protocol: TCP
port: 1935
targetPort: 1935
protocol: TCP
port: 8888
targetPort: 8888
protocol: TCP
port: 8889
targetPort: 8889
protocol: TCP
port: 8890
targetPort: 8890
protocol: UDP
port: 8189
targetPort: 8189
protocol: UDP
selector:
app: mediamtx
mediamtx config map
apiVersion: v1
kind: ConfigMap
metadata:
name: mediamtx-config
data:
mediamtx.yml: |
# Your custom MediaMTX configuration goes here
# webrtcICEServers2:
# - url: stun:stun2.1.google.com:19302
The Config map includes custom mediamtx configuration. I have added a default rtsp stream path entry to it, And trying to access the corresponding webrtc streams.
Apply all resources, wait for medamtx pod to start. Expose mediamtx service using kubectl port-forward
Now the webrtc stream should be accessible at http://localhost:8889/mycamera, But I am not able to access it
Did you attach the server logs?
Mediamtx server logs before trying to access webrtc stream
2024/09/24 06:49:37 INF MediaMTX v1.9.0
2024/09/24 06:49:37 INF configuration loaded from /mediamtx.yml
2024/09/24 06:49:37 INF [path matrixcamera] [RTSP source] started
2024/09/24 06:49:37 INF [RTSP] listener opened on :8554 (TCP)
2024/09/24 06:49:37 INF [RTMP] listener opened on :1935
2024/09/24 06:49:37 INF [HLS] listener opened on :8888
2024/09/24 06:49:37 INF [WebRTC] listener opened on 0.0.0.0:8889 (HTTP), :8189 (ICE/UDP)
2024/09/24 06:49:37 INF [SRT] listener opened on :8890 (UDP)
2024/09/24 06:49:37 INF [path matrixcamera] [RTSP source] ready: 2 tracks (H264, G711)
Mediamtx server logs after trying to access webrtc stream
2024/09/24 07:15:24 INF [WebRTC] [session 8b9d0424] created by 127.0.0.1:52060
2024/09/24 07:15:34 INF [WebRTC] [session 8b9d0424] closed: deadline exceeded while waiting connection
I am trying to access the stream at localhost:8889/mycamera after running kubectl port-forward svc/mediamtx 8889:8889
yes / no
Did you attach a network dump?
yes / no
I also tried adding stun/turn server in mediamtx config
# webrtcICEServers2:
# - url: stun:stun2.1.google.com:19302
Also tried adding webrtc address as broadcast in mediamtx config
# rtspAddress: 0.0.0.0:8554
Still I am unable to acesss I get following errrors in browser console
onError @ matrixcamera/:368
onConnectionState @ matrixcamera/:490
pc.oniceconnectionstatechange @ matrixcamera/:515
favicon.ico:1
The whep DELETE request always timesout
The text was updated successfully, but these errors were encountered: