Nginx: Instalasi RTMP HLS DASH
Revision as of 06:22, 18 May 2021 by Onnowpurbo (talk | contribs) (Created page with " ==Instalasi Build Tools & Dependencies==   sudo apt update  sudo apt install build-essential git libpcre3-dev libssl-dev zlib1g-dev  ==Compile NGINX + RTMP==   sudo su  cd /u...")
Instalasi Build Tools & Dependencies
sudo apt update sudo apt install build-essential git libpcre3-dev libssl-dev zlib1g-dev
Compile NGINX + RTMP
sudo su cd /usr/local/src/ git clone https://github.com/arut/nginx-rtmp-module.git git clone https://github.com/nginx/nginx.git cd nginx ./auto/configure --add-module=../nginx-rtmp-module make sudo make install
Konfigurasi
HLS
rtmp { 
    server { 
        listen 1935; 
        application live { 
            live on; 
            interleave on;
 
            hls on; 
            hls_path /tmp/hls; 
            hls_fragment 15s; 
        } 
    } 
} 
 
http { 
    default_type application/octet-stream;
 
    server { 
        listen 80; 
        location /tv { 
            root /tmp/hls; 
        } 
    }
    types {
        application/vnd.apple.mpegurl m3u8;
        video/mp2t ts;
        text/html html;
    } 
}
DASH
rtmp { 
    server { 
        listen 1935; 
        application live { 
            live on; 
            dash on; 
            dash_path /tmp/dash; 
            dash_fragment 15s; 
        } 
    } 
} 
http { 
    server { 
        listen 80; 
        location /tv { 
            root /tmp/dash; 
        } 
    }
 
    types {
        text/html html;
        application/dash+xml mpd;
    } 
}
Validasi Konfigurasi & Start NGINX
Validasi
sudo nginx -t
Start NGINX
sudo nginx