Skip to content

Instantly share code, notes, and snippets.

@MatrixMuto
Last active July 4, 2017 14:37
Show Gist options
  • Save MatrixMuto/3c112fd3ef337d19d539fba451e9a457 to your computer and use it in GitHub Desktop.
Save MatrixMuto/3c112fd3ef337d19d539fba451e9a457 to your computer and use it in GitHub Desktop.
setup nginx rtmp
rtmp {
server {
listen 1935;
chunk_size 4000;
# TV mode: one publisher, many subscribers
application mytv {
# enable live streaming
live on;
# publish only from localhost
allow publish 115.195.179.6;
deny publish all;
}
}
}
# HTTP can be used for accessing RTMP stats
http {
server {
listen 80;
# This URL provides RTMP statistics in XML
location /stat {
rtmp_stat all;
# Use this stylesheet to view XML as web page
# in browser
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
# XML stylesheet to view RTMP stats.
# Copy stat.xsl wherever you want
# and put the full directory path here
root /path/to/stat.xsl/;
}
}
}
#!/bin/bash
yum -y install git-core gcc pcre-devel openssl-devel
git clone https://github.com/arut/nginx-rtmp-module.git
wget http://nginx.org/download/nginx-1.12.0.tar.gz
tar xvf nginx-1.12.0.tar.gz
cd nginx-1.12.0
./configure --add-module=../nginx-rtmp-module
make && make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment