Bila anda menginginkan Live Streaming RTMP yang diditribusikan menggunakan server Nginx dengan menggunakan module RTMP-NGINX untuk dapat diakses melalui Smartphone Android dan I-Phone , dengan streaming HLS ( HTTP Live Streaming ) dengan satu sumber encoder dalam bentuk streaming RTMP, anda tinggal merubah konfigurasi pada Nginx (nginx.conf) yaitu :
worker_processes 1;
events {
worker_connections 1024;
}
#Konfigurasi Untuk Live Streaming HLS dan Ondemand File pergunakan video format mp4
http {
server {
listen 8080;
location /hls {
# HLS Live Streaming sumber dari RTMP
events {
worker_connections 1024;
}
#Konfigurasi Untuk Live Streaming HLS dan Ondemand File pergunakan video format mp4
http {
server {
listen 8080;
location /hls {
# HLS Live Streaming sumber dari RTMP
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /var/live;
add_header Cache-Control no-cache;
}
location /ond {
# HLS untuk ondemand Streaming
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /var/live;
add_header Cache-Control no-cache;
}
location /ond {
# HLS untuk ondemand Streaming
types {
application/vnd.apple.mpegurl m3u8;
video/mp4 ts;
}
alias /var/video;
add_header Cache-Control no-cache;
}
}
}
#Streaming Live RTMP
rtmp {
server {
listen 1935;
chunk_size 4000;
#Untuk Live Streaming RTMP
application/vnd.apple.mpegurl m3u8;
video/mp4 ts;
}
alias /var/video;
add_header Cache-Control no-cache;
}
}
}
#Streaming Live RTMP
rtmp {
server {
listen 1935;
chunk_size 4000;
#Untuk Live Streaming RTMP
application hls {
live on;
hls on;
hls_path /var/live/hls;
}
#Untuk Ondemand Live Streaming RTMP
application ond {
play /var/www;
}
}
}
live on;
hls on;
hls_path /var/live/hls;
}
#Untuk Ondemand Live Streaming RTMP
application ond {
play /var/www;
}
}
}
Untuk encoder ffmpeg live streaming url adalah rtmp://xxx.xxx.xxx/hls/namesetreaming
dan untuk alamat url pada flahplayer adalah rtp://xxx.xxx.xxx/hls/namestreaming
dan untuk alamat url buat akses di Smartphone atau iphone adalah http://xxx.xxx.xxx:8080/hls/namestreaming.m3u8