diff --git a/Makefile b/Makefile index 161f99c2c59..963bd19aaab 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index c27746e2dde..d86dd3e55d9 100644 --- a/README.md +++ b/README.md @@ -54,19 +54,19 @@ 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 @@ -74,7 +74,7 @@ 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: @@ -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: @@ -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: @@ -146,7 +146,7 @@ Flags: --version print version Args: - [] path to a config file. The default is conf.yml. Use 'stdin' to + [] path to a config file. The default is rtsp-simple-server.yml. Use 'stdin' to read config from stdin ``` diff --git a/conf.go b/conf.go index 6f215e7d8d6..e351fdaf024 100644 --- a/conf.go +++ b/conf.go @@ -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 } diff --git a/main.go b/main.go index 5de62b51c0d..7ce075184d7 100644 --- a/main.go +++ b/main.go @@ -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)) diff --git a/conf.yml b/rtsp-simple-server.yml similarity index 100% rename from conf.yml rename to rtsp-simple-server.yml