web: fix config

This commit is contained in:
nyanloutre 2020-04-16 09:12:30 +02:00
parent 447ae08e24
commit 1cbf246394
1 changed files with 7 additions and 5 deletions

View File

@ -161,10 +161,10 @@ in
alias = "/var/www/site-musique/media/"; alias = "/var/www/site-musique/media/";
}; };
}; };
"maxspiegel.fr" = base { "/" = { root = "/run/python-ci/nyanloutre/site-max"; }; "maxspiegel.fr" = base { "/" = { root = "/run/python-ci/nyanloutre/site-max"; }; };
"stream.nyanlout.re" = base { "stream.nyanlout.re" = base {
"/" = { "/" = {
root = "/var/www/hls/" root = "/var/www/hls/";
extraConfig = '' extraConfig = ''
add_header Cache-Control no-cache; add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
@ -185,7 +185,9 @@ in
"ci.nyanlout.re" = simpleReverse 52350; "ci.nyanlout.re" = simpleReverse 52350;
"gitea.nyanlout.re" = simpleReverse config.services.gitea.httpPort; "gitea.nyanlout.re" = simpleReverse config.services.gitea.httpPort;
}; };
appendConfig = '' appendConfig = let
rootLocation = config.services.nginx.virtualHosts."stream.nyanlout.re".locations."/".root;
in ''
rtmp { rtmp {
server { server {
listen 1935; listen 1935;
@ -196,14 +198,14 @@ in
exec_push ${pkgs.ffmpeg}/bin/ffmpeg -i rtmp://localhost/$app/$name -async 1 -vsync -1 exec_push ${pkgs.ffmpeg}/bin/ffmpeg -i rtmp://localhost/$app/$name -async 1 -vsync -1
-c:v libx264 -c:a aac -b:v 768k -b:a 96k -vf "scale=720:trunc(ow/a/2)*2" -tune zerolatency -preset ultrafast -crf 28 -f flv rtmp://localhost/show/$name_mid -c:v libx264 -c:a aac -b:v 768k -b:a 96k -vf "scale=720:trunc(ow/a/2)*2" -tune zerolatency -preset ultrafast -crf 28 -f flv rtmp://localhost/show/$name_mid
-c:v libx264 -c:a aac -b:v 1024k -b:a 128k -vf "scale=960:trunc(ow/a/2)*2" -tune zerolatency -preset ultrafast -crf 28 -f flv rtmp://localhost/show/$name_high -c:v libx264 -c:a aac -b:v 1024k -b:a 128k -vf "scale=960:trunc(ow/a/2)*2" -tune zerolatency -preset ultrafast -crf 28 -f flv rtmp://localhost/show/$name_high
-c copy -f flv rtmp://localhost/show/$name_src 2>>${config.services.nginx.virtualHosts."stream.nyanlout.re".root}/ffmpeg-$name.log; -c copy -f flv rtmp://localhost/show/$name_src 2>>${rootLocation}/ffmpeg-$name.log;
} }
application show { application show {
live on; live on;
hls on; hls on;
hls_path ${config.services.nginx.virtualHosts."stream.nyanlout.re".root}; hls_path ${rootLocation};
hls_fragment 3s; hls_fragment 3s;
hls_playlist_length 60s; hls_playlist_length 60s;