SRS 6.0-b0 源码 + danmaku 后端(排除 objs/3rdparty/测试媒体)

This commit is contained in:
RRRosmontis
2026-08-27 21:46:20 +08:00
commit 41b5da7c7e
578 changed files with 237858 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
# conf/srs.conf
# SRS 全局配置
listen 1935; # RTMP 推流端口
max_connections 1000; # 最大连接数
daemon off; # Windows 下建议关闭守护进程模式,便于调试
srs_log_tank console; # 日志输出到控制台(可改为 file 并指定路径)
# HTTP API 配置(供 Nginx 反向代理使用)
http_api {
enabled on;
listen 1985; # SRS HTTP API 端口,Nginx 代理到该端口
#crossdomain on; # 允许跨域请求
}
# HTTP 文件服务(可选,本场景不需要)
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
# WebRTC 服务器配置(关键)
rtc_server {
enabled on;
listen 8000; # WebRTC 媒体 UDP 端口
# 重要:必须设置为你的公网 IP,否则客户端无法连接
candidate 39.97.55.150;
}
# 默认虚拟主机配置
vhost __defaultVhost__ {
# 启用 WebRTC 支持
rtc {
enabled on;
rtmp_to_rtc on;
pli_for_rtmp on;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
hls {
enabled on; # 开启 HLS
hls_path ./objs/nginx/html; # HLS 文件存储路径(需与 http_server 的目录一致)
hls_fragment 2; # 每个 TS 切片时长(秒)
hls_window 5; # 滚动窗口大小(秒)
hls_cleanup on; # 自动清理过期切片
}
http_hooks {
enabled on;
on_publish http://127.0.0.1:1986/remote_srs/local/on_publish;
on_unpublish http://127.0.0.1:1986/remote_srs/local/on_unpublish;
}
}