Skip to content

Commit

Permalink
rename conf.yml into rtsp-simple-server.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Jul 13, 2020
1 parent 4df7b49 commit 3451060
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,25 @@ release-nodocker:
$(eval GOBUILD := go build -ldflags '-X main.Version=$(VERSION)')
rm -rf tmp && mkdir tmp
rm -rf release && mkdir release
cp conf.yml tmp/
cp rtsp-simple-server.yml tmp/

GOOS=windows GOARCH=amd64 $(GOBUILD) -o tmp/rtsp-simple-server.exe
cd tmp && zip -q $(PWD)/release/rtsp-simple-server_$(VERSION)_windows_amd64.zip rtsp-simple-server.exe conf.yml
cd tmp && zip -q $(PWD)/release/rtsp-simple-server_$(VERSION)_windows_amd64.zip rtsp-simple-server.exe rtsp-simple-server.yml

GOOS=linux GOARCH=amd64 $(GOBUILD) -o tmp/rtsp-simple-server
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_amd64.tar.gz --owner=0 --group=0 rtsp-simple-server conf.yml
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_amd64.tar.gz --owner=0 --group=0 rtsp-simple-server rtsp-simple-server.yml

GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o tmp/rtsp-simple-server
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_arm6.tar.gz --owner=0 --group=0 rtsp-simple-server conf.yml
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_arm6.tar.gz --owner=0 --group=0 rtsp-simple-server rtsp-simple-server.yml

GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -o tmp/rtsp-simple-server
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_arm7.tar.gz --owner=0 --group=0 rtsp-simple-server conf.yml
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_arm7.tar.gz --owner=0 --group=0 rtsp-simple-server rtsp-simple-server.yml

GOOS=linux GOARCH=arm64 $(GOBUILD) -o tmp/rtsp-simple-server
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_arm64.tar.gz --owner=0 --group=0 rtsp-simple-server conf.yml
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_linux_arm64.tar.gz --owner=0 --group=0 rtsp-simple-server rtsp-simple-server.yml

GOOS=darwin GOARCH=amd64 $(GOBUILD) -o tmp/rtsp-simple-server
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_darwin_amd64.tar.gz --owner=0 --group=0 rtsp-simple-server conf.yml
tar -C tmp -czf $(PWD)/release/rtsp-simple-server_$(VERSION)_darwin_amd64.tar.gz --owner=0 --group=0 rtsp-simple-server rtsp-simple-server.yml

define DOCKERFILE_IMAGE
FROM --platform=linux/amd64 $(BASE_IMAGE) AS build
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ Download and launch the image:
docker run --rm -it --network=host aler9/rtsp-simple-server
```

The `--network=host` argument is mandatory since Docker can change the source port of UDP packets for routing reasons, and this makes RTSP routing impossible. An alternative consists in disabling UDP and exposing the RTSP port, by creating a configuration file named `conf.yml` with the following content:
The `--network=host` argument is mandatory since Docker can change the source port of UDP packets for routing reasons, and this makes RTSP routing impossible. An alternative consists in disabling UDP and exposing the RTSP port, by creating a file named `rtsp-simple-server.yml` with the following content:
```yaml
protocols: [tcp]
```
and passing it to the container:
```
docker run --rm -it -v $PWD/conf.yml:/conf.yml -p 8554:8554 aler9/rtsp-simple-server
docker run --rm -it -v $PWD/rtsp-simple-server.yml:/rtsp-simple-server.yml -p 8554:8554 aler9/rtsp-simple-server
```

#### Full configuration file

To change the configuration, it's enough to edit the `conf.yml` file, provided with the executable. The default configuration is [available here](conf.yml).
To change the configuration, it's enough to edit the `rtsp-simple-server.yml` file, provided with the executable. The default configuration is [available here](rtsp-simple-server.yml).

#### Usage as RTSP Proxy

An RTSP proxy is usually deployed in one of these scenarios:
* when there are multiple users that are receiving a stream and the bandwidth is limited, so the proxy is used to receive the stream once. Users can then connect to the proxy instead of the original source.
* when there's a NAT / firewall between a stream and the users, in this case the proxy is installed in the NAT and makes the stream available to the outside world.

Edit `conf.yml` and replace everything inside section `paths` with the following content:
Edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content:
```yaml
paths:
proxied:
Expand All @@ -91,7 +91,7 @@ Users can then connect to `rtsp://localhost:8554/proxied`, instead of connecting

#### Publisher authentication

Edit `conf.yml` and replace everything inside section `paths` with the following content:
Edit `rtsp-simple-server.yml` and replace everything inside section `paths` with the following content:
```yaml
paths:
all:
Expand All @@ -115,7 +115,7 @@ WARNING: RTSP is a plain protocol, and the credentials can be intercepted and re

_rtsp-simple-server_ is an RTSP server: it publishes existing streams and does not touch them. It is not a media server, that is a far more complex and heavy software that can receive existing streams, re-encode them and publish them.

To change the format, codec or compression of a stream, you can use _FFmpeg_ or _Gstreamer_ together with _rtsp-simple-server_, obtaining the same features of a media 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 `conf.yml` and replace everything inside section `paths` with the following content:
To change the format, codec or compression of a stream, you can use _FFmpeg_ or _Gstreamer_ together with _rtsp-simple-server_, obtaining the same features of a media 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
paths:
all:
Expand Down Expand Up @@ -146,7 +146,7 @@ Flags:
--version print version
Args:
[<confpath>] path to a config file. The default is conf.yml. Use 'stdin' to
[<confpath>] path to a config file. The default is rtsp-simple-server.yml. Use 'stdin' to
read config from stdin
```

Expand Down
4 changes: 2 additions & 2 deletions conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func loadConf(fpath string, stdin io.Reader) (*conf, error) {
return nil

} else {
// conf.yml is optional
if fpath == "conf.yml" {
// rtsp-simple-server.yml is optional
if fpath == "rtsp-simple-server.yml" {
if _, err := os.Stat(fpath); err != nil {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func newProgram(sargs []string, stdin io.Reader) (*program, error) {
"rtsp-simple-server "+Version+"\n\nRTSP server.")

argVersion := k.Flag("version", "print version").Bool()
argConfPath := k.Arg("confpath", "path to a config file. The default is conf.yml. Use 'stdin' to read config from stdin").Default("conf.yml").String()
argConfPath := k.Arg("confpath", "path to a config file. The default is rtsp-simple-server.yml. Use 'stdin' to read config from stdin").Default("rtsp-simple-server.yml").String()

kingpin.MustParse(k.Parse(sargs))

Expand Down
File renamed without changes.

0 comments on commit 3451060

Please sign in to comment.