【发布时间】:2020-11-17 19:33:11
【问题描述】:
我目前正在设置 RTMP 流媒体服务器。服务器运行带有 RTMP 模块的 nginx。
它的工作原理如下:
- OBS 将 RTMP 流发送到服务器上的应用程序。
- 应用程序会检查流媒体的身份,如果正确则允许流式传输。
- 网站可以观看直播。
如您所见,我为每个流媒体提供了多个应用程序。 但我想要一个适用于所有流媒体的应用程序。
我是这样准备 nginx 配置的。
rtmp {
server {
listen 1935;
chunk_size 4096;
hls on;
hls_path /***/hls0;
hls_nested on;
hls_fragment 2s;
hls_playlist_length 600s;
hls_fragment_naming system;
application test {
live on;
record off;
on_publish http://localhost/php/***.php;
on_publish_done http://localhost/php/***.php
}
[...]
现在一切都准备好了,但一次只适用于一个流媒体。 接受 2 个不同的流媒体(应用返回 http 代码 200),但第二个无法开始流媒体。
有什么办法可以解决这个问题吗?
【问题讨论】:
标签: nginx http-live-streaming rtmp