
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://github.com/tiangolo/nginx-rtmp-docker/workflows/Deploy/badge.svg](https://github.com/tiangolo/nginx-rtmp-docker/actions?query=workflow%3ADeploy)
Dockerfile linksNote: Note: There are https://hub.docker.com/r/tiangolo/nginx-rtmp/tags. If you need to "pin" the Docker image version you use, you can select one of those tags. E.g. tiangolo/nginx-rtmp:latest-2020-08-16.
Docker image with Nginx using the https://github.com/arut/nginx-rtmp-module module for live multimedia (video) streaming.
This Docker image can be used to create an RTMP server for multimedia / video streaming using Nginx and https://github.com/arut/nginx-rtmp-module, built from the current latest sources (Nginx 1.15.0 and nginx-rtmp-module 1.2.1).
This was inspired by other similar previous images from https://hub.docker.com/r/dvdgiessen/nginx-rtmp-docker/, https://hub.docker.com/r/jasonrivers/nginx-rtmp/, https://hub.docker.com/r/aevumdecessus/docker-nginx-rtmp/ and by an OBS Studio post.
The main purpose (and test case) to build it was to allow streaming from OBS Studio to different clients at the same time.
GitHub repo: https://github.com/tiangolo/nginx-rtmp-docker
Docker Hub image: https://hub.docker.com/r/tiangolo/nginx-rtmp/
bashdocker run -d -p 1935:1935 --name nginx-rtmp tiangolo/nginx-rtmp
Run a container with the command above
Open OBS Studio
Click the "Settings" button
Go to the "Stream" section
In "Stream Type" select "Custom Streaming Server"
In the "URL" enter the rtmp://<ip_of_host>/live replacing <ip_of_host> with the IP of the host in which the container is running. For example: rtmp://192.168.0.30/live
In the "Stream key" use a "key" that will be used later in the client URL to display that specific stream. For example: test
Click the "OK" button
In the section "Sources" click the "Add" button (+) and select a source (for example "Screen Capture") and configure it as you need
Click the "Start Streaming" button
Open a VLC player (it also works in Raspberry Pi using omxplayer)
Click in the "Media" menu
Click in "Open Network Stream"
Enter the URL from above as rtmp://<ip_of_host>/live/<key> replacing <ip_of_host> with the IP of the host in which the container is running and <key> with the key you created in OBS Studio. For example: rtmp://192.168.0.30/live/test
Click "Play"
Now VLC should start playing whatever you are transmitting from OBS Studio
You can also verify retransmission by watching the stream yourself. First build and run the image:
bashdocker build -t nginx-rtmp-test . docker run --rm --name nginx-rtmp-test -p 1935:1935 nginx-rtmp-test
In a second terminal, publish a generated test stream:
bash./scripts/publish-test-stream.sh
This publisher is intentionally long-running and will not exit on its own. Leave it running while you watch the stream, then stop it with Ctrl+C.
In a third terminal, watch the retransmitted stream:
bashffplay rtmp://127.0.0.1:1935/live/test
You should see the moving FFmpeg test pattern and hear a generated tone. VLC can also open rtmp://127.0.0.1:1935/live/test as a network stream.
If something is not working you can check the logs of the container with:
bashdocker logs nginx-rtmp
If you need to modify the configurations you can create a file nginx.conf and replace the one in this image using a Dockerfile that is based on the image, for example:
DockerfileFROM tiangolo/nginx-rtmp COPY nginx.conf /etc/nginx/nginx.conf
The current nginx.conf contains:
Nginxworker_processes auto; rtmp_auto_push on; events {} rtmp { server { listen 1935; listen [::]:1935 ipv6only=on; application live { live on; record off; } } }
You can start from it and modify it as you need. Here's the https://github.com/arut/nginx-rtmp-module/wiki/Directives.
This image includes Nginx stream SSL support, so you can terminate TLS in Nginx and proxy the decrypted RTMP connection to the RTMP application. With this setup, clients publish and play through rtmps://<domain>/live/<key> on port 1935, while the internal RTMP server listens on 127.0.0.1:1936.
Create an nginx.conf like this, replacing the certificate paths with paths available inside your container:
Nginxworker_processes auto; rtmp_auto_push on; events {} stream { upstream backend { server 127.0.0.1:1936; } server { listen 1935 ssl; proxy_pass backend; ssl_certificate /etc/nginx/certs/fullchain.pem; ssl_certificate_key /etc/nginx/certs/privkey.pem; } } rtmp { server { listen 1936; chunk_size 4096; application live { live on; record off; } } }
Then build a small image with your custom configuration:
DockerfileFROM tiangolo/nginx-rtmp COPY nginx.conf /etc/nginx/nginx.conf
Run it with your TLS certificates mounted into the container:
bashdocker run -d \ -p 1935:1935 \ -v /path/to/certs:/etc/nginx/certs:ro \ --name nginx-rtmps \ your-nginx-rtmps-image
For example, if your certificate files are mounted as
/etc/nginx/certs/fullchain.pem and /etc/nginx/certs/privkey.pem, configure an
RTMPS client to use:
textrtmps://<domain>/live/<key>
This image is built from the same base official images that most of the other official images, as Python, Node, Postgres, Nginx itself, etc. Specifically, https://hub.docker.com/_/buildpack-deps/ which is in turn based on https://hub.docker.com/_/debian/. So, if you have any other image locally you probably have the base image layers already downloaded.
It is built from the official sources of Nginx and nginx-rtmp-module without adding anything else. (Surprisingly, most of the available images that include nginx-rtmp-module are made from different sources, old versions or add several other components).
It has a simple default configuration that should allow you to send one or more streams to it and have several clients receiving multiple copies of those streams simultaneously. (It includes rtmp_auto_push and an automatic number of worker processes).
Features
Internal
latest-changes GitHub Action and pin actions/checkout@v5. PR https://github.com/tiangolo/nginx-rtmp-docker/pull/108 by https://github.com/tiangolo.issue-manager.yml. PR https://github.com/tiangolo/nginx-rtmp-docker/pull/95 by https://github.com/tiangolo.latest-changes GitHub Action. PR https://github.com/tiangolo/nginx-rtmp-docker/pull/93 by https://github.com/tiangolo.latest-changes.yml. PR https://github.com/tiangolo/nginx-rtmp-docker/pull/70 by https://github.com/alejsdev.Features
--with-debug compile option. PR https://github.com/tiangolo/nginx-rtmp-docker/pull/16 by https://github.com/agconti.Fixes
Docs
Upgrades
Internal
This project is licensed under the terms of the MIT License.
以下是 tiangolo/nginx-rtmp 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务