【发布时间】:2017-08-24 21:22:54
【问题描述】:
我用rtmp module 编译了 nginx。我启动 nginx 并运行以下命令以开始流式传输我的网络摄像头,它可以工作:
ffmpeg -i /dev/video0 -f flv rtmp://localhost/live/test
然后我尝试使用control module 开始录制:
curl "http://localhost:8080/control/record/start?app=application&name=test&rec=rec1"
但录制事件似乎没有触发。
这是我的nginx.conf 文件的简化版本:
rtmp {
server {
# ... more code here
recorder rec1 {
record all manual;
record_suffix all.flv;
record_path /tmp/rec;
record_unique on;
}
}
}
http {
server {
listen 8080;
server_name localhost;
location /control {
rtmp_control all;
}
}
# ... more code here
}
注意:检查端口 8080 和 1935 都使用nmap 打开。
注意/更新:
我注意到,如果我将 app= 更改为 live,我会收到一条实际的错误消息:
<html>
<head><title>500 Internal Server Error</title></head>
<body bgcolor="white">
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/1.11.1</center>
</body>
</html>
与带有实际应用名称的命令相反,它不返回任何内容。这告诉我它在某种程度上是有效的,但我仍然没有重新编码。
我也在尝试将 name=test 切换到 name=live 都不会导致错误响应。
更新 #2:
当我使用上面的curl 命令时,我正在观看/var/log/nginx/error.log。每次我使用它都会记录以下内容:
client 127.0.0.1 closed keepalive connection
【问题讨论】:
-
发布完整的 nginx 配置和部分配置
-
@TarunLalwani gist.github.com/kirkins/fb811f8caf34d3cdf1d9874050fb1a62