Nginx: Instalasi dengan RTMP

From OnnoWiki
Jump to navigation Jump to search

Instalasi aplikasi pendukung

sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev unzip

Download source code

cd /usr/local/src
wget http://nginx.org/download/nginx-1.7.7.tar.gz
wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

Buka source code

cd /usr/local/src
tar -zxvf nginx-1.7.7.tar.gz
unzip master.zip

Compile

cd /usr/local/src/nginx-1.7.7
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master
make
sudo make install

Beberapa catatan penting

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"

Konfigurasi untuk Streaming

Edit

vi /usr/local/nginx/conf/nginx.conf

Tambahkan di bawah

rtmp {
        server {
                listen 1935;
                chunk_size 4096;  

                application live {
                        live on;
                        record off;
                }
        }
}


Restart nginx

sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx


Streaming dari Android

  • Siapkan Android
  • Install apps OS Broadcaster

Set

  Server: rtmp://ip-address-server/live
  Play Path/Stream Key: test

Stream dapat di lihat misalnya menggunakan VLC dengan alamat

rtmp://ip-address-server/live/test