You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.0 KiB

5 years ago
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
worker_rlimit_nofile 102400;
worker_rlimit_core 2G;
working_directory /tmp;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
stream_zone buckets=1024 streams=4096;
rtmp {
server {
listen 1935;
application live {
send_all off;
zero_start off;
live on;
hls on;
hls_path /tmp/hls;
hls2memory on;
mpegts_cache_time 20s;
hls2_fragment 1300ms;
hls2_max_fragment 1800ms;
hls2_playlist_length 3900ms;
wait_key on;
wait_video on;
cache_time 2s;
low_latency on;
fix_timestamp 2000ms;
# h265 codecid, default 12
hevc_codecid 12;
}
# HLS live config
application hls{
live on;
hls on;
hls_path /home/workspace/install/nginx-1.17.6/www/hls;
hls_fragment 5s;
}
}
}
http {
server {
listen 8080;
location / {
chunked_transfer_encoding on;
root html/;
}
location /flv {
flv_live 1935 app=live;
}
location /ts {
ts_live 1935 app=live;
}
location /rtmp_stat {
rtmp_stat all;
rtmp_stat_stylesheet /stat.xsl;
}
location /xstat {
rtmp_stat all;
}
location /sys_stat {
sys_stat;
}
location /hls {
# Serve HLS fragments
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /home/workspace/install/nginx-1.17.6/www/;
add_header Cache-Control no-cache;
}
location /hls2 {
hls2_live 1935 app=live;
}
location /dash {
# Serve DASH fragments
root /tmp;
add_header Cache-Control no-cache;
}
}
}