Advertisement
sneaky4oe

SneakyJoe.ru server config ATM

Jan 7th, 2018
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 25.06 KB | None | 0 0
  1. #user  nobody;
  2. worker_processes  1;
  3.  
  4. #error_log  logs/error.log;
  5. #error_log  logs/error.log  notice;
  6. #error_log  logs/error.log  info;
  7.  
  8. #pid        logs/nginx.pid;
  9.  
  10.  
  11. events {
  12.     worker_connections  1024;
  13. }
  14.  
  15.  
  16. http {
  17.     include       mime.types;
  18.     default_type  application/octet-stream;
  19.  
  20.     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  21.     #                  '$status $body_bytes_sent "$http_referer" '
  22.     #                  '"$http_user_agent" "$http_x_forwarded_for"';
  23.  
  24.     #access_log  logs/access.log  main;
  25.  
  26.     sendfile        on;
  27.     #tcp_nopush     on;
  28.  
  29.     #keepalive_timeout  0;
  30.     keepalive_timeout  65;
  31.  
  32.     #gzip  on;
  33.  
  34.     server {
  35.         listen       80;
  36.         server_name  localhost;
  37.  
  38.         #charset koi8-r;
  39.  
  40.         #access_log  logs/host.access.log  main;
  41.  
  42.         location / {
  43.             root   html;
  44.             index  index.html index.htm;
  45.         }
  46.  
  47.         #error_page  404              /404.html;
  48.  
  49.         # redirect server error pages to the static page /50x.html
  50.         #
  51.         error_page   500 502 503 504  /50x.html;
  52.         location = /50x.html {
  53.             root   html;
  54.         }
  55.  
  56.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  57.         #
  58.         #location ~ \.php$ {
  59.         #    proxy_pass   http://127.0.0.1;
  60.         #}
  61.  
  62.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  63.         #
  64.         #location ~ \.php$ {
  65.         #    root           html;
  66.         #    fastcgi_pass   127.0.0.1:9000;
  67.         #    fastcgi_index  index.php;
  68.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
  69.         #    include        fastcgi_params;
  70.         #}
  71.  
  72.         # deny access to .htaccess files, if Apache's document root
  73.         # concurs with nginx's one
  74.         #
  75.         #location ~ /\.ht {
  76.         #    deny  all;
  77.         #}
  78.     }
  79.  
  80.  
  81.     # another virtual host using mix of IP-, name-, and port-based configuration
  82.     #
  83.     #server {
  84.     #    listen       8000;
  85.     #    listen       somename:8080;
  86.     #    server_name  somename  alias  another.alias;
  87.  
  88.     #    location / {
  89.     #        root   html;
  90.     #        index  index.html index.htm;
  91.     #    }
  92.     #}
  93.  
  94.  
  95.     # HTTPS server
  96.     #
  97.     #server {
  98.     #    listen       443 ssl;
  99.     #    server_name  localhost;
  100.  
  101.     #    ssl_certificate      cert.pem;
  102.     #    ssl_certificate_key  cert.key;
  103.  
  104.     #    ssl_session_cache    shared:SSL:1m;
  105.     #    ssl_session_timeout  5m;
  106.  
  107.     #    ssl_ciphers  HIGH:!aNULL:!MD5;
  108.     #    ssl_prefer_server_ciphers  on;
  109.  
  110.     #    location / {
  111.     #        root   html;
  112.     #        index  index.html index.htm;
  113.     #    }
  114.     #}
  115.  
  116. }
  117.  
  118. rtmp {
  119.     server {
  120.         listen 1935;
  121.  
  122.         chunk_size 4000;
  123.  
  124.         ping 1m;
  125.         ping_timeout 10s;
  126.         drop_idle_publisher 10s;
  127.  
  128. ####################################################################
  129. #
  130. #    #########  ########   ########  #########
  131. #        #      #         #              #
  132. #        #      #         #              #
  133. #        #      ########   #######       #
  134. #        #      #                 #      #
  135. #        #      #                 #      #
  136. #        #      ########  ########       #
  137. #
  138. ####################################################################
  139.  
  140.                                         application testerT
  141.                                                 {
  142.  
  143.                                                 # Receives stream, removes key, sends to test transcoder
  144.  
  145.                                                         live on;
  146.                                                         meta copy;
  147.  
  148.                                                         push rtmp://localhost/transcoderT/;
  149.                                                 }
  150.  
  151.                                         application transcoderT
  152.                                                 {
  153.                                                         live on;
  154.                                                         meta copy;
  155.  
  156.                                                      # 1080 all sites
  157.                                                         exec ffmpeg -i rtmp://localhost/transcoderT/
  158.  
  159.                                                         -b:v 6500k
  160.                                                         -minrate 6000k
  161.                                                         -maxrate 7000k
  162.                                                         -bufsize 7800k
  163.  
  164.                                                         -vcodec libx264
  165.                                                         -preset faster
  166.                                                         -s 1920x1080
  167.                                                         -sws_flags bicubic
  168.  
  169.                                                      #  -vf unsharp=3:3:1.5 # Video sharpening
  170.  
  171.                                                         -r 60
  172.                                                         -x264-params nal-hrd=cbr:force-cfr=1:keyint=120
  173.  
  174.                                                         -acodec aac
  175.                                                         -ab 160k
  176.                                                         -strict -2
  177.  
  178.                                                         -f flv rtmp://localhost/tester/;
  179.                                                 }
  180.  
  181.                                        application tester
  182.                                                 {
  183.  
  184.                                                 # Sends to test twitch sneakyjoetest and saves local record
  185.  
  186.                                                         live on;
  187.  
  188.                                                         push rtmp://live-ber.twitch.tv/app/liv******************;
  189.  
  190.                                                         recorder all
  191.                                                         {
  192.                                                                 record all;
  193.                                                                 record_path /home/sneakyjoe/RECS;
  194.                                                                 record_suffix %Y.%m.%d___%H-%M___1080_test.flv;
  195.                                                         }
  196.                                                 }
  197.  
  198. #######################################################################################
  199. #
  200. #    ########   ########  ########  ########  #  #      #  ########  ########
  201. #    #       #  #         #         #         #  #      #  #         #       #
  202. #    #       #  #         #         #         #  #      #  #         #       #
  203. #    #     ##   ########  #         ########  #  #      #  ########  #     ##
  204. #    #####      #         #         #         #   #    #   #         #####
  205. #    #    ##    #         #         #         #    #  #    #         #    ##
  206. #    #      ##  ########  ########  ########  #     ##      ########  #      ##
  207. #
  208. #######################################################################################
  209.  
  210.             application receiver
  211.                 {
  212.                     live on;
  213.                     meta copy;
  214.  
  215.                     push rtmp://localhost/transcoder;
  216.                 }
  217.  
  218.  
  219.             application receiver-art
  220.                 {
  221.                     live on;
  222.                     meta copy;
  223.  
  224.                     push rtmp://localhost/transcoder-art;
  225.                 }
  226.  
  227.  
  228. #########################################################################################################################################################################
  229. #
  230. #    #########  ########     ####    #      #   ########   #######     #######   #######     ########  ########        ######     ####    #      #  ########   ########
  231. #        #      #       #   #    #   ##     #  #          #           #       #  #      #    #         #       #      #      #   #    #   ##    ##  #         #
  232. #        #      #       #  #      #  # #    #  #          #           #       #  #       #   #         #       #     #          #      #  # #  # #  #         #
  233. #        #      #     ##   ########  #  #   #   #######   #           #       #  #       #   ########  #     ##      #          ########  #  ##  #  ########   #######
  234. #        #      #####      #      #  #   #  #          #  #           #       #  #       #   #         #####         #   ####   #      #  #      #  #                 #
  235. #        #      #    ##    #      #  #    # #          #  #           #       #  #      #    #         #    ##        #      #  #      #  #      #  #                 #
  236. #        #      #      ##  #      #  #     ##  ########    #######     #######   #######     ########  #      ##       ######   #      #  #      #  ########  ########
  237. #
  238. ##########################################################################################################################################################################
  239.  
  240.             application transcoder
  241.                 {
  242.                     live on;
  243.                     meta copy;
  244.  
  245.                 # 1080 all sites
  246.                     exec ffmpeg -i rtmp://localhost/transcoder/
  247.  
  248.                     -b:v 6500k
  249.                     -minrate 6000k
  250.                     -maxrate 7000k
  251.                     -bufsize 7800k
  252.  
  253.                     -vcodec libx264
  254.                     -preset faster
  255.                     -s 1920x1080
  256.                     -sws_flags bicubic
  257.  
  258.                   #  -vf unsharp=3:3:1.5 # Video sharpening
  259.  
  260.                     -r 60
  261.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=120
  262.  
  263.  
  264.                     -acodec aac
  265.                     -ab 160k
  266.                     -strict -2
  267.  
  268.                 #   -f flv rtmp://localhost/tester/
  269.                    -f flv rtmp://localhost/transcoded-1080/
  270.  
  271.                     -loglevel verbose
  272.                     2>>/home/sneakyjoe/ffmpeg-log.txt
  273.                     ;
  274.  
  275.                 # 560 periscope
  276.  
  277.                     exec ffmpeg -i rtmp://localhost/transcoder/
  278.  
  279.                     # -vf drawtext="fontfile=/home/sneakyjoe/RECS/font/consolas.ttf:text='1080p-60 available at sneakyjoe.ru':fontcolor=white:fontsize=33:box=1:boxcolor=red@0.5:boxborderw=5:x=20:y=20"
  280.  
  281.                     -b:v 740k
  282.                     -minrate 600k
  283.                     -maxrate 800k
  284.                     -bufsize 800k
  285.  
  286.                     -vcodec libx264
  287.                     -preset fast
  288.                     -s 960x540
  289.                     -sws_flags lanczos
  290.  
  291.                     -r 30
  292.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=60
  293.  
  294.                     -acodec aac
  295.                     -ab 90k
  296.                     -strict -2
  297.  
  298.                     -f flv rtmp://localhost/transcoded-560/
  299.                     ;
  300.  
  301.                 }
  302.  
  303.  
  304. #########################################################################################################################################################################
  305. #
  306. #    #########  ########     ####    #      #   ########   #######     #######   #######     ########  ########        ####    ########   #########
  307. #        #      #       #   #    #   ##     #  #          #           #       #  #      #    #         #       #      #    #   #       #      #
  308. #        #      #       #  #      #  # #    #  #          #           #       #  #       #   #         #       #     #      #  #       #      #
  309. #        #      #     ##   ########  #  #   #   #######   #           #       #  #       #   ########  #     ##      ########  #     ##       #
  310. #        #      #####      #      #  #   #  #          #  #           #       #  #       #   #         #####         #      #  #####          #
  311. #        #      #    ##    #      #  #    # #          #  #           #       #  #      #    #         #    ##       #      #  #    ##        #
  312. #        #      #      ##  #      #  #     ##  ########    #######     #######   #######     ########  #      ##     #      #  #      ##      #
  313. #
  314. ##########################################################################################################################################################################
  315.  
  316.  
  317.             application transcoder-art
  318.                 {
  319.                     live on;
  320.                     meta copy;
  321.  
  322.                 # 1080 all sites
  323.                     exec ffmpeg -i rtmp://localhost/transcoder-art/
  324.  
  325.                     -b:v 1200k
  326.                     -minrate 800k
  327.                     -maxrate 1500k
  328.                     -bufsize 2000k
  329.  
  330.                     -vcodec libx264
  331.                     -preset faster
  332.                     -s 1920x1080
  333.                     -sws_flags bicubic
  334.  
  335.                   #  -vf unsharp=3:3:1.5 # Video sharpening
  336.  
  337.                     -r 30
  338.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=60
  339.  
  340.  
  341.                     -acodec aac
  342.                     -ab 160k
  343.                     -strict -2
  344.  
  345.                 #   -f flv rtmp://localhost/tester/;
  346.                     -f flv rtmp://localhost/transcoded-1080-art/;
  347.  
  348.                 # 560 periscope
  349.                     exec ffmpeg -i rtmp://localhost/transcoder-art/
  350.  
  351.                     -b:v 740k
  352.                     -minrate 600k
  353.                     -maxrate 800k
  354.                     -bufsize 800k
  355.  
  356.                     -vcodec libx264
  357.                     -preset fast
  358.                     -s 1280x720
  359.                     -sws_flags lanczos
  360.  
  361.                     -r 30
  362.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=60
  363.  
  364.  
  365.                     -acodec aac
  366.                     -ab 90k
  367.                     -strict -2
  368.  
  369.                     -f flv rtmp://localhost/transcoded-720-art/;
  370.  
  371.                 }
  372.  
  373. #########################################################################################################################################################################
  374. #
  375. #    #########  ########     ####    #      #   ########   #######     #######   #######     ########  ########      ########   ########   ########  #########  ########   ########
  376. #        #      #       #   #    #   ##     #  #          #           #       #  #      #    #         #       #     #       #  #         #              #      #       #  #
  377. #        #      #       #  #      #  # #    #  #          #           #       #  #       #   #         #       #     #       #  #         #              #      #       #  #
  378. #        #      #     ##   ########  #  #   #   #######   #           #       #  #       #   ########  #     ##      #     ##   ########   #######       #      #     ##   ########
  379. #        #      #####      #      #  #   #  #          #  #           #       #  #       #   #         #####         #####      #                 #      #      #####      #
  380. #        #      #    ##    #      #  #    # #          #  #           #       #  #      #    #         #    ##       #    ##    #                 #      #      #    ##    #
  381. #        #      #      ##  #      #  #     ##  ########    #######     #######   #######     ########  #      ##     #      ##  ########  ########       #      #      ##  ########
  382. #
  383. ##########################################################################################################################################################################
  384.  
  385.             application transcoderRestream
  386.                 {
  387.                     live on;
  388.                     meta copy;
  389.  
  390.                 # 1080 all sites
  391.                     exec ffmpeg -i rtmp://localhost/transcoderRestream/
  392.  
  393.  
  394.  
  395.                     -b:v 7000k
  396.                     -minrate 6500k
  397.                     -maxrate 7500k
  398.                     -bufsize 7800k
  399.  
  400.                     -vcodec libx264
  401.                     -preset fast
  402.                 #    -s 1920x1080
  403.                     -sws_flags bicubic
  404.  
  405.                   #  -vf unsharp=3:3:1.5 # Video sharpening
  406.  
  407.                     -r 60
  408.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=120
  409.  
  410.                     -acodec aac
  411.                     -ab 160k
  412.                     -strict -2
  413.  
  414.                 #   -f flv rtmp://localhost/tester/
  415.                    -f flv rtmp://localhost/restreamMain
  416.  
  417.                     -loglevel verbose
  418.                     2>>/home/sneakyjoe/ffmpeg-log.txt
  419.                     ;
  420.                 }
  421.  
  422.             application restreamMain
  423.                 {
  424.                     # 1920x1080
  425.  
  426.                     live on;
  427.  
  428.                     ## Restream.io main 1099
  429.                        push rtmp://eu-central.restream.io/live/**************************;
  430.  
  431.                         recorder all
  432.                         {
  433.                              record all;
  434.                              record_path /home/sneakyjoe/RECS;
  435.                              record_suffix %Y.%m.%d___%H-%M___1080.flv;
  436.                         }
  437.                 }
  438.  
  439.  
  440.  
  441. ####################################################################################################################
  442. #
  443. #      ######     ####    #      #  ########   ########        #######   #       #  #########
  444. #     #      #   #    #   ##    ##  #         #               #       #  #       #      #
  445. #    #          #      #  # #  # #  #         #               #       #  #       #      #
  446. #    #          ########  #  ##  #  ########   #######        #       #  #       #      #
  447. #    #   ####   #      #  #      #  #                 #       #       #  #       #      #
  448. #     #      #  #      #  #      #  #                 #       #       #   #     ##      #
  449. #      ######   #      #  #      #  ########  ########         #######     ##### #      #
  450. #
  451. #####################################################################################################################
  452.  
  453.             application transcoded-1080
  454.                 {
  455.                     # 1920x1080
  456.  
  457.                     live on;
  458.  
  459.                     ## Twitch Source
  460.                       push rtmp://live-ber.twitch.tv/app/************************;
  461.  
  462.                     ## Restream's official twitch
  463.                     #  push rtmp://live-ber.twitch.tv/app/**************************;
  464.  
  465.                     ## YouTube Source
  466.                       push rtmp://a.rtmp.youtube.com/live2/**************************;
  467.  
  468.                     ## Steam
  469.                       push rtmp://upload.broadcast.fra.steamstatic.com/app/**************************;
  470.  
  471.                     ## Restream.io -> ya.ru side streams
  472.                        push rtmp://eu-frankfurt1.restream.io:1936/live/**************************;
  473.  
  474.                         recorder all
  475.                         {
  476.                              record all;
  477.                              record_path /home/sneakyjoe/RECS;
  478.                              record_suffix %Y.%m.%d___%H-%M___1080.flv;
  479.                         }
  480.                 }
  481.  
  482.             application transcoded-560
  483.                 {
  484.                     # 960x540
  485.  
  486.                     live on;
  487.  
  488.                     # Restream dontrash low quality
  489.                     push rtmp://eu-central.restream.io/live/**************************;
  490.  
  491.                         recorder all
  492.                         {
  493.                              record all;
  494.                              record_path /home/sneakyjoe/RECS;
  495.                              record_suffix %Y.%m.%d___%H-%M____560.flv;
  496.                         }
  497.                 }
  498.  
  499. ####################################################################################################################
  500. #
  501. #      ####    ########   #########        #######   #       #  #########
  502. #     #    #   #       #      #           #       #  #       #      #
  503. #    #      #  #       #      #           #       #  #       #      #
  504. #    ########  #     ##       #           #       #  #       #      #
  505. #    #      #  #####          #           #       #  #       #      #
  506. #    #      #  #    ##        #           #       #   #     ##      #
  507. #    #      #  #      ##      #            #######     ##### #      #
  508. #
  509. #####################################################################################################################
  510.  
  511.             application transcoded-1080-art
  512.                 {
  513.                     live on;
  514.  
  515.                     # Twitch Source
  516.                       push rtmp://live-ber.twitch.tv/app/**************************;
  517.  
  518.                     # YouTube Source
  519.                       push rtmp://a.rtmp.youtube.com/live2/**************************;
  520.  
  521.                     # Picarto
  522.                       push rtmp://live.eu-west1.picarto.tv/golive/**************************;
  523.  
  524.                       recorder all
  525.                       {
  526.                            record all;
  527.                            record_path /home/sneakyjoe/RECS;
  528.                            record_suffix %Y.%m.%d___%H-%M___1080.flv;
  529.                       }
  530.                 }
  531.  
  532.             application transcoded-720-art
  533.                 {
  534.                     live on;
  535.  
  536.                     # Restream dontrash low quality (periscope only active)
  537.                     push rtmp://eu-central.restream.io/live/**************************;
  538.  
  539.                         recorder all
  540.                         {
  541.                              record all;
  542.                              record_path /home/sneakyjoe/RECS;
  543.                              record_suffix %Y.%m.%d___%H-%M____560.flv;
  544.                         }
  545.                 }
  546.  
  547.  
  548.  
  549. #####################################################################################################################
  550. #
  551. #    #      #  ########           #######      ####    #      #  ########  ########
  552. #    #      #  #       #          #      #    #    #   ##     #  #         #
  553. #    #      #  #       #          #       #  #      #  # #    #  #         #
  554. #    #      #  #     ##           #       #  ########  #  #   #  #         ########
  555. #     #    #   #####              #       #  #      #  #   #  #  #         #
  556. #      #  #    #    ##            #      #   #      #  #    # #  #         #
  557. #       ##     #      ##          #######    #      #  #     ##  ########  ########
  558. #
  559. #####################################################################################################################
  560.  
  561.  
  562.                                                                                                 # TWITCH + PERISCOPE ONLY
  563.  
  564.  
  565.             application twitchpscp
  566.                 {
  567.                     live on;
  568.                     meta copy;
  569.  
  570.                 # 1080 all sites
  571.                     exec ffmpeg -i rtmp://localhost/twitchpscp/
  572.  
  573.                     -b:v 6000k
  574.                     -minrate 5500k
  575.                     -maxrate 6500k
  576.                     -bufsize 7000k
  577.  
  578.                     -vcodec libx264
  579.                     -preset faster
  580.                     -s 1920x1080
  581.                     -sws_flags bicubic
  582.  
  583.                   #  -vf unsharp=3:3:1.5 # Video sharpening
  584.  
  585.                     -r 60
  586.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=120
  587.  
  588.  
  589.                     -acodec aac
  590.                     -ab 160k
  591.                     -strict -2
  592.  
  593.                     -f flv rtmp://live-ber.twitch.tv/app/**************************;
  594.  
  595.                 # 560 periscope
  596.                     exec ffmpeg -i rtmp://localhost/twitchpscp/
  597.  
  598.                     -b:v 740k
  599.                     -minrate 600k
  600.                     -maxrate 800k
  601.                     -bufsize 800k
  602.  
  603.                     -vcodec libx264
  604.                     -preset fast
  605.                     -s 960x540
  606.                     -sws_flags lanczos
  607.  
  608.                     -r 30
  609.                     -x264-params nal-hrd=cbr:force-cfr=1:keyint=60
  610.  
  611.  
  612.                     -acodec aac
  613.                     -ab 90k
  614.                     -strict -2
  615.  
  616.                     -f flv rtmp://localhost/transcoded-560/;
  617.  
  618.                 }
  619.  
  620. #####################################################################################################################
  621. #
  622. #    #      #   #######   #######     #######    ####     ########  #########
  623. #    #      #  #       #  #      #   #          #    #   #              #
  624. #    #      #  #       #  #       #  #         #      #  #              #
  625. #    #      #  #       #  #       #  #         ########   #######       #
  626. #     #    #   #       #  #       #  #         #      #          #      #
  627. #      #  #    #       #  #      #   #         #      #          #      #
  628. #       ##      #######   #######     #######  #      #  ########       #
  629. #
  630. #####################################################################################################################
  631.  
  632.             application vodcaster
  633.                 {
  634.                     live on;
  635.                     meta copy;
  636.  
  637.                 # 1080 all sites
  638.                     push rtmp://localhost/transcoded-1080/;
  639.               #   push rtmp://localhost/tester/;
  640.  
  641.                 # 560 periscope
  642.                     exec ffmpeg -i rtmp://localhost/vodcaster/ -b:v 740k -minrate 600k -maxrate 800k -bufsize 800k -vcodec libx264 -preset faster -s 960x540 -sws_flags lanczos -r 30  -x264-params nal-hrd=cbr:force-cfr=1:keyint=60 -acodec aac -ab 90k -strict -2 -f flv rtmp://localhost/transcoded-560/;
  643.                 }
  644.  
  645. ########################################
  646.  
  647.  
  648.     }
  649. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement