-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavideolive_adaptive.conf
78 lines (64 loc) · 3.24 KB
/
avideolive_adaptive.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
rtmp {
access_log /var/log/nginx/rtmp_access.log;
server {
listen 1935;
chunk_size 4000;
#creates our "live" full-resolution HLS videostream from our incomi>
application live {
allow play all;
live on; #
interleave off;
meta on;
wait_key on;
wait_video on;
idle_streams off;
sync 300ms;
session_relay on;
allow publish all;
allow play all;
max_connections 1000;
## == DASH == ##
dash off;
# dash_nested on;
# dash_path /var/livestream/dash;
# dash_fragment 10s;
# dash_playlist_length 60s;
# dash_cleanup on;
on_publish http://localhost/plugin/Live/on_publish.php;
on_play http://localhost/plugin/Live/on_play.php;
on_record_done http://localhost/plugin/Live/on_record_done.php;
#ADAPTATIVE MODE
exec ffmpeg -i rtmp://localhost/live/$name
-c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:240 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 400k -maxrate 700k -bufsize 1200k -b:a 96k -r 20 -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_low
-c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:480 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1200k -maxrate 2100k -bufsize 2400k -b:a 128k -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_mid
-c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:720 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2400k -maxrate 4200k -bufsize 100000k -b:a 128k -f hls -hls_time 6 -hls_list_size 0 -f flv rtmp://localhost/adaptive/$name_hi;
recorder video{
record all;
record_path /var/www/tmp;
record_notify on;
record_max_size 2048M;
record_suffix -%d-%b-%y-%T.flv;
}
}
#ADAPTATIVE MODE
application adaptive {
live on;
hls on;
hls_type live; # guy added
#hls_fragment_naming system;
hls_nested on;
hls_path /HLS/live;
hls_playlist_length 15m;
hls_fragment 4s;
# Guy adding configurations for tests
hls_sync 100ms;
hls_cleanup on;
allow play all;
allow publish 127.0.0.1;
deny publish all;
hls_variant _low BANDWIDTH=400000;
hls_variant _mid BANDWIDTH=2100000;
hls_variant _hi BANDWIDTH=4200000;
}
}
}