0
我有用rtmp module编译的nginx。我开始nginx
并运行以下开始串流我的摄像头,其工作原理:rtmp 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:
我看/var/log/nginx/error.log
,而我使用上面的curl
命令。每当我使用它时,记录如下:
client 127.0.0.1 closed keepalive connection
邮政完整的nginx的配置,只是它的一部分 –
@TarunLalwani https://gist.github.com/kirkins/fb811f8caf34d3cdf1d9874050fb1a62 –