Created
June 5, 2016 00:58
-
-
Save kmskrishna/2f88a91ad57704247dcc5c9cf4a89e35 to your computer and use it in GitHub Desktop.
This file contains 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
worker_processes 1; | |
error_log logs/error.log debug; | |
events { | |
worker_connections 1024; | |
} | |
rtmp { | |
server { | |
listen 1935; | |
application src { | |
allow play all; | |
live on; | |
exec ffmpeg -i rtmp://10.9.21.50:1935/src/$name -async 1 -vsync -1 | |
-c:v libx264 -c:a libvo_aacenc -b:v 256k -b:a 32k -vf "scale=480:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -f flv rtmp://10.9.21.50:1935/live/$name_low | |
-c:v libx264 -c:a libvo_aacenc -b:v 768k -b:a 96k -vf "scale=720:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -f flv rtmp://10.9.21.50:1935/live/$name_mid | |
-c:v libx264 -c:a libvo_aacenc -b:v 1024k -b:a 128k -vf "scale=960:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -f flv rtmp://10.9.21.50:1935/live/$name_high | |
-c:v libx264 -c:a libvo_aacenc -b:v 1920k -b:a 128k -vf "scale=1280:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -f flv rtmp://10.9.21.50:1935/live/$name_hd720 | |
-c copy -f flv rtmp://10.9.21.50:1935/live/$name_src; | |
} | |
application live { | |
live on; | |
hls on; | |
hls_path /tmp/live; | |
hls_nested on; | |
hls_fragment 10s; | |
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; | |
} | |
} | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
server { | |
listen 80; | |
server_name 10.9.21.50; | |
location /live { | |
types { | |
application/vnd.apple.mpegurl m3u8; | |
} | |
alias /tmp/live; | |
add_header Cache-Control no-cache; | |
} | |
location /stats { | |
stub_status; | |
} | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment