-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
60 lines (48 loc) · 1.51 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
daemon off;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
rtmp {
server {
listen ${RTMP_PORT};
chunk_size 4000;
#buflen 1s;
application stream {
live on;
# Profile main doesn´t work
exec ffmpeg -i rtmp://localhost:1935/stream/$name
-c:a libfdk_aac -b:a 256k -c:v h264_nvenc -zerolatency -strict_gop -b:v 4000k -f flv -g 120 -r 30 -s 1280x720 -preset fast rtmp://localhost:1935/hls/$name_720p4256kbs;
}
application hls {
live on;
hls on;
hls_fragment_naming system;
hls_fragment 4s;
hls_playlist_length 12s;
hls_path /opt/data/hls;
hls_nested on;
hls_variant _720p4256kbs BANDWIDTH=4256000,RESOLUTION=1280x720;
hls_variant _720p1756kbs BANDWIDTH=1756000,RESOLUTION=1280x720;
}
}
}
http {
access_log /dev/stdout combined;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
server {
listen ${HTTP_PORT};
location /live {
alias /opt/data/hls;
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
}
}