Nginx 的 RTMP:知道何时有人开始流式传输

时间:2021-07-14 16:44:33

标签: nginx rtmp nginx-config

我正在使用 nginx for Windows 解决方案,以允许任何基于 Windows 的机器成为在本地网络上托管 RTMP 流的服务器。 如果我查看 nginx/logs/access.log,它包含以下内容:

192.168.1.47 [14/Jul/2021:19:32:52 +0300] PLAY "live" "test" "" - 413 714777 "" "LNX 9,0,124,2" (2s)
192.168.1.47 [14/Jul/2021:19:33:00 +0300] PLAY "live" "test" "" - 379 2248828 "" "LNX 9,0,124,2" (7s)
192.168.1.47 [14/Jul/2021:19:33:41 +0300] PLAY "live" "test" "" - 407 11233283 "" "LNX 9,0,124,2" (31s)
192.168.1.47 [14/Jul/2021:19:42:23 +0300] PUBLISH "live" "test" "" - 247683683 529 "" "FMLE/3.0 (compatible; FMSc/1.0)" (10m 26s)

这有助于确定某人何时尝试观看流以及流何时结束。 但是,如果我需要立即知道某人何时开始流式传输,这不是很有帮助。 我如何配置 nginx 来记录这个? 我可以为此使用 on_publish 指令,但应该用什么语言编写?为最终用户将 PHP 与 nginx 捆绑在一起太多了。 这是我的 nginx.conf


worker_processes 1; 
events 
    { 
    worker_connections 1024; 
} 
rtmp 
{ 
    server 
    { 
        listen 1935; 
        chunk_size 4096;
        application live {
                    live on;
                    record off;
            }
        
    }
}

0 个答案:

没有答案