Skip to content

Commit

Permalink
change Docker repository to bluenviron/mediamtx (#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Jun 7, 2023
1 parent ae88304 commit c9eb1a5
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 37 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v*'

jobs:
make_binaries:
binaries:
runs-on: ubuntu-22.04

steps:
Expand All @@ -20,7 +20,7 @@ jobs:
path: binaries

github:
needs: make_binaries
needs: binaries
runs-on: ubuntu-22.04

steps:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
}
dockerhub:
needs: make_binaries
needs: binaries
runs-on: ubuntu-22.04

steps:
Expand All @@ -75,8 +75,20 @@ jobs:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

dockerhub_legacy:
needs: dockerhub
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- run: make dockerhub-legacy
env:
DOCKER_USER_LEGACY: ${{ secrets.DOCKER_USER_LEGACY }}
DOCKER_PASSWORD_LEGACY: ${{ secrets.DOCKER_PASSWORD_LEGACY }}

apidocs:
needs: make_binaries
needs: binaries
runs-on: ubuntu-22.04

steps:
Expand Down
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@ help:
@echo ""
@echo "available actions:"
@echo ""
@echo " mod-tidy run go mod tidy"
@echo " format format source files"
@echo " test run tests"
@echo " test32 run tests on a 32-bit system"
@echo " test-highlevel run high-level tests"
@echo " lint run linters"
@echo " bench NAME=n run bench environment"
@echo " run run app"
@echo " apidocs-lint run api docs linters"
@echo " apidocs-gen generate api docs HTML"
@echo " binaries build binaries for all platforms"
@echo " dockerhub build and push images to Docker Hub"
@echo " mod-tidy run go mod tidy"
@echo " format format source files"
@echo " test run tests"
@echo " test32 run tests on a 32-bit system"
@echo " test-highlevel run high-level tests"
@echo " lint run linters"
@echo " bench NAME=n run bench environment"
@echo " run run app"
@echo " apidocs-lint run api docs linters"
@echo " apidocs-gen generate api docs HTML"
@echo " binaries build binaries for all platforms"
@echo " dockerhub build and push images to Docker Hub"
@echo " dockerhub-legacy build and push images to Docker Hub (legacy)"
@echo ""

blank :=
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Features:
[![Lint](https://github.com/bluenviron/mediamtx/workflows/lint/badge.svg)](https://github.com/bluenviron/mediamtx/actions?query=workflow:lint)
[![CodeCov](https://codecov.io/gh/bluenviron/mediamtx/branch/main/graph/badge.svg)](https://app.codecov.io/gh/bluenviron/mediamtx/branch/main)
[![Release](https://img.shields.io/github/v/release/bluenviron/mediamtx)](https://github.com/bluenviron/mediamtx/releases)
[![Docker Hub](https://img.shields.io/badge/docker-aler9/rtsp--simple--server-blue)](https://hub.docker.com/r/aler9/rtsp-simple-server)
[![Docker Hub](https://img.shields.io/badge/docker-bluenviron/mediamtx-blue)](https://hub.docker.com/r/bluenviron/mediamtx)
[![API Documentation](https://img.shields.io/badge/api-documentation-blue)](https://bluenviron.github.io/mediamtx)

## Note about rtsp-simple-server
Expand Down Expand Up @@ -130,22 +130,22 @@ There are several installation methods available: standalone binary, Docker imag
Download and launch the image:

```
docker run --rm -it --network=host aler9/rtsp-simple-server:latest
docker run --rm -it --network=host bluenviron/mediamtx:latest
```

Available images:

|name|FFmpeg included|RPI Camera support|
|----|---------------|------------------|
|aler9/rtsp-simple-server:latest|:x:|:x:|
|aler9/rtsp-simple-server:latest-ffmpeg|:heavy_check_mark:|:x:|
|aler9/rtsp-simple-server:latest-rpi|:x:|:heavy_check_mark:|
|aler9/rtsp-simple-server:latest-ffmpeg-rpi|:heavy_check_mark:|:heavy_check_mark:
|bluenviron/mediamtx:latest|:x:|:x:|
|bluenviron/mediamtx:latest-ffmpeg|:heavy_check_mark:|:x:|
|bluenviron/mediamtx:latest-rpi|:x:|:heavy_check_mark:|
|bluenviron/mediamtx:latest-ffmpeg-rpi|:heavy_check_mark:|:heavy_check_mark:

The `--network=host` flag is mandatory since Docker can change the source port of UDP packets for routing reasons, and this doesn't allow the RTSP server to identify the senders of the packets. This issue can be avoided by disabling the UDP transport protocol:

```
docker run --rm -it -e MTX_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 -p 8889:8889 aler9/rtsp-simple-server
docker run --rm -it -e MTX_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 -p 8888:8888 -p 8889:8889 bluenviron/mediamtx
```

### OpenWRT package
Expand Down Expand Up @@ -228,7 +228,7 @@ There are 3 ways to change the configuration:
* available in the root folder of the Docker image (`/mediamtx.yml`); it can be overridden in this way:

```
docker run --rm -it --network=host -v $PWD/mediamtx.yml:/mediamtx.yml aler9/rtsp-simple-server
docker run --rm -it --network=host -v $PWD/mediamtx.yml:/mediamtx.yml bluenviron/mediamtx
```
The configuration can be changed dynamically when the server is running (hot reloading) by writing to the configuration file. Changes are detected and applied without disconnecting existing clients, whenever it's possible.
Expand All @@ -253,7 +253,7 @@ There are 3 ways to change the configuration:
This method is particularly useful when using Docker; any configuration parameter can be changed by passing environment variables with the `-e` flag:
```
docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl aler9/rtsp-simple-server
docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl bluenviron/mediamtx
```
3. By using the [HTTP API](#http-api).
Expand Down Expand Up @@ -672,7 +672,7 @@ docker run --rm -it \
--tmpfs /dev/shm:exec \
-v /run/udev:/run/udev:ro \
-e MTX_PATHS_CAM_SOURCE=rpiCamera \
aler9/rtsp-simple-server:latest-rpi
bluenviron/mediamtx:latest-rpi
```

After starting the server, the camera can be reached on `rtsp://raspberry-pi:8554/cam` or `http://raspberry-pi:8888/cam`.
Expand Down Expand Up @@ -1164,7 +1164,7 @@ The NAT / container must then be configured in order to route all incoming UDP p
docker run --rm -it \
-p 8189:8189/udp
....
aler9/rtsp-simple-server
bluenviron/mediamtx
```

If the UDP protocol is blocked by a firewall, all WebRTC/ICE connections can be forced to pass through a single TCP server port:
Expand All @@ -1182,7 +1182,7 @@ The NAT / container must then be configured in order to redirect all incoming T
docker run --rm -it \
-p 8189:8189
....
aler9/rtsp-simple-server
bluenviron/mediamtx
```

Finally, if none of these methods work, you can force all WebRTC/ICE connections to pass through a TURN server, like [coturn](https://github.com/coturn/coturn), that must be configured externally. The server address and credentials must be set in the configuration file:
Expand Down
22 changes: 22 additions & 0 deletions scripts/dockerhub-legacy.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DOCKER_REPOSITORY_LEGACY = aler9/rtsp-simple-server

dockerhub-legacy:
$(eval VERSION := $(shell git describe --tags | tr -d v))

docker login -u $(DOCKER_USER_LEGACY) -p $(DOCKER_PASSWORD_LEGACY)

docker pull $(DOCKER_REPOSITORY):$(VERSION)
docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):v$(VERSION)
docker push $(DOCKER_REPOSITORY_LEGACY):v$(VERSION)

docker pull $(DOCKER_REPOSITORY):$(VERSION)-rpi
docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):v$(VERSION)-rpi
docker push $(DOCKER_REPOSITORY_LEGACY):v$(VERSION)-rpi

docker pull $(DOCKER_REPOSITORY):latest
docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):latest
docker push $(DOCKER_REPOSITORY_LEGACY):latest

docker pull $(DOCKER_REPOSITORY):latest-rpi
docker tag $(DOCKER_REPOSITORY):$(VERSION) $(DOCKER_REPOSITORY_LEGACY):latest-rpi
docker push $(DOCKER_REPOSITORY_LEGACY):latest-rpi
18 changes: 9 additions & 9 deletions scripts/dockerhub.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REPOSITORY = aler9/rtsp-simple-server
DOCKER_REPOSITORY = bluenviron/mediamtx

define DOCKERFILE_DOCKERHUB
FROM scratch
Expand Down Expand Up @@ -67,15 +67,15 @@ dockerhub:
echo "$$DOCKERFILE_DOCKERHUB" | docker buildx build . -f - \
--provenance=false \
--platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 \
-t $(REPOSITORY):$(VERSION) \
-t $(REPOSITORY):latest \
-t $(DOCKER_REPOSITORY):$(VERSION) \
-t $(DOCKER_REPOSITORY):latest \
--push

echo "$$DOCKERFILE_DOCKERHUB_FFMPEG" | docker buildx build . -f - \
--provenance=false \
--platform=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 \
-t $(REPOSITORY):$(VERSION)-ffmpeg \
-t $(REPOSITORY):latest-ffmpeg \
-t $(DOCKER_REPOSITORY):$(VERSION)-ffmpeg \
-t $(DOCKER_REPOSITORY):latest-ffmpeg \
--push

echo "$$DOCKERFILE_DOCKERHUB_RPI_BASE_32" | docker buildx build . -f - \
Expand All @@ -96,15 +96,15 @@ dockerhub:
echo "$$DOCKERFILE_DOCKERHUB_RPI" | docker buildx build . -f - \
--provenance=false \
--platform=linux/arm/v6,linux/arm/v7,linux/arm64/v8 \
-t $(REPOSITORY):$(VERSION)-rpi \
-t $(REPOSITORY):latest-rpi \
-t $(DOCKER_REPOSITORY):$(VERSION)-rpi \
-t $(DOCKER_REPOSITORY):latest-rpi \
--push

echo "$$DOCKERFILE_DOCKERHUB_FFMPEG_RPI" | docker buildx build . -f - \
--provenance=false \
--platform=linux/arm/v6,linux/arm/v7,linux/arm64/v8 \
-t $(REPOSITORY):$(VERSION)-ffmpeg-rpi \
-t $(REPOSITORY):latest-ffmpeg-rpi \
-t $(DOCKER_REPOSITORY):$(VERSION)-ffmpeg-rpi \
-t $(DOCKER_REPOSITORY):latest-ffmpeg-rpi \
--push

docker buildx rm builder
Expand Down

0 comments on commit c9eb1a5

Please sign in to comment.