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 –