1 Star 0 Fork 24

Concise/rtsp2rtmp

forked from Moonlight_Z/rtsp2rtmp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rtsp2rtmp nginx conf.txt 3.33 KB
一键复制 编辑 原始数据 按行查看 历史
#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;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/Concis/rtsp2rtmp.git
[email protected]:Concis/rtsp2rtmp.git
Concis
rtsp2rtmp
rtsp2rtmp
master

搜索帮助