The configuration can be changed dinamically when the server is running (hot reloading) by editing the configuration file, Changes are detected and applied without disconnecting existing clients, whenever is possible.
### RTSP proxy mode
_rtsp-simple-server_ is also a RTSP proxy, that is usually deployed in one of these scenarios:
@ -93,7 +92,7 @@ _rtsp-simple-server_ is also a RTSP proxy, that is usually deployed in one of th
@@ -93,7 +92,7 @@ _rtsp-simple-server_ is also a RTSP proxy, that is usually deployed in one of th
* when there's a NAT / firewall between a stream and the users; the proxy is installed on the NAT and makes the stream available to the outside world.
Edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content:
```yaml
```yml
paths:
proxied:
# url of the source stream, in the format rtsp://user:pass@host:port/path
After starting the server, users can connect to `rtsp://localhost:8554/proxied`, instead of connecting to the original url. The server supports any number of source streams, it's enough to add additional entries to the `paths` section.
It's possible to save bandwidth by enabling the on-demand mode: the stream will be pulled only when at least a client is connected:
```yml
paths:
proxied:
source: rtsp://original-url
sourceOnDemand: yes
```
### Serve a webcam
Edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content:
@ -137,7 +144,7 @@ After starting the server, the webcam is available on `rtsp://localhost:8554/cam
@@ -137,7 +144,7 @@ After starting the server, the webcam is available on `rtsp://localhost:8554/cam
### On-demand publishing
Edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content:
@ -148,8 +155,8 @@ The command inserted into `runOnDemand` will start only when a client requests t
@@ -148,8 +155,8 @@ The command inserted into `runOnDemand` will start only when a client requests t
### Remuxing, re-encoding, compression
To change the format, codec or compression of a stream, you can use _FFmpeg_ or _Gstreamer_ together with _rtsp-simple-server_. For instance, to re-encode an existing stream, that is available in the `/original` path, and publish the resulting stream in the `/compressed` path, edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content:
```yaml
To change the format, codec or compression of a stream, use _FFmpeg_ or _Gstreamer_ together with _rtsp-simple-server_. For instance, to re-encode an existing stream, that is available in the `/original` path, and publish the resulting stream in the `/compressed` path, edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content: