Skip to content

Commit 403223c

Browse files
fix: Update Mediamtx Dockerfile and configuration for improved compatibility
1 parent 89d933b commit 403223c

File tree

4 files changed

+62
-45
lines changed

4 files changed

+62
-45
lines changed

media_relay/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM bluenviron/mediamtx:1.15.3
22

3-
COPY mediamtx.yaml /mediamtx.yaml
3+
COPY mediamtx.yml /mediamtx.yml
44

5-
CMD ["/mediamtx", "/mediamtx.yaml"]
5+
ENV MTX_CONFIG=/mediamtx.yml
6+
7+
EXPOSE 8554 1935 8888 8889 9998 9999
8+
EXPOSE 8200/udp

media_relay/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ The container reads the following environment variables that must be configured
1010
| --- | --- |
1111
| `RELAY_PUBLISH_USER` | Username the SBC uses while pushing the RTSP stream |
1212
| `RELAY_PUBLISH_PASS` | Password the SBC uses while pushing the RTSP stream |
13-
| `RELAY_VIEWER_USER` | Optional username required by frontend clients (leave empty to disable auth) |
14-
| `RELAY_VIEWER_PASS` | Optional password required by frontend clients (leave empty to disable auth) |
13+
| `RELAY_VIEWER_USER` | Username required by frontend clients (set to `any` to allow anonymous access) |
14+
| `RELAY_VIEWER_PASS` | Password required by frontend clients (leave blank when `RELAY_VIEWER_USER=any`) |
1515

1616
If you enable viewer authentication, update the frontend to use the same credentials when negotiating playback.
1717

@@ -20,12 +20,12 @@ Ports exposed by the container:
2020
- `8554/tcp`: RTSP ingest from the SBC
2121
- `1935/tcp`: RTMP ingest (alternative to RTSP)
2222
- `8888/tcp`: HTTP server (HLS playback and API)
23-
- `8889/tcp` plus `UDP 8200-8299`: WebRTC signalling and media
23+
- `8889/tcp` plus `8200/udp`: WebRTC signalling and media
2424
- `9998/tcp`: Prometheus metrics (optional)
2525
- `9999/tcp`: pprof endpoint (optional)
2626

2727
Ensure the Elastic Beanstalk load balancer and security groups forward the required ports. For WebRTC, terminate TLS at the load balancer and forward HTTPS traffic to port `8889`.
2828

2929
## Deployment bundle
3030

31-
The GitHub Actions workflow zips the contents of this folder and uploads the archive as an application version. The Dockerfile simply copies the Mediamtx configuration and launches the server binary.
31+
The GitHub Actions workflow zips the contents of this folder and uploads the archive as an application version. The Dockerfile copies `mediamtx.yml` into the image and relies on the Mediamtx entrypoint to launch the server.

media_relay/mediamtx.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

media_relay/mediamtx.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
logLevel: info
2+
3+
authMethod: internal
4+
authInternalUsers:
5+
- user: ${RELAY_PUBLISH_USER}
6+
pass: ${RELAY_PUBLISH_PASS}
7+
permissions:
8+
- action: publish
9+
path: robot
10+
- user: ${RELAY_VIEWER_USER}
11+
pass: ${RELAY_VIEWER_PASS}
12+
permissions:
13+
- action: read
14+
path: robot
15+
- action: playback
16+
path: robot
17+
- user: any
18+
pass:
19+
ips: ['127.0.0.1', '::1']
20+
permissions:
21+
- action: api
22+
- action: metrics
23+
- action: pprof
24+
25+
rtsp: yes
26+
rtspAddress: :8554
27+
28+
rtmp: yes
29+
rtmpAddress: :1935
30+
31+
hls: yes
32+
hlsAddress: :8888
33+
hlsVariant: lowLatency
34+
hlsSegmentDuration: 1s
35+
hlsPartDuration: 200ms
36+
37+
webrtc: yes
38+
webrtcAddress: :8889
39+
webrtcAllowOrigin: '*'
40+
webrtcLocalUDPAddress: :8200
41+
webrtcICEServers2:
42+
- url: stun:stun.l.google.com:19302
43+
44+
metrics: yes
45+
metricsAddress: :9998
46+
47+
pprof: yes
48+
pprofAddress: :9999
49+
50+
paths:
51+
robot:
52+
source: publisher
53+
overridePublisher: yes

0 commit comments

Comments
 (0)