support for 0.8.0

This commit is contained in:
Geno 2021-01-28 02:09:30 +01:00
parent b1d96a16e7
commit 60e081e6a1
2 changed files with 16 additions and 11 deletions

View File

@ -1,4 +1,4 @@
location /live-adapt { location /edge-adapt {
add_header 'Access-Control-Allow-Origin' "*" always; add_header 'Access-Control-Allow-Origin' "*" always;
# allow only on subdomain # allow only on subdomain
#valid_referers server_names ~.; #valid_referers server_names ~.;
@ -8,7 +8,7 @@ location /live-adapt {
alias {{ osp_edge_http_path }}/live-adapt; alias {{ osp_edge_http_path }}/live-adapt;
} }
location /live { location /edge {
add_header 'Access-Control-Allow-Origin' "*" always; add_header 'Access-Control-Allow-Origin' "*" always;
# allow only on subdomain # allow only on subdomain
#valid_referers server_names ~.; #valid_referers server_names ~.;

View File

@ -6,8 +6,11 @@ rtmp {
#listen 1935; #listen 1935;
listen [::]:1935; listen [::]:1935;
chunk_size 4096; chunk_size 4096;
ping 30s;
ping_timeout 15s;
drop_idle_publisher 15s;
application stream-data { application edge-data {
live on; live on;
{% for h in osp_edge_allow %} {% for h in osp_edge_allow %}
@ -23,14 +26,15 @@ rtmp {
hls on; hls on;
hls_path {{ osp_edge_http_path }}/live; hls_path {{ osp_edge_http_path }}/live;
hls_fragment 1; hls_fragment 1;
hls_playlist_length 30s; #hls_playlist_length 30s;
hls_playlist_length 30m;
hls_nested on; hls_nested on;
hls_fragment_naming system; hls_fragment_naming sequential;
} }
application stream-data-adapt { application edge-data-adapt {
live on; live on;
{% for h in osp_edge_allow %} {% for h in osp_edge_allow %}
@ -43,8 +47,8 @@ rtmp {
push rtmp://127.0.0.1:1935/live/; push rtmp://127.0.0.1:1935/live/;
exec ffmpeg -i rtmp://127.0.0.1:1935/stream-data-adapt/$name exec ffmpeg -i rtmp://127.0.0.1:1935/edge-data-adapt/$name
-c:v libx264 -c:a aac -b:a 192k -vf "scale=-2:1080" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 4192k -bufsize 8384k -threads 4 -f flv rtmp://127.0.0.1:1935/show/$name_1080 # -c:v libx264 -c:a aac -b:a 192k -vf "scale=-2:1080" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 4192k -bufsize 8384k -threads 4 -f flv rtmp://127.0.0.1:1935/show/$name_1080
-c:v libx264 -c:a aac -b:a 128k -vf "scale=-2:720" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 2096k -bufsize 4192k -threads 4 -f flv rtmp://127.0.0.1:1935/show/$name_720 -c:v libx264 -c:a aac -b:a 128k -vf "scale=-2:720" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 2096k -bufsize 4192k -threads 4 -f flv rtmp://127.0.0.1:1935/show/$name_720
-c:v libx264 -c:a aac -b:a 96k -vf "scale=-2:480" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 1200k -bufsize 2400k -threads 4 -f flv rtmp://127.0.0.1:1935/show/$name_480; -c:v libx264 -c:a aac -b:a 96k -vf "scale=-2:480" -vsync 1 -copyts -start_at_zero -sws_flags lanczos -r 30 -g 30 -keyint_min 30 -force_key_frames "expr:gte(t,n_forced*1)" -tune zerolatency -preset ultrafast -crf 28 -maxrate 1200k -bufsize 2400k -threads 4 -f flv rtmp://127.0.0.1:1935/show/$name_480;
# -c copy -f flv rtmp://127.0.0.1:1935/show/$name_src; # -c copy -f flv rtmp://127.0.0.1:1935/show/$name_src;
@ -64,16 +68,17 @@ rtmp {
hls_path {{ osp_edge_http_path }}/live-adapt; hls_path {{ osp_edge_http_path }}/live-adapt;
hls_nested on; hls_nested on;
hls_fragment 1; hls_fragment 1;
hls_playlist_length 30s; #hls_playlist_length 30s;
hls_playlist_length 30m;
hls_fragment_naming system; hls_fragment_naming sequential;
record off; record off;
# Instruct clients to adjust resolution according to bandwidth # Instruct clients to adjust resolution according to bandwidth
hls_variant _480 BANDWIDTH=1200000; # Medium bitrate, SD resolution hls_variant _480 BANDWIDTH=1200000; # Medium bitrate, SD resolution
hls_variant _720 BANDWIDTH=2048000; # High bitrate, HD 720p resolution hls_variant _720 BANDWIDTH=2048000; # High bitrate, HD 720p resolution
hls_variant _1080 BANDWIDTH=4096000; # FHB 1080p #hls_variant _1080 BANDWIDTH=4096000; # FHB 1080p
#hls_variant _src BANDWIDTH=4096000; # Source bitrate, source resolution #hls_variant _src BANDWIDTH=4096000; # Source bitrate, source resolution
} }