@
thomaspaine @
fxxkgw 用 nginx 的 rtmp 搭建了服务器,现在遇到一个问题,当推流端遇到网络不稳定丢包的时候, nginx rtmp 上的直播流就会僵死在上面,显示有推送流,但是没有流量。 使用 OBS 客户端没法再继续推流,需要停止等好久一阵 nginx rtmp 上的流才会自行消失,才能继续打开 obs 推流。
配置如下:
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root /data/nginx/nginx-rtmp-module/;
}
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root html;
add_header Cache-Control no-cache;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
rtmp {
server {
listen 1935;
# publish_time_fix off;
application live {
live on; #stream on live allow
record off;
hls on;
hls_path /data/nginx/local/nginx/html/hls;
allow publish all; # control access privilege
allow play all; # control access privilege
}
}
}