add instructions on how to forward streams (#2212)

This commit is contained in:
Alessandro Ros 2023-08-16 17:57:41 +02:00 committed by GitHub
parent d289b9872e
commit 7e0fb20eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,7 @@ _rtsp-simple-server_ has been rebranded as _MediaMTX_. The reason is pretty obvi
* [Encrypt the configuration](#encrypt-the-configuration)
* [Remuxing, re-encoding, compression](#remuxing-re-encoding-compression)
* [Save streams to disk](#save-streams-to-disk)
* [Forward streams to another server](#forward-streams-to-another-server)
* [On-demand publishing](#on-demand-publishing)
* [Start on boot](#start-on-boot)
* [RTSP-specific features](#rtsp-specific-features)
@ -1138,7 +1139,7 @@ paths:
### Save streams to disk
To save available streams to disk, use the `runOnReady` parameter and _FFmpeg_:
To save available streams to disk, use _FFmpeg_ inside the `runOnReady` parameter:
```yml
paths:
@ -1152,6 +1153,20 @@ paths:
In the configuration above, streams are saved in MPEG-TS format, that is resilient to system crashes.
### Forward streams to another server
To forward incoming streams to another server, use _FFmpeg_ inside the `runOnReady` parameter:
```yml
paths:
all:
runOnReady: >
ffmpeg -i rtsp://localhost:$RTSP_PORT/$MTX_PATH
-c copy
-f rtsp rtsp://another-server/another-path
runOnReadyRestart: yes
```
### On-demand publishing
Edit `mediamtx.yml` and replace everything inside section `paths` with the following content: