From 336f5b122c7098b5ba88b2164090bb0a8c6473f0 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 00:16:18 +0900 Subject: [PATCH 01/17] Build image with the latest Debian base --- Containerfile | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/Containerfile b/Containerfile index 1d76f76..330a804 100644 --- a/Containerfile +++ b/Containerfile @@ -1,8 +1,44 @@ -FROM alqutami/rtmp-hls:latest +FROM debian:12 as build -RUN rm -rf /etc/nginx/nginx.conf && \ - rm -rf /usr/local/nginx/html/players && \ - rm -rf /usr/local/nginx/html/favicon.ico +LABEL maintainer="TechnoTUT " + +EXPOSE 1935 +EXPOSE 80 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update -y && apt-get upgrade -y \ + && apt-get install -y nginx=1.22.1-9 \ + git wget tar build-essential libperl-dev libgeoip-dev libgd-dev libpcre3 libpcre3-dev libxml2 libxslt1-dev libxslt1.1 libxslt1-dev gettext-base \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /tmp && cd /tmp && wget https://nginx.org/download/nginx-1.22.1.tar.gz && tar xzf nginx-1.22.1.tar.gz && rm -f nginx-1.22.1.tar.gz \ + && wget https://www.openssl.org/source/openssl-3.5.0.tar.gz && tar xzf openssl-3.5.0.tar.gz && rm -f openssl-3.5.0.tar.gz \ + && git clone https://github.com/TechnoTUT/nginx-rtmp-module.git \ + && cd /tmp/nginx-1.22.1 \ + && ./configure --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-AoTv4W/nginx-1.22.1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \ + --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=stderr \ + --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ + --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module \ + --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads \ + --with-http_addition_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module \ + --with-http_sub_module --with-mail_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-http_geoip_module=dynamic --with-http_image_filter_module=dynamic \ + --with-http_perl_module=dynamic --with-http_xslt_module=dynamic --with-mail=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic \ + --add-dynamic-module=/tmp/nginx-rtmp-module --with-openssl=/tmp/openssl-3.5.0 \ + && make modules + +FROM debian:12-slim +RUN apt-get update -y && apt-get upgrade -y \ + && apt-get install -y nginx=1.22.1-9 gettext-base \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /usr/lib/nginx/modules \ + && ln -sf /dev/stdout /var/log/nginx/access.log \ + && ln -sf /dev/stderr /var/log/nginx/error.log \ + && rm -rf /etc/nginx/nginx.conf \ + && rm -rf /usr/local/nginx/html/* +COPY --from=build /tmp/nginx-1.22.1/objs/*.so /usr/lib/nginx/modules +COPY --from=build /tmp/nginx-rtmp-module/stat.xsl /usr/local/nginx/html/stat.xsl COPY nginx.conf /etc/nginx/nginx.conf COPY players /usr/local/nginx/html/players COPY favicon.ico /usr/local/nginx/html/favicon.ico + +CMD ["nginx","-g","'daemon off;'"] \ No newline at end of file From 96ea9503cad0610a3ed8f69ab1728c69b765cd98 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 00:45:35 +0900 Subject: [PATCH 02/17] Fix build error --- Containerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Containerfile b/Containerfile index 330a804..86bc3ca 100644 --- a/Containerfile +++ b/Containerfile @@ -8,7 +8,7 @@ EXPOSE 80 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -y && apt-get upgrade -y \ - && apt-get install -y nginx=1.22.1-9 \ + && apt-get install -y nginx \ git wget tar build-essential libperl-dev libgeoip-dev libgd-dev libpcre3 libpcre3-dev libxml2 libxslt1-dev libxslt1.1 libxslt1-dev gettext-base \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /tmp && cd /tmp && wget https://nginx.org/download/nginx-1.22.1.tar.gz && tar xzf nginx-1.22.1.tar.gz && rm -f nginx-1.22.1.tar.gz \ @@ -28,7 +28,7 @@ RUN apt-get update -y && apt-get upgrade -y \ FROM debian:12-slim RUN apt-get update -y && apt-get upgrade -y \ - && apt-get install -y nginx=1.22.1-9 gettext-base \ + && apt-get install -y nginx gettext-base \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /usr/lib/nginx/modules \ && ln -sf /dev/stdout /var/log/nginx/access.log \ From 8c4181d2ca9087ca7d07c8ee639e5126d99afc5d Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 00:55:26 +0900 Subject: [PATCH 03/17] fix CMD error --- Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index 86bc3ca..01b5475 100644 --- a/Containerfile +++ b/Containerfile @@ -41,4 +41,4 @@ COPY nginx.conf /etc/nginx/nginx.conf COPY players /usr/local/nginx/html/players COPY favicon.ico /usr/local/nginx/html/favicon.ico -CMD ["nginx","-g","'daemon off;'"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file From 81c8bb4bf6c61b20dbd9591a4d390f4f382d51bd Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 01:01:30 +0900 Subject: [PATCH 04/17] Add multi-architecture support (amd64/arm64) for Docker image --- .github/workflows/release-containerimage.yml | 107 +++++++++++++++---- 1 file changed, 87 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index ddee9d9..4cf89a4 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -1,48 +1,115 @@ name: Create and publish a Docker image -# Configures this workflow to run every time a change is pushed to the branch called `release`. on: workflow_dispatch: push: -# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +on: + workflow_dispatch: + push: + paths-ignore: + - 'README.md' + env: REGISTRY: ghcr.io IMAGE_NAME: TechnoTUT/rtmp-live-server -# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. jobs: - build-and-push-image: - runs-on: ubuntu-latest - # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + build: + runs-on: ubuntu-24.04 permissions: contents: read packages: write - # + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm64 steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//_}" >> $GITHUB_ENV + - name: Checkout repository uses: actions/checkout@v4 - # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - - name: Log in to the Container registry + + - name: Log in to the container registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. - # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. - # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - - name: Build and push Docker image - uses: docker/build-push-action@v5 + images: ${{ env.IMAGE_NAME }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push by digest + id: build + uses: docker/build-push-action@v6 with: + platforms: ${{ matrix.platform }} context: . - file: ./Containerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + file: Dockerfile + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + merge: + runs-on: ubuntu-24.04 + needs: build + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} \ No newline at end of file From c2829a9becd11008977f1f7c28179c8a39220f05 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 01:12:05 +0900 Subject: [PATCH 05/17] Fixed a few bugs --- Containerfile | 4 +++- nginx.conf | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index 01b5475..121213e 100644 --- a/Containerfile +++ b/Containerfile @@ -34,7 +34,9 @@ RUN apt-get update -y && apt-get upgrade -y \ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ && rm -rf /etc/nginx/nginx.conf \ - && rm -rf /usr/local/nginx/html/* + && rm -rf /usr/local/nginx/html/* \ + && mkdir -p /mnt/hls + COPY --from=build /tmp/nginx-1.22.1/objs/*.so /usr/lib/nginx/modules COPY --from=build /tmp/nginx-rtmp-module/stat.xsl /usr/local/nginx/html/stat.xsl COPY nginx.conf /etc/nginx/nginx.conf diff --git a/nginx.conf b/nginx.conf index 0fd3ad2..5660574 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,3 +1,5 @@ +load_module /usr/lib/nginx/modules/ngx_rtmp_module.so; + worker_processes auto; #error_log logs/error.log; From 58303fbd050b9b47f8de50ae6be93e544bfade6f Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 01:13:16 +0900 Subject: [PATCH 06/17] fix actions --- .github/workflows/release-containerimage.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index 4cf89a4..ec48018 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -1,9 +1,5 @@ name: Create and publish a Docker image -on: - workflow_dispatch: - push: - on: workflow_dispatch: push: From f1f5ec63c42134fd638085991f4a71b11b2aa206 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 01:15:19 +0900 Subject: [PATCH 07/17] fix filename --- .github/workflows/release-containerimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index ec48018..c4a7b0d 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -55,7 +55,7 @@ jobs: with: platforms: ${{ matrix.platform }} context: . - file: Dockerfile + file: Containerfile labels: ${{ steps.meta.outputs.labels }} outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true From 7b7d81d3e1114b4157d33a63a1bb34b521bdd6f5 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 01:28:36 +0900 Subject: [PATCH 08/17] fix hostname error --- .github/workflows/release-containerimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index c4a7b0d..1aaf5b5 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -57,7 +57,7 @@ jobs: context: . file: Containerfile labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | From ad77270864f7724e5eeb655c76e2494a3cc936a1 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 01:36:01 +0900 Subject: [PATCH 09/17] fix repository name lowercase --- .github/workflows/release-containerimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index 1aaf5b5..d5a9ad8 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: TechnoTUT/rtmp-live-server + IMAGE_NAME: technotut/rtmp-live-server jobs: build: From 10416dabdc1bccd4acab5590878375b7ccf49508 Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 09:44:33 +0900 Subject: [PATCH 10/17] fix merge error --- .github/workflows/release-containerimage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index d5a9ad8..5af9881 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -104,7 +104,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) + $(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *) - name: Inspect image run: | From fc5193add18ea79a8a98bab999a76b7cc2520c7b Mon Sep 17 00:00:00 2001 From: DDlia Date: Thu, 19 Jun 2025 11:20:21 +0900 Subject: [PATCH 11/17] Add registry --- .github/workflows/release-containerimage.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-containerimage.yml b/.github/workflows/release-containerimage.yml index 5af9881..501dacb 100644 --- a/.github/workflows/release-containerimage.yml +++ b/.github/workflows/release-containerimage.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: technotut/rtmp-live-server + IMAGE_NAME: ghcr.io/technotut/rtmp-live-server jobs: build: @@ -57,7 +57,7 @@ jobs: context: . file: Containerfile labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true + outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | @@ -104,7 +104,7 @@ jobs: working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - $(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *) + $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *) - name: Inspect image run: | From bba57c6851ccec3941452a87aeabb1ed4311e481 Mon Sep 17 00:00:00 2001 From: DDlia Date: Sat, 21 Jun 2025 13:10:40 +0900 Subject: [PATCH 12/17] fix path --- Containerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index 121213e..1df82ce 100644 --- a/Containerfile +++ b/Containerfile @@ -34,13 +34,13 @@ RUN apt-get update -y && apt-get upgrade -y \ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ && rm -rf /etc/nginx/nginx.conf \ - && rm -rf /usr/local/nginx/html/* \ + && rm -rf /usr/share/nginx/html/* \ && mkdir -p /mnt/hls COPY --from=build /tmp/nginx-1.22.1/objs/*.so /usr/lib/nginx/modules COPY --from=build /tmp/nginx-rtmp-module/stat.xsl /usr/local/nginx/html/stat.xsl COPY nginx.conf /etc/nginx/nginx.conf -COPY players /usr/local/nginx/html/players -COPY favicon.ico /usr/local/nginx/html/favicon.ico +COPY players /usr/share/nginx/html/players +COPY favicon.ico /usr/share/nginx/html/favicon.ico CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file From ed0048a5cad0686f1bb31a4c641f399e4702685a Mon Sep 17 00:00:00 2001 From: DDlia Date: Sat, 21 Jun 2025 13:10:51 +0900 Subject: [PATCH 13/17] add portal page --- index.html | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..de841e9 --- /dev/null +++ b/index.html @@ -0,0 +1,55 @@ + + + + + + TechnoTUT Live + + + + +

TechnoTUT Live

+ +
+ + + +
+ + + From eca1fff3cadee65f76dd4d82fe6db9c9df120a58 Mon Sep 17 00:00:00 2001 From: DDlia Date: Sat, 21 Jun 2025 13:11:14 +0900 Subject: [PATCH 14/17] change config --- nginx.conf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/nginx.conf b/nginx.conf index 5660574..4549035 100644 --- a/nginx.conf +++ b/nginx.conf @@ -15,13 +15,17 @@ rtmp { application live { live on; - drop_idle_publisher 10s; + push rtmp://localhost:1935/show; + } + + applicaton show { + live on; + allow play all; # Allow all clients to play - hls on; - hls_fragment 3; - hls_playlist_length 20; - hls_path /mnt/hls/; - hls_variant _mid BANDWIDTH=448000; + hls on; # Enable HTTP Live Streaming + hls_fragment 3; + hls_playlist_length 10; + hls_path /mnt/hls/; # hls fragments path } } } From 55e576362d358c8133095260c6cb853182c010ef Mon Sep 17 00:00:00 2001 From: DDlia Date: Wed, 25 Jun 2025 02:49:00 +0900 Subject: [PATCH 15/17] Add minimal RTMP configuration for live streaming --- Containerfile | 35 +--- index.html | 55 ------- nginx.conf | 43 +---- players/hls.html | 22 --- players/hls_hlsjs.html | 38 ----- players/rtmp.html | 23 --- players/rtmp_hls.html | 26 --- stat.xsl | 355 +++++++++++++++++++++++++++++++++++++++++ 8 files changed, 366 insertions(+), 231 deletions(-) delete mode 100644 index.html delete mode 100644 players/hls.html delete mode 100644 players/hls_hlsjs.html delete mode 100644 players/rtmp.html delete mode 100644 players/rtmp_hls.html create mode 100644 stat.xsl diff --git a/Containerfile b/Containerfile index 1df82ce..a3cd303 100644 --- a/Containerfile +++ b/Containerfile @@ -1,4 +1,4 @@ -FROM debian:12 as build +FROM debian:12-slim LABEL maintainer="TechnoTUT " @@ -8,39 +8,16 @@ EXPOSE 80 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -y && apt-get upgrade -y \ - && apt-get install -y nginx \ - git wget tar build-essential libperl-dev libgeoip-dev libgd-dev libpcre3 libpcre3-dev libxml2 libxslt1-dev libxslt1.1 libxslt1-dev gettext-base \ - && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /tmp && cd /tmp && wget https://nginx.org/download/nginx-1.22.1.tar.gz && tar xzf nginx-1.22.1.tar.gz && rm -f nginx-1.22.1.tar.gz \ - && wget https://www.openssl.org/source/openssl-3.5.0.tar.gz && tar xzf openssl-3.5.0.tar.gz && rm -f openssl-3.5.0.tar.gz \ - && git clone https://github.com/TechnoTUT/nginx-rtmp-module.git \ - && cd /tmp/nginx-1.22.1 \ - && ./configure --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-AoTv4W/nginx-1.22.1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' \ - --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=stderr \ - --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ - --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module \ - --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads \ - --with-http_addition_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module \ - --with-http_sub_module --with-mail_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-http_geoip_module=dynamic --with-http_image_filter_module=dynamic \ - --with-http_perl_module=dynamic --with-http_xslt_module=dynamic --with-mail=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic \ - --add-dynamic-module=/tmp/nginx-rtmp-module --with-openssl=/tmp/openssl-3.5.0 \ - && make modules - -FROM debian:12-slim -RUN apt-get update -y && apt-get upgrade -y \ - && apt-get install -y nginx gettext-base \ + && apt-get install -y nginx libnginx-mod-rtmp \ && rm -rf /var/lib/apt/lists/* \ - && mkdir -p /usr/lib/nginx/modules \ && ln -sf /dev/stdout /var/log/nginx/access.log \ && ln -sf /dev/stderr /var/log/nginx/error.log \ && rm -rf /etc/nginx/nginx.conf \ - && rm -rf /usr/share/nginx/html/* \ - && mkdir -p /mnt/hls + && rm -rf /var/www/html/favicon.ico \ + && mkdir -p /var/www/html/rtmp -COPY --from=build /tmp/nginx-1.22.1/objs/*.so /usr/lib/nginx/modules -COPY --from=build /tmp/nginx-rtmp-module/stat.xsl /usr/local/nginx/html/stat.xsl COPY nginx.conf /etc/nginx/nginx.conf -COPY players /usr/share/nginx/html/players -COPY favicon.ico /usr/share/nginx/html/favicon.ico +COPY favicon.ico /var/www/html/favicon.ico +COPY stat.xsl /var/www/html/rtmp/stat.xsl CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index de841e9..0000000 --- a/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - TechnoTUT Live - - - - -

TechnoTUT Live

- -
- - - -
- - - diff --git a/nginx.conf b/nginx.conf index 4549035..0348b20 100644 --- a/nginx.conf +++ b/nginx.conf @@ -11,21 +11,13 @@ events { rtmp { server { listen 1935; # Listen on standard RTMP port - chunk_size 4000; + chunk_size 4096; # Set chunk size + allow publish all; + allow play all; application live { live on; - push rtmp://localhost:1935/show; - } - - applicaton show { - live on; - allow play all; # Allow all clients to play - - hls on; # Enable HTTP Live Streaming - hls_fragment 3; - hls_playlist_length 10; - hls_path /mnt/hls/; # hls fragments path + record off; # Disable recording } } } @@ -39,31 +31,6 @@ http { server { listen 8080; - # Serve HLS fragments - location /hls { - types { - application/vnd.apple.mpegurl m3u8; - video/mp2t ts; - } - - root /mnt; - - add_header Cache-Control no-cache; # Disable cache - - # CORS setup - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Expose-Headers' 'Content-Length'; - - # allow CORS preflight requests - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - } - # This URL provides RTMP statistics in XML location /stat { rtmp_stat all; @@ -72,7 +39,7 @@ http { location /stat.xsl { # XML stylesheet to view RTMP stats. - root /usr/local/nginx/html; + root /var/www/html/rtmp; } } diff --git a/players/hls.html b/players/hls.html deleted file mode 100644 index 0e2ab74..0000000 --- a/players/hls.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - HLS Live Streaming - - - - - - - - - - - diff --git a/players/hls_hlsjs.html b/players/hls_hlsjs.html deleted file mode 100644 index 6e7ed79..0000000 --- a/players/hls_hlsjs.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - HLS streaming - - - - - - - - - -
-
- -
-
- - - - - - - diff --git a/players/rtmp.html b/players/rtmp.html deleted file mode 100644 index f5a7814..0000000 --- a/players/rtmp.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - RTMP Live Streaming - Live Streaming - - - - - - - - - - - - diff --git a/players/rtmp_hls.html b/players/rtmp_hls.html deleted file mode 100644 index 194d2d7..0000000 --- a/players/rtmp_hls.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Live Streaming - - - - - - - - - - - - - diff --git a/stat.xsl b/stat.xsl new file mode 100644 index 0000000..92d3d2b --- /dev/null +++ b/stat.xsl @@ -0,0 +1,355 @@ + + + + + + + + + + + + + RTMP statistics + + + +
+ Generated by + nginx-rtmp-module , + nginx , + pid , + built   + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RTMP#clientsVideoAudioIn bytesOut bytesIn bits/sOut bits/sStateTime
Accepted: codecbits/ssizefpscodecbits/sfreqchan + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + live streams + + + + + + + + + + + + vod streams + + + + + + + + + + + + + #cccccc + #dddddd + + + + + + var d=document.getElementById('-'); + d.style.display=d.style.display=='none'?'':'none'; + return false + + + + [EMPTY] + + + + + +    + + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + +
IdStateAddressFlash versionPage URLSWF URLDroppedTimestampA-VTime
+ + +
+ + + + + + + + + + + d + + + + h + + + + m + + + s + + + + + + + + + + + + + T + + + G + + + M + + K + + + + b + B + + /s + + + + + + active + idle + + + + + + + publishing + playing + + + + + + + + + #cccccc + #eeeeee + + + + + + + + http://apps.db.ripe.net/search/query.html?searchtext= + + whois + + + + + + + + + + + + + + + + + + + + + + + + + + publishing + + + + active + + + + x + + +
\ No newline at end of file From a318fd858934416f89030a26c68de79fe9c6f988 Mon Sep 17 00:00:00 2001 From: DDlia Date: Fri, 27 Jun 2025 02:46:24 +0900 Subject: [PATCH 16/17] Add external streaming application --- nginx.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nginx.conf b/nginx.conf index 0348b20..127fb23 100644 --- a/nginx.conf +++ b/nginx.conf @@ -19,6 +19,15 @@ rtmp { live on; record off; # Disable recording } + + application external { + live on; + record off; # Disable recording + # Allow external applications to publish streams + allow publish all; + allow play all; + push rtmp://10.88.254.254/live/technotut; + } } } From ac8e289605f17e8bc49f17f98de049e4e59ef230 Mon Sep 17 00:00:00 2001 From: Kanta Onodera <102458791+dodolia907@users.noreply.github.com> Date: Fri, 19 Jun 2026 00:43:54 +0900 Subject: [PATCH 17/17] Update base image to Debian 13-slim --- Containerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Containerfile b/Containerfile index a3cd303..c4d8e97 100644 --- a/Containerfile +++ b/Containerfile @@ -1,4 +1,4 @@ -FROM debian:12-slim +FROM debian:13-slim LABEL maintainer="TechnoTUT " @@ -20,4 +20,4 @@ COPY nginx.conf /etc/nginx/nginx.conf COPY favicon.ico /var/www/html/favicon.ico COPY stat.xsl /var/www/html/rtmp/stat.xsl -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"]