92 lines
2.0 KiB
Plaintext
92 lines
2.0 KiB
Plaintext
|
|
listen 1935;
|
||
|
|
max_connections 1000;
|
||
|
|
daemon off;
|
||
|
|
srs_log_tank console;
|
||
|
|
|
||
|
|
# 模拟器专用优化配置
|
||
|
|
# 减少内存使用
|
||
|
|
mr_enabled off;
|
||
|
|
# 启用快速启动
|
||
|
|
fast_cache 5;
|
||
|
|
# 优化TCP配置
|
||
|
|
tcp_nodelay on;
|
||
|
|
# 减少线程数
|
||
|
|
work_threads 1;
|
||
|
|
|
||
|
|
http_server {
|
||
|
|
enabled on;
|
||
|
|
listen 8080;
|
||
|
|
dir ./objs/nginx/html;
|
||
|
|
# 启用跨域支持
|
||
|
|
crossdomain on;
|
||
|
|
}
|
||
|
|
|
||
|
|
http_api {
|
||
|
|
enabled on;
|
||
|
|
listen 1985;
|
||
|
|
# 启用跨域支持
|
||
|
|
crossdomain on;
|
||
|
|
}
|
||
|
|
|
||
|
|
stats {
|
||
|
|
network 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
vhost __defaultVhost__ {
|
||
|
|
# RTMP 配置 - 模拟器优化
|
||
|
|
rtmp {
|
||
|
|
enabled on;
|
||
|
|
# 减少缓冲区大小,降低延迟
|
||
|
|
chunk_size 2048;
|
||
|
|
}
|
||
|
|
|
||
|
|
# HLS 配置 - 极低延迟模式
|
||
|
|
hls {
|
||
|
|
enabled on;
|
||
|
|
hls_path ./objs/nginx/html;
|
||
|
|
# 极短分片时长,适合模拟器测试
|
||
|
|
hls_fragment 1;
|
||
|
|
hls_window 3;
|
||
|
|
# 启用低延迟模式
|
||
|
|
hls_dispose 10;
|
||
|
|
}
|
||
|
|
|
||
|
|
# HTTP-FLV 配置 - 模拟器优化
|
||
|
|
http_remux {
|
||
|
|
enabled on;
|
||
|
|
mount [vhost]/[app]/[stream].flv;
|
||
|
|
# 启用快速启动
|
||
|
|
fast_cache 5;
|
||
|
|
}
|
||
|
|
|
||
|
|
# 转码配置(关闭以节省资源)
|
||
|
|
transcode {
|
||
|
|
enabled off;
|
||
|
|
}
|
||
|
|
|
||
|
|
# 播放配置 - 模拟器优化
|
||
|
|
play {
|
||
|
|
# 关闭GOP缓存
|
||
|
|
gop_cache off;
|
||
|
|
# 启用时间校正
|
||
|
|
time_jitter full;
|
||
|
|
# 减少队列长度
|
||
|
|
queue_length 5;
|
||
|
|
# 减少缓冲区
|
||
|
|
send_min_interval 10;
|
||
|
|
}
|
||
|
|
|
||
|
|
# 发布配置 - 模拟器优化
|
||
|
|
publish {
|
||
|
|
# 减少首帧等待时间
|
||
|
|
firstpkt_timeout 10000;
|
||
|
|
# 减少正常包超时
|
||
|
|
normal_timeout 3000;
|
||
|
|
}
|
||
|
|
|
||
|
|
# 模拟器专用配置
|
||
|
|
# 减少内存占用
|
||
|
|
chunk_size 2048;
|
||
|
|
# 快速丢弃过期数据
|
||
|
|
queue_length 5;
|
||
|
|
}
|