docs: update (#5308)
This commit is contained in:
+54
-53
@@ -4,19 +4,19 @@
|
||||
|
||||
Live streams can be published to the server with the following protocols and codecs:
|
||||
|
||||
| protocol | variants | video codecs | audio codecs |
|
||||
| ----------------------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| [SRT clients](#srt-clients) | | H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3 |
|
||||
| [SRT cameras and servers](#srt-cameras-and-servers) | | H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3 |
|
||||
| [WebRTC clients](#webrtc-clients) | WHIP | AV1, VP9, VP8, H265, H264 | Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [WebRTC servers](#webrtc-servers) | WHEP | AV1, VP9, VP8, H265, H264 | Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [RTSP clients](#rtsp-clients) | UDP, TCP, RTSPS | AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM and any RTP-compatible codec |
|
||||
| [RTSP cameras and servers](#rtsp-cameras-and-servers) | UDP, UDP-Multicast, TCP, RTSPS | AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM and any RTP-compatible codec |
|
||||
| [RTMP clients](#rtmp-clients) | RTMP, RTMPS, Enhanced RTMP | AV1, VP9, H265, H264 | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [RTMP cameras and servers](#rtmp-cameras-and-servers) | RTMP, RTMPS, Enhanced RTMP | AV1, VP9, H265, H264 | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS cameras and servers](#hls-cameras-and-servers) | Low-Latency HLS, MP4-based HLS, legacy HLS | AV1, VP9, H265, H264 | Opus, MPEG-4 Audio (AAC) |
|
||||
| [MPEG-TS](#mpeg-ts) | MPEG-TS over UDP, MPEG-TS over Unix socket | H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3 |
|
||||
| [RTP](#rtp) | RTP over UDP, RTP over Unix socket | AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM and any RTP-compatible codec |
|
||||
| protocol | variants | codecs |
|
||||
| ----------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [SRT clients](#srt-clients) | | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3<br/>**Other**: KLV |
|
||||
| [SRT cameras and servers](#srt-cameras-and-servers) | | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3<br/>**Other**: KLV |
|
||||
| [WebRTC clients](#webrtc-clients) | WHIP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [WebRTC servers](#webrtc-servers) | WHEP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [RTSP clients](#rtsp-clients) | UDP, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, MJPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTSP cameras and servers](#rtsp-cameras-and-servers) | UDP, UDP-Multicast, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, MJPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTMP clients](#rtmp-clients) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [RTMP cameras and servers](#rtmp-cameras-and-servers) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS cameras and servers](#hls-cameras-and-servers) | Low-Latency HLS, MP4-based HLS, legacy HLS | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC) |
|
||||
| [MPEG-TS](#mpeg-ts) | MPEG-TS over UDP, MPEG-TS over Unix socket | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3<br/>**Other**: KLV |
|
||||
| [RTP](#rtp) | RTP over UDP, RTP over Unix socket | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
|
||||
We provide instructions for publishing with the following devices:
|
||||
|
||||
@@ -42,7 +42,7 @@ SRT is a protocol that allows to publish and read live data stream, providing en
|
||||
srt://localhost:8890?streamid=publish:mystream&pkt_size=1316
|
||||
```
|
||||
|
||||
Replace `mystream` with any name you want. The resulting stream is available in path `/mystream`.
|
||||
Replace `mystream` with any name you want. The resulting stream will be available on path `/mystream`.
|
||||
|
||||
If you need to use the standard stream ID syntax instead of the custom one in use by this server, see [Standard stream ID syntax](srt-specific-features#standard-stream-id-syntax).
|
||||
|
||||
@@ -69,7 +69,7 @@ WebRTC is an API that makes use of a set of protocols and methods to connect two
|
||||
http://localhost:8889/mystream/publish
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
WHIP is a WebRTC extensions that allows to publish streams by using a URL, without passing through a web page. This allows to use WebRTC as a general purpose streaming protocol. If you are using a software that supports WHIP (for instance, latest versions of OBS Studio), you can publish a stream to the server by using this URL:
|
||||
|
||||
@@ -110,7 +110,7 @@ RTSP is a protocol that allows to publish and read streams. It supports several
|
||||
rtsp://localhost:8554/mystream
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
Some clients that can publish with RTSP are [FFmpeg](#ffmpeg), [GStreamer](#gstreamer), [OBS Studio](#obs-studio), [OpenCV](#opencv).
|
||||
|
||||
@@ -125,7 +125,7 @@ paths:
|
||||
source: rtsp://original-url
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/proxied`.
|
||||
The resulting stream will be available on path `/proxied`.
|
||||
|
||||
It is possible to tune the connection by using some additional parameters:
|
||||
|
||||
@@ -168,7 +168,7 @@ RTMP is a protocol that allows to read and publish streams. It supports encrypti
|
||||
rtmp://localhost/mystream
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
Some clients that can publish with RTMP are [FFmpeg](#ffmpeg), [GStreamer](#gstreamer), [OBS Studio](#obs-studio).
|
||||
|
||||
@@ -183,7 +183,7 @@ paths:
|
||||
source: rtmp://original-url
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/proxied`.
|
||||
The resulting stream will be available on path `/proxied`.
|
||||
|
||||
### HLS cameras and servers
|
||||
|
||||
@@ -196,7 +196,7 @@ paths:
|
||||
source: http://original-url/stream/index.m3u8
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/proxied`.
|
||||
The resulting stream will be available on path `/proxied`.
|
||||
|
||||
### MPEG-TS
|
||||
|
||||
@@ -284,46 +284,47 @@ paths:
|
||||
|
||||
### Raspberry Pi Cameras
|
||||
|
||||
_MediaMTX_ natively supports most of the Raspberry Pi Camera models, enabling high-quality and low-latency video streaming from the camera to any user, for any purpose. There are some additional requirements:
|
||||
_MediaMTX_ natively supports most Raspberry Pi Camera models, enabling high-quality and low-latency video streaming from the camera to any user, for any purpose. There are some additional requirements:
|
||||
|
||||
1. The server must run on a Raspberry Pi, with one of the following operating systems:
|
||||
- Raspberry Pi OS Trixie
|
||||
- Raspberry Pi OS Bookworm
|
||||
- Raspberry Pi OS Bullseye
|
||||
|
||||
Both 32 bit and 64 bit architectures are supported.
|
||||
Both 32-bit and 64-bit architectures are supported.
|
||||
|
||||
2. If you are using Raspberry Pi OS Bullseye, make sure that the legacy camera stack is disabled. Type `sudo raspi-config`, then go to `Interfacing options`, `enable/disable legacy camera support`, choose `no`. Reboot the system.
|
||||
|
||||
If you want to run the standard (non-Docker) version of the server:
|
||||
The setup procedure depends on whether you want to run the server outside or inside Docker:
|
||||
|
||||
1. Download the server executable. If you're using 64-bit version of the operative system, make sure to pick the `arm64` variant.
|
||||
- If you want to run the standard (non-Dockerized) version of the server:
|
||||
1. Download the server executable. If you're using 64-bit version of the operative system, make sure to pick the `arm64` variant.
|
||||
|
||||
2. Edit `mediamtx.yml` and replace everything inside section `paths` with the following content:
|
||||
2. Edit `mediamtx.yml` and replace everything inside section `paths` with the following content:
|
||||
|
||||
```yml
|
||||
paths:
|
||||
cam:
|
||||
source: rpiCamera
|
||||
```
|
||||
```yml
|
||||
paths:
|
||||
cam:
|
||||
source: rpiCamera
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/cam`.
|
||||
The resulting stream will be available on path `/cam`.
|
||||
|
||||
- If you want to run the server inside Docker, you need to use the `1-rpi` image and launch the container with some additional flags:
|
||||
|
||||
```sh
|
||||
docker run --rm -it \
|
||||
--network=host \
|
||||
--privileged \
|
||||
--tmpfs /dev/shm:exec \
|
||||
-v /run/udev:/run/udev:ro \
|
||||
-e MTX_PATHS_CAM_SOURCE=rpiCamera \
|
||||
bluenviron/mediamtx:1-rpi
|
||||
```
|
||||
|
||||
The Raspberry Pi Camera can be controlled through a wide range of parameters, that are listed in the [configuration file](/docs/references/configuration-file).
|
||||
|
||||
If you want to run the server inside Docker, you need to use the `1-rpi` image and launch the container with some additional flags:
|
||||
|
||||
```sh
|
||||
docker run --rm -it \
|
||||
--network=host \
|
||||
--privileged \
|
||||
--tmpfs /dev/shm:exec \
|
||||
-v /run/udev:/run/udev:ro \
|
||||
-e MTX_PATHS_CAM_SOURCE=rpiCamera \
|
||||
bluenviron/mediamtx:1-rpi
|
||||
```
|
||||
|
||||
Be aware that precompiled binaries and Docker images are not compatible with cameras that require a custom `libcamera` (like some ArduCam products), since they come with a bundled `libcamera`. If you want to use a custom one, you can [compile from source](/docs/other/compile#custom-libcamera).
|
||||
Be aware that cameras that require a custom `libcamera` (like some ArduCam products) are not compatible with precompiled binaries and Docker images of _MediaMTX_, since these come with a bundled `libcamera`. If you want to use a custom one, you need to [compile from source](/docs/other/compile#custom-libcamera).
|
||||
|
||||
#### Adding audio
|
||||
|
||||
@@ -366,7 +367,7 @@ paths:
|
||||
runOnInitRestart: yes
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/cam_with_audio`.
|
||||
The resulting stream will be available on path `/cam_with_audio`.
|
||||
|
||||
#### Secondary stream
|
||||
|
||||
@@ -401,7 +402,7 @@ paths:
|
||||
rpiCameraMJPEGQuality: 60
|
||||
```
|
||||
|
||||
The secondary stream is available in path `/secondary`.
|
||||
The secondary stream will be available on path `/secondary`.
|
||||
|
||||
### Generic webcams
|
||||
|
||||
@@ -429,7 +430,7 @@ Where `USB2.0 HD UVC WebCam` is the name of a webcam, that can be obtained with:
|
||||
ffmpeg -list_devices true -f dshow -i dummy
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/cam`.
|
||||
The resulting stream will be available on path `/cam`.
|
||||
|
||||
## Software
|
||||
|
||||
@@ -443,7 +444,7 @@ FFmpeg can publish a stream to the server in several ways. The recommended one c
|
||||
ffmpeg -re -stream_loop -1 -i file.ts -c copy -f rtsp rtsp://localhost:8554/mystream
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
#### FFmpeg and RTMP
|
||||
|
||||
@@ -523,7 +524,7 @@ gst-launch-1.0 filesrc location=file.mp4 ! qtdemux name=d \
|
||||
d.video_0 ! rtspclientsink location=rtsp://localhost:8554/mystream
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
For advanced options, see [RTSP-specific features](rtsp-specific-features).
|
||||
|
||||
@@ -593,7 +594,7 @@ Recent versions of OBS Studio can also publish to the server with the [WebRTC /
|
||||
|
||||
Save the configuration and click `Start streaming`.
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
### OpenCV
|
||||
|
||||
@@ -668,7 +669,7 @@ while True:
|
||||
start = now
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
### Unity
|
||||
|
||||
@@ -779,7 +780,7 @@ public class WebRTCPublisher : MonoBehaviour
|
||||
|
||||
In the _Hierarchy_ window, find or create a scene and a camera, then add the `WebRTCPublisher.cs` script as component of the camera, by dragging it inside the _Inspector_ window. then Press the _Play_ button at the top of the page.
|
||||
|
||||
The resulting stream is available in path `/unity`.
|
||||
The resulting stream will be available on path `/unity`.
|
||||
|
||||
### Web browsers
|
||||
|
||||
@@ -789,7 +790,7 @@ Web browsers can publish a stream to the server by using the [WebRTC protocol](#
|
||||
http://localhost:8889/mystream/publish
|
||||
```
|
||||
|
||||
The resulting stream is available in path `/mystream`.
|
||||
The resulting stream will be available on path `/mystream`.
|
||||
|
||||
This web page can be embedded into another web page by using an iframe:
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
Live streams can be read from the server with the following protocols and codecs:
|
||||
|
||||
| protocol | variants | video codecs | audio codecs |
|
||||
| ----------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| [SRT](#srt) | | H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3 |
|
||||
| [WebRTC](#webrtc) | WHEP | AV1, VP9, VP8, H265, H264 | Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [RTSP](#rtsp) | UDP, UDP-Multicast, TCP, RTSPS | AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG and any RTP-compatible codec | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM and any RTP-compatible codec |
|
||||
| [RTMP](#rtmp) | RTMP, RTMPS, Enhanced RTMP | AV1, VP9, H265, H264 | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS](#hls) | Low-Latency HLS, MP4-based HLS, legacy HLS | AV1, VP9, H265, H264 | Opus, MPEG-4 Audio (AAC) |
|
||||
| protocol | variants | codecs |
|
||||
| ----------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [SRT](#srt) | | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3<br/>**Other**: KLV |
|
||||
| [WebRTC](#webrtc) | WHEP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU)<br/>**Other**: KLV |
|
||||
| [RTSP](#rtsp) | UDP, UDP-Multicast, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTMP](#rtmp) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS](#hls) | Low-Latency HLS, MP4-based HLS, legacy HLS | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC) |
|
||||
|
||||
We provide instructions for reading with the following software:
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ authInternalUsers:
|
||||
pass:
|
||||
# IPs or networks allowed to use this user. An empty list means any IP.
|
||||
ips: []
|
||||
# List of permissions.
|
||||
# Permissions.
|
||||
permissions:
|
||||
# Available actions are: publish, read, playback, api, metrics, pprof.
|
||||
- action: publish
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
Live streams be recorded and played back with the following file containers and codecs:
|
||||
|
||||
| container | video codecs | audio codecs |
|
||||
| --------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
||||
| fMP4 | AV1, VP9, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| MPEG-TS | H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video | Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3 |
|
||||
| container | codecs |
|
||||
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| fMP4 | **Video**: AV1, VP9, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| MPEG-TS | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3 |
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -63,6 +63,12 @@ After the video tag, add a script that initializes the stream when the page is f
|
||||
onTrack: (evt) => {
|
||||
document.getElementById("myvideo").srcObject = evt.streams[0];
|
||||
},
|
||||
onDataChannel: (evt) => {
|
||||
evt.channel.binaryType = "arraybuffer";
|
||||
evt.channel.onmessage = (evt) => {
|
||||
console.log("data channel message", evt.data);
|
||||
};
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -48,14 +48,18 @@ journalctl -u mediamtx
|
||||
Log collectors (like Loki, Logstash, CloudWatch and fluentd) parse logs in a more reliable way if they are fed with entries in structured format (JSONL). This can be enabled with the `logStructured` parameter:
|
||||
|
||||
```yml
|
||||
# When destination is "stdout" or "file", emit logs in structured format (JSON).
|
||||
# When destination is "stdout" or "file", emit logs in structured format (JSONL).
|
||||
logStructured: true
|
||||
```
|
||||
|
||||
Obtaining:
|
||||
|
||||
```
|
||||
{"timestamp":"2003-05-01T20:34:14+01:00","level":"INF","message":"[RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05+01:00","level":"INF","message":"[RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05+01:00","level":"INF","message":"[RTMP] listener opened on :1935"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05+01:00","level":"INF","message":"[HLS] listener opened on :8888"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05+01:00","level":"INF","message":"[WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)"}
|
||||
{"timestamp":"20XX-YY-ZZT10:45:05+01:00","level":"INF","message":"[SRT] listener opened on :8890 (UDP)"}
|
||||
```
|
||||
|
||||
## Log file rotation
|
||||
|
||||
@@ -135,6 +135,8 @@ webrtc_sessions_rtcp_packets_received{id="[id]",path="[path]",remoteAddr="[remot
|
||||
webrtc_sessions_rtcp_packets_sent{id="[id]",path="[path]",remoteAddr="[remoteAddr]",state="[state]"} 123
|
||||
```
|
||||
|
||||
Bitrates are not provided directly as metrics because they can be computed from received and sent bytes by any metrics analyzer (i.e. Grafana).
|
||||
|
||||
Metrics can be filtered by using HTTP query parameters:
|
||||
|
||||
- `type=[TYPE]`: show metrics of a certain type only (where TYPE can be `paths`, `hls_muxers`, `rtsp_conns`, `rtsp_sessions`, `rtsps_conns`, `rtsps_sessions`, `rtmp_conns`, `rtmps_conns`, `srt_conns`, `webrtc_sessions`)
|
||||
|
||||
@@ -8,7 +8,7 @@ The server can ingest and broadcast with WebRTC a wide variety of video and audi
|
||||
|
||||
In particular, reading and publishing H265 tracks with WebRTC was not possible until some time ago due to lack of browser support. The situation improved recently and can be described as following:
|
||||
|
||||
- Safari on iOS and macOS fully supports publishing and reading H265 tracks
|
||||
- Safari on iOS and macOS fully support publishing and reading H265 tracks
|
||||
- Chrome on Windows supports publishing and reading H265 tracks when a GPU is present and when the browser is launched with the following flags:
|
||||
|
||||
```
|
||||
|
||||
@@ -4,9 +4,9 @@ RTSP is a protocol that can be used for publishing and reading streams. Regardin
|
||||
|
||||
## Transport protocols
|
||||
|
||||
The RTSP protocol supports several underlying transport protocols, that are chosen by clients during the handshake with the server:
|
||||
A RTSP session is splitted in two parts: the handshake, which is always performed with the TCP protocol, and data streaming, which can be performed with an arbitrary underlying transport protocol, which is chosen by the client during the handshake:
|
||||
|
||||
- UDP: the most performant, but doesn't work when there's a NAT/firewall between server and clients.
|
||||
- UDP: the most performant, but require clients to access two additional UDP ports on the server, which is often impossible due to blocking or remapping by NATs/firewalls in between.
|
||||
- UDP-multicast: allows to save bandwidth when clients are all in the same LAN, by sending packets once to a fixed multicast IP.
|
||||
- TCP: the most versatile.
|
||||
|
||||
@@ -51,7 +51,7 @@ vlc --network-caching=50 rtsp://localhost:8554/mystream?vlcmulticast
|
||||
|
||||
## Encryption
|
||||
|
||||
Incoming and outgoing RTSP streams can be encrypted by using a secure protocol variant, called RTSPS, that replaces all the subprotocols that are normally used in RTSP with their secure variant (TLS, SRTP, SRTCP). A TLS certificate is needed and can be generated with OpenSSL:
|
||||
Incoming and outgoing RTSP streams can be encrypted by replacing all the subprotocols that are normally used in RTSP with their secure variants (RTSPS, SRTP, SRTCP). A TLS certificate is needed and can be generated with OpenSSL:
|
||||
|
||||
```sh
|
||||
openssl genrsa -out server.key 2048
|
||||
|
||||
@@ -4,7 +4,7 @@ RTMP is a protocol that can be used for publishing and reading streams. Regardin
|
||||
|
||||
## Encryption
|
||||
|
||||
RTMP connections can be encrypted with TLS, obtaining the RTMPS protocol. A TLS certificate is needed and can be generated with OpenSSL:
|
||||
RTMP connections can be encrypted by using the secure protocol variant (RTMPS). A TLS certificate is needed and can be generated with OpenSSL:
|
||||
|
||||
```yml
|
||||
openssl genrsa -out server.key 2048
|
||||
|
||||
@@ -9,7 +9,7 @@ Packet losses are usually detected and printed in _MediaMTX_ logs.
|
||||
|
||||
If you need to improve the stream reliability and decrease packet losses, the first thing to do is to check whether the physical network between the _MediaMTX_ instance and the intended publishers and readers has sufficient bandwidth for transmitting the media stream. Most of the times, packet losses are caused by a network which is not fit for this scope. This limitation can be overcome by either recompressing the stream with a lower bitrate, or by upgrading the network infrastructure (routers, cables, Wi-Fi, firewalls, topology, etc).
|
||||
|
||||
There are however some parameters that can be tuned to improve the situation, at cost of increasing RAM consumption:
|
||||
Nonetheless there are some parameters that can be tuned to improve the situation, at cost of increasing RAM consumption:
|
||||
|
||||
- When publishing a stream with a UDP-based protocol (currently RTSP, MPEG-TS, RTP, SRT, WebRTC), packets might get discarded by the server because the read buffer size of UDP sockets is too small. It can be increased with this parameter:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user