代码拉取完成,页面将自动刷新
同步操作将从 Moonlight_Z/rtsp2rtmp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#user root;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
application hls {
live on;
hls on;
hls_path /tmp/hls; # 请确保该目录存在或有足够的权限
wait_key on; # 对视频切片进行保护,这样就不会产生马赛克了
hls_fragment 10s; # 每个视频切片的时长 hls_fragment 1s;
hls_max_fragment 20s; # 每个视频切片最大的时长 hls_max_fragment 2s;
hls_playlist_length 60s; # 总共可以回看的事件 hls_playlist_length 3s;
hls_continuous on; # 连续模式。
hls_sync 2ms;
hls_cleanup on; # 对多余的切片进行删除。
hls_nested on; # 嵌套模式
}
}
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8080;
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 /control {
rtmp_control all;
}
location /hls { # 访问示例 - http://192.168.53.21:8080/hls/1/index.m3u8
types{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp;
}
# 大华HLS视频播放代理
location /stream/dss/ {
keepalive_timeout 30;
keepalive_requests 10000000;
proxy_buffer_size 64k;
proxy_buffers 4 128k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404 http_502;
proxy_cache off; # 禁用代理缓存
expires -1; # 禁用页面缓存
proxy_pass http://192.168.1.200:7086/; # 反代目标 URL
sub_filter 'http://192.168.1.200:7086' 'http://$host/'; # 替换 m3u8 文件里的资源链接
sub_filter_last_modified off; # 删除原始响应里的浏览器缓存值
sub_filter_once off; # 替换所有匹配内容
sub_filter_types *; # 匹配任何 MIME 类型
}
#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;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。