Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #user nobody;
- worker_processes 1;
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- server {
- listen 1936;
- server_name localhost;
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- location /hls {
- types {
- application/vnd.apple.mpegurl m3u8;
- }
- root /tmp;
- add_header Cache-Control no-cache;
- }
- }
- }
- rtmp {
- server {
- listen 1935;
- chunk_size 4096;
- application live1 { # stream url/key: rtmp://domain.com/live1/key001
- live on;
- record off;
- hls on;
- hls_path hls;
- hls_fragment 5s;
- hls_cleanup on;
- hls_type live;
- allow publish 20.20.20.20; #example user IP 1
- allow publish 21.21.21.21; #example user IP 2
- allow publish 22.22.22.22; #example user IP 3
- allow publish 23.23.23.23; #example user IP 4
- allow publish 24.24.24.24; #example user IP 5
- deny publish all;
- push rtmp://hitbox.tv/streamkey; #push to hitbox
- push rtmp://twitch.tv/streamkey; #push to twitch
- exec ffmpeg -i rtmp://localhost/live1/$name -threads 1 -c:v libx264 -profile:v baseline -b:v 750K -s 640x360 -f flv -c:a aac -ac 1 -strict -2 -b:a 96k rtmp://localhost/live1lq/$name;
- }
- application live1lq { #low quality game stream
- live on;
- record off;
- allow publish 127.0.0.1;
- allow publish 0.0.0.0;
- deny publish all;
- }
- application live2 { # stream url/key: rtmp://domain.com/live2/streamkey
- live on;
- record off;
- hls on;
- hls_path hls;
- hls_fragment 5s;
- hls_cleanup on;
- hls_type live;
- allow publish 20.20.20.20; #example user IP 1
- allow publish 21.21.21.21; #example user IP 2
- allow publish 22.22.22.22; #example user IP 3
- allow publish 23.23.23.23; #example user IP 4
- allow publish 24.24.24.24; #example user IP 5
- deny publish all;
- push rtmp://other.streamsite.net/streamkey; #push to other streaming site
- push rtmp://other.streamsite.com/streamkey; #push to other streaming site
- exec ffmpeg -i rtmp://localhost/live2/$name -threads 1 -c:v libx264 -profile:v baseline -b:v 750K -s 640x360 -f flv -c:a aac -ac 1 -strict -2 -b:a 96k rtmp://localhost/live2lq/$name;
- }
- application live2lq { #low quality movie stream
- live on;
- record off;
- allow publish 127.0.0.1;
- allow publish 0.0.0.0;
- deny publish all;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement