Difference between revisions of "Nginx: Instalasi RTMP HLS DASH"
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
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...")  | 
				Onnowpurbo (talk | contribs)   | 
				||
| Line 91: | Line 91: | ||
  sudo nginx  |   sudo nginx  | ||
| + | |||
| + | |||
| + | ==Test dari Studio==  | ||
| + | |||
| + | OBS di set stream ke (contoh)  | ||
| + | |||
| + |  rtmp://NGINX_server/tv/tv2  | ||
| + | |||
| + | ffmpeg, script  | ||
| + | |||
| + |  ffmpeg -re -I fileyangdistream.mp4 -vcodec copy -loop -1 -c:a aac -b:a 160k -ar 44100 -strict -2 -f flv rtmp:192.168.1.138/live/bbb  | ||
| + | |||
| + | Contoh URL  | ||
| + | |||
| + |  RTMP – rtmp://NGINX_server/live/bbb  | ||
| + |  HLS – http://NGINX_server/live/bbb.m3u8  | ||
| + |  DASH – http://NGINX_server/live/bbb.mpd  | ||
Revision as of 06:26, 18 May 2021
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
Test dari Studio
OBS di set stream ke (contoh)
rtmp://NGINX_server/tv/tv2
ffmpeg, script
ffmpeg -re -I fileyangdistream.mp4 -vcodec copy -loop -1 -c:a aac -b:a 160k -ar 44100 -strict -2 -f flv rtmp:192.168.1.138/live/bbb
Contoh URL
RTMP – rtmp://NGINX_server/live/bbb HLS – http://NGINX_server/live/bbb.m3u8 DASH – http://NGINX_server/live/bbb.mpd