Optimized and fixed idiocy

This commit is contained in:
Lukas Schulz 2020-07-27 15:44:56 +02:00
parent 4459111604
commit 446a20cd39

View file

@ -9,6 +9,7 @@ events {
} }
rtmp { rtmp {
hls_playlist_length 30m;
server { server {
listen 1935; listen 1935;
chunk_size 4000; chunk_size 4000;
@ -25,44 +26,50 @@ rtmp {
#deny publish all; #deny publish all;
exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 1920x1080 exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 1920x1080
-f flv rtmp://localhost:1935/1080p/${name} -vcodec h264_nvenc -s 1920x1080 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/$name_1080p
-vcodec h264_nvenc -s 1920x1080 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/1080p -vcodec h264_nvenc -s 1280x720 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/$name_720p
-f flv rtmp://localhost:1935/dash/1080p; -vcodec h264_nvenc -s 848x480 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/$name_480p
;
exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 1280x720
-f flv rtmp://localhost:1935/720p/${name}
-vcodec h264_nvenc -s 1280x720 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/720p
-f flv rtmp://localhost:1935/dash/720p;
exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 848x480
-f flv rtmp://localhost:1935/480p/${name}
-vcodec h264_nvenc -s 848x480 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/480p
-f flv rtmp://localhost:1935/dash/480p;
# exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 1280x720
# -f flv rtmp://localhost:1935/720p/${name}
# -vcodec h264_nvenc -s 1280x720 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/720p
# -f flv rtmp://localhost:1935/dash/720p;
#
# exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 848x480
# -f flv rtmp://localhost:1935/480p/${name}
# -vcodec h264_nvenc -s 848x480 -vprofile baseline -acodec copy -f flv rtmp://localhost:1935/hls/480p
# -f flv rtmp://localhost:1935/dash/480p;
#
# exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 32x32 # exec ffmpeg -re -i rtmp://localhost:1935/$app/$name -vcodec flv -acodec copy -s 32x32
# -f flv rtmp://localhost:1935/small/${name}; # -f flv rtmp://localhost:1935/small/${name};
} }
application 1080p { # application 1080p {
live on; # live on;
} # }
#
application 720p { # application 720p {
live on; # live on;
} # }
#
application 480p { # application 480p {
live on; # live on;
} # }
#
application small { # application small {
live on; # live on;
} # }
application hls { application hls {
live on; live on;
hls on; hls on;
hls_path /tmp/hls; hls_path /tmp/hls;
hls_nested on;
hls_variant _480p RESOLUTION=848x480;
hls_variant _720p RESOLUTION=1280x720;
hls_variant _1080p RESOLUTION=1920x1080;
} }
application dash { application dash {
@ -77,6 +84,7 @@ http {
server { server {
listen 8080; listen 8080;
listen [::]:8080;
# This URL provides RTMP statistics in XML # This URL provides RTMP statistics in XML
location /stat { location /stat {
@ -104,10 +112,19 @@ http {
add_header Cache-Control no-cache; add_header Cache-Control no-cache;
} }
location /hls/main.m3u8 {
root /var/www/;
}
location /dash { location /dash {
# Serve DASH fragments # Serve DASH fragments
root /tmp; root /tmp;
add_header Cache-Control no-cache; add_header Cache-Control no-cache;
} }
location / {
# Serve static html files
root /var/www/html;
}
} }
} }