ZerueLX11

Nginx RTMP Configuration 2021

Apr 21st, 2020 (edited)
1,370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.38 KB | None | 0 0
  1. worker_processes  1;
  2.  
  3. error_log  logs/error.log  debug;
  4. pid        logs/nginx.pid;
  5. user www-data www-data;
  6.  
  7. events {
  8.     worker_connections  1024;
  9. }
  10.  
  11. http {
  12.     allow all;
  13.     deny all;
  14.     access_log    logs/rtmp_access.log;
  15.     include       mime.types;
  16.     default_type  application/octet-stream;
  17.     sendfile        on;
  18.     keepalive_timeout  65;
  19.     client_max_body_size 100M;
  20.  
  21.     server {
  22.         listen       80;
  23.         server_name  localhost;
  24.  
  25.     # rtmp stat
  26.     location /stat {
  27.         rtmp_stat all;
  28.         rtmp_stat_stylesheet stat.xsl;
  29.     }
  30.  
  31.         location / {
  32.             root   html;
  33.             index  index.html index.htm;
  34.         }
  35.  
  36.         error_page   500 502 503 504  /50x.html;
  37.         location = /50x.html {
  38.             root   html;
  39.         }
  40.  
  41.      }
  42. }
  43.  
  44. rtmp {
  45.  
  46.     server {
  47.  
  48.         listen 1935;
  49.         max_message 5M;
  50.         chunk_size 8192;
  51.  
  52.         application transcoder {
  53.  
  54.             live on;
  55.             meta copy;
  56.             exec ffmpeg -i rtmp://192.168.1.223/transcoder/origin -c:v libx264 -preset medium -b:v 6000k -minrate 6000k -maxrate 6000k -bufsize 12000k -g 120 -keyint_min 60 -sws_flags lanczos -s 1600x900 -qcomp 0.4 -direct-pred spatial -r 60 -pix_fmt yuv420p -c:a aac -b:a 320k -ac 2 -ar 48000  -f flv rtmp://192.168.1.223/twitch/passed;
  57.  
  58.         }
  59.  
  60.         application twitch {
  61.  
  62.             live on;
  63.             meta copy;
  64.             push  rtmp://lax.contribute.live-video.net/app/[STREAMKEY];
  65.  
  66.         }
  67.     }
  68. }
Add Comment
Please, Sign In to add comment