1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Update NGINX configuration to comment out unused settings and improve clarity

This commit is contained in:
Daniel Neto 2025-07-18 17:21:31 -03:00
parent 08098a8384
commit 0d2d5edbd8
3 changed files with 36 additions and 28 deletions

View file

@ -62,7 +62,7 @@ RUN cd /usr/local/nginx/html && \
wget https://youphp.tube/docs/stat.xsl --no-check-certificate && \ wget https://youphp.tube/docs/stat.xsl --no-check-certificate && \
mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.old && \ mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.old && \
cd /usr/local/nginx/conf/ && \ cd /usr/local/nginx/conf/ && \
wget https://raw.githubusercontent.com/WWBN/AVideo/master/plugin/Live/install/nginx.conf --no-check-certificate && \ # wget https://raw.githubusercontent.com/WWBN/AVideo/master/plugin/Live/install/nginx.conf --no-check-certificate && \
mkdir /HLS && \ mkdir /HLS && \
mkdir /HLS/live && \ mkdir /HLS/live && \
mkdir /HLS/low && \ mkdir /HLS/low && \

View file

@ -15,18 +15,18 @@ rtmp {
allow play all; allow play all;
#creates our "live" full-resolution HLS videostream from our incoming encoder stream and tells where to put the HLS video manifest and video fragments #creates our "live" full-resolution HLS videostream from our incoming encoder stream and tells where to put the HLS video manifest and video fragments
application live { application live {
allow play all; #allow play all;
live on; live on;
hls on; #hls on;
hls_nested on; #hls_nested on;
hls_path /HLS/live; #hls_path /HLS/live;
hls_playlist_length 60m; #hls_playlist_length 60m;
hls_fragment 4s; #hls_fragment 4s;
drop_idle_publisher 30s; drop_idle_publisher 30s;
sync 500ms; sync 500ms;
hls_keys on; #hls_keys on;
hls_fragments_per_key 20; #hls_fragments_per_key 20;
#Experimental. Force dropped stream, or ended stream from being watched. (idle_streams) #Experimental. Force dropped stream, or ended stream from being watched. (idle_streams)
#idle_streams off; #idle_streams off;
@ -35,11 +35,13 @@ rtmp {
on_play http://avideo/plugin/Live/on_play.php; on_play http://avideo/plugin/Live/on_play.php;
on_record_done http://avideo/plugin/Live/on_record_done.php; on_record_done http://avideo/plugin/Live/on_record_done.php;
#exec ffmpeg -re -i rtmp://localhost/live/$name exec ffmpeg -re -i rtmp://localhost/live/$name
# -c:v libx264 -preset veryfast -vf scale=-2:240 -r 20 -g 40 -keyint_min 40 -sc_threshold 0 -bf 2 -b_strategy 1 -b:v 400k -maxrate 500k -bufsize 1000k -c:a aac -b:a 96k -ac 2 -ar 44100 -f flv rtmp://localhost/adaptive/$name_low # -c:v libx264 -preset veryfast -vf scale=-2:240 -r 20 -g 40 -keyint_min 40 -sc_threshold 0 -bf 2 -b_strategy 1 -b:v 400k -maxrate 500k -bufsize 1000k -c:a aac -b:a 96k -ac 2 -ar 44100 -f flv rtmp://localhost/adaptive/$name_low
# -c:v libx264 -preset veryfast -vf scale=-2:480 -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -bf 2 -b_strategy 1 -b:v 1200k -maxrate 1500k -bufsize 3000k -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://localhost/adaptive/$name_mid -c:v libx264 -preset veryfast -vf scale=-2:480 -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -bf 2 -b_strategy 1 -b:v 1200k -maxrate 1500k -bufsize 3000k -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://localhost/adaptive/$name_mid;
# -c:v libx264 -preset veryfast -vf scale=-2:720 -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -bf 2 -b_strategy 1 -b:v 2400k -maxrate 2800k -bufsize 5600k -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://localhost/adaptive/$name_hi; # -c:v libx264 -preset veryfast -vf scale=-2:720 -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -bf 2 -b_strategy 1 -b:v 2400k -maxrate 2800k -bufsize 5600k -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://localhost/adaptive/$name_hi;
exec ffmpeg -i rtmp://localhost/live/$name -vn -c:a aac -b:a 64k -ar 44100 -ac 2 -f flv rtmp://localhost/adaptive/${name}_audio;
recorder video { recorder video {
record all manual; record all manual;
record_path /var/www/tmp; record_path /var/www/tmp;
@ -57,23 +59,25 @@ rtmp {
#} #}
} }
#application adaptive { application adaptive {
# live on; live on;
# hls on; hls on;
# hls_path /HLS/live; hls_path /HLS/live;
# hls_nested on; hls_nested on;
# hls_playlist_length 60m; hls_playlist_length 60m;
# hls_fragment 4s; hls_fragment 4s;
# allow play all; allow play all;
# allow publish 127.0.0.1; allow publish 127.0.0.1;
# deny publish all; deny publish all;
hls_keys on;
hls_fragments_per_key 20;
hls_variant _audio BANDWIDTH=64000;
#hls_variant _low BANDWIDTH=900000;
hls_variant _mid BANDWIDTH=1000000;
#hls_variant _hi BANDWIDTH=2500000;
}
# hls_keys on;
# hls_fragments_per_key 20;
# hls_variant _low BANDWIDTH=900000;
# hls_variant _mid BANDWIDTH=1000000;
# hls_variant _hi BANDWIDTH=2500000;
#}
} }
} }
http { http {

View file

@ -46,6 +46,8 @@ rtmp {
# -map "[v720]" -map 0:a:0? -c:v libx264 -preset ultrafast -profile:v baseline -level 3.0 -r 30 -g 120 -keyint_min 120 -crf 23 -maxrate 2000k -bufsize 4000k -c:a aac -b:a 128k -ar 32000 -ac 2 -f flv rtmp://localhost/adaptive/${name}_mid # -map "[v720]" -map 0:a:0? -c:v libx264 -preset ultrafast -profile:v baseline -level 3.0 -r 30 -g 120 -keyint_min 120 -crf 23 -maxrate 2000k -bufsize 4000k -c:a aac -b:a 128k -ar 32000 -ac 2 -f flv rtmp://localhost/adaptive/${name}_mid
# -map "[v1080]" -map 0:a:0? -c:v libx264 -preset ultrafast -profile:v baseline -level 3.0 -r 30 -g 120 -keyint_min 120 -crf 20 -maxrate 4500k -bufsize 9000k -c:a aac -b:a 160k -ar 48000 -ac 2 -f flv rtmp://localhost/adaptive/${name}_hi 2>>/var/www/tmp/ffmpeg_nginx.log; # -map "[v1080]" -map 0:a:0? -c:v libx264 -preset ultrafast -profile:v baseline -level 3.0 -r 30 -g 120 -keyint_min 120 -crf 20 -maxrate 4500k -bufsize 9000k -c:a aac -b:a 160k -ar 48000 -ac 2 -f flv rtmp://localhost/adaptive/${name}_hi 2>>/var/www/tmp/ffmpeg_nginx.log;
#exec ffmpeg -i rtmp://localhost/live/$name -vn -c:a aac -b:a 64k -ar 44100 -ac 2 -f flv rtmp://localhost/adaptive/${name}_audio;
#recorder video { #recorder video {
# record all manual; # record all manual;
# record_path /var/www/tmp; # record_path /var/www/tmp;
@ -76,10 +78,12 @@ rtmp {
# hls_keys on; # hls_keys on;
# hls_fragments_per_key 20; # hls_fragments_per_key 20;
# hls_variant _audio BANDWIDTH=64000;
# hls_variant _low BANDWIDTH=400000; # hls_variant _low BANDWIDTH=400000;
# hls_variant _mid BANDWIDTH=1000000; # hls_variant _mid BANDWIDTH=1000000;
# hls_variant _hi BANDWIDTH=2200000; # hls_variant _hi BANDWIDTH=2200000;
#} #}
} }
} }
http { http {