Difference between revisions of "Nginx: Basic Live Video Streaming Server"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with "Sumber: https://opensource.com/article/19/1/basic-live-video-streaming-server hot keys for shortcuts or features on computer keyboard Image by : Opensource.com x Subscribe...") |
Onnowpurbo (talk | contribs) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Sumber: https://opensource.com/article/19/1/basic-live-video-streaming-server | Sumber: https://opensource.com/article/19/1/basic-live-video-streaming-server | ||
+ | Yang perlu di pikirkan dalam instalasi live streaming video server | ||
− | + | * Stream quality: mau HD atau SD? | |
− | + | * Viewership: jumlah pemirsa? | |
− | + | * Storage: mau di rekam atau tidak? | |
− | + | * Access: apakah private atau open? | |
− | |||
− | + | Spec Minimal Server: | |
+ | * 4GB RAM | ||
+ | * 20G harddisk | ||
+ | * 1 core i7 | ||
− | + | Disini digunakan Real-Time Messaging Protocol (RTMP) untuk menangani audio + video streaming. Alternatif lain adalah WebRTC. | |
− | |||
− | + | ==Setting Server== | |
− | + | Instalasi nginx | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
sudo apt update | sudo apt update | ||
− | sudo apt upgrade | + | sudo apt upgrade (optional) |
+ | sudo apt -y install nginx | ||
− | + | Instalasi RTMP agar nginx dapat menangani media stream: | |
− | |||
− | |||
− | |||
− | |||
sudo add-apt-repository universe | sudo add-apt-repository universe | ||
sudo apt install libnginx-mod-rtmp | sudo apt install libnginx-mod-rtmp | ||
− | + | Tambahkan konfigurasi di nginx untuk menangani RTMP, | |
− | sudo | + | sudo vi /etc/nginx/nginx.conf |
− | + | Tambahkan di paling bawah, | |
rtmp { | rtmp { | ||
Line 80: | Line 46: | ||
} | } | ||
− | + | Di save konfigurasi-nya. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Restart nginx | |
sudo systemctl restart nginx | sudo systemctl restart nginx | ||
+ | /etc/init.d/nginx restart | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==Studio Broadcast dengan OBS== | |
− | + | Kita bisa streaming menggunakan OBS, perlu di set | |
− | + | * Source > Media Sources > nama file.mp4 | |
− | + | * File > Settings > Stream > Custom > Server dengan format di bawah ini (cek dengan ifconfig di server) | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
rtmp://IP-ADDRESS/live. | rtmp://IP-ADDRESS/live. | ||
− | + | * Streaming Key, kita set sebagai password bagi user untuk akses, misalnya | |
− | + | x6kj-8psm-p2wy-38ks | |
− | + | onno-teknik-jaringan | |
− | + | Klik "Start Streaming" di OBS | |
− | + | ==Settingan di sisi Client / Penonton== | |
− | + | Untuk bisa menonton, salah satu yang sederhana bisa menggunakan VLC | |
− | + | sudo apt -y install vlc | |
− | |||
− | + | Untuk akses, klik | |
− | + | * Media > Open Network Stream | |
− | + | Alamat video streaming adalah | |
− | |||
− | |||
− | |||
− | |||
rtmp://IP-ADDRESS/live/SECRET-KEY. | rtmp://IP-ADDRESS/live/SECRET-KEY. | ||
− | + | ==Selanjutnya?== | |
− | + | Yang bisa dikerjakan selanjutnya, | |
− | |||
− | + | * Limit access: bisa membatasi akses server kita, misalnya menggunakan firewall, .htaccess di web, atau access control di rtmp modul. | |
− | + | * Record streams: merekam video dengan cara mengubah sedikit konfigurasi, | |
− | |||
− | |||
− | |||
− | |||
application live { | application live { | ||
Line 252: | Line 101: | ||
record_unique on; | record_unique on; | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Referensi== | ==Referensi== |
Latest revision as of 10:35, 11 May 2020
Sumber: https://opensource.com/article/19/1/basic-live-video-streaming-server
Yang perlu di pikirkan dalam instalasi live streaming video server
- Stream quality: mau HD atau SD?
- Viewership: jumlah pemirsa?
- Storage: mau di rekam atau tidak?
- Access: apakah private atau open?
Spec Minimal Server:
- 4GB RAM
- 20G harddisk
- 1 core i7
Disini digunakan Real-Time Messaging Protocol (RTMP) untuk menangani audio + video streaming. Alternatif lain adalah WebRTC.
Setting Server
Instalasi nginx
sudo apt update sudo apt upgrade (optional) sudo apt -y install nginx
Instalasi RTMP agar nginx dapat menangani media stream:
sudo add-apt-repository universe sudo apt install libnginx-mod-rtmp
Tambahkan konfigurasi di nginx untuk menangani RTMP,
sudo vi /etc/nginx/nginx.conf
Tambahkan di paling bawah,
rtmp { server { listen 1935; chunk_size 4096; application live { live on; record off; } } }
Di save konfigurasi-nya.
Restart nginx
sudo systemctl restart nginx /etc/init.d/nginx restart
Studio Broadcast dengan OBS
Kita bisa streaming menggunakan OBS, perlu di set
- Source > Media Sources > nama file.mp4
- File > Settings > Stream > Custom > Server dengan format di bawah ini (cek dengan ifconfig di server)
rtmp://IP-ADDRESS/live.
- Streaming Key, kita set sebagai password bagi user untuk akses, misalnya
x6kj-8psm-p2wy-38ks onno-teknik-jaringan
Klik "Start Streaming" di OBS
Settingan di sisi Client / Penonton
Untuk bisa menonton, salah satu yang sederhana bisa menggunakan VLC
sudo apt -y install vlc
Untuk akses, klik
- Media > Open Network Stream
Alamat video streaming adalah
rtmp://IP-ADDRESS/live/SECRET-KEY.
Selanjutnya?
Yang bisa dikerjakan selanjutnya,
- Limit access: bisa membatasi akses server kita, misalnya menggunakan firewall, .htaccess di web, atau access control di rtmp modul.
- Record streams: merekam video dengan cara mengubah sedikit konfigurasi,
application live { live on; record all; record_path /var/www/html/recordings; record_unique on; }