Created
September 19, 2018 17:41
-
-
Save bookercodes/8b884a1374ec5f44aa30aa4c73989ee4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error_log logs/error.log; | |
events { | |
worker_connections 1024; | |
} | |
rtmp { | |
server { | |
listen 1935; | |
chunk_size 4000; | |
application live { | |
live on; | |
exec /usr/bin/ffmpeg -i rtmp://localhost/live/$name -async 1 -vsync -1 -c copy -f flv rtmp://localhost/hls/bookerrooo; | |
} | |
application hls { | |
live on; | |
hls on; | |
hls_path /tmp/hls; | |
hls_fragment 2; | |
hls_playlist_length 8; | |
# hls_nested on; | |
# hls_variant _low BANDWIDTH=288000; | |
# hls_variant _mid BANDWIDTH=448000; | |
# hls_variant _high BANDWIDTH=1152000; | |
# hls_variant _hd720 BANDWIDTH=2048000; | |
# hls_variant _src BANDWIDTH=4096000; | |
deny play all; | |
} | |
} | |
} | |
http { | |
server { | |
listen 8080; | |
location /hls { | |
add_header 'Access-Control-Allow-Origin' '*' always; | |
add_header 'Access-Control-Expose-Headers' 'Content-Length'; | |
types { | |
application/vnd.apple.mpegurl m3u8; | |
video/mp2t ts; | |
} | |
root /tmp; | |
add_header Cache-Control no-cache; | |
} | |
} | |
} | |
?} 3,1 All |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment