補充了架構圖,在前一篇文章中。 說明在建立 S3 Bucket 之後,透過 aws cli 去發行臨時的網址和憑證。 不過還有幾件事情我還需要花些時間研究和設定,先記錄起來:
// TODO LIST
1. 製作 iOS shortcut 開啟相簿,選影片,叫瀏覽器出來 PUT 到指定網址
2. 用較為輕鬆的方式取號 Pre-Signed URL,因為不是每次都可以快速拿出終端介面呼叫指令
在這篇將透過簡單的方式,驗證幾件事情:
新手暫時不用管網路,因為有預設 VPC,上面已經配好對外的 Internet Gateway,簡稱 IGW。 也有預設路由了對外了。 等一下有用到網路的知識再補充!
t3.micro
/ 有錢的話可以開大一點,不然先這樣吧
ssh -i </所在的/路徑/私鑰名稱.pem> ubuntu@主機IP
sudo apt update
sudo apt install -y build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev
cd ~
sudo git clone https://github.com/arut/nginx-rtmp-module.git
wget http://nginx.org/download/nginx-1.29.1.tar.gz
tar -zxvf nginx-1.29.1.tar.gz
cd nginx-1.29.1
./configure --with-http_ssl_module --add-module=../nginx-rtmp-module
make
sudo make install
which nginx
/usr/sbin
目錄下.../usr/sbin/nginx
sudo apt update
sudo apt install -y libnginx-mod-rtmp
nginx.conf
nginx.conf
sudo vim /etc/nginx/nginx.conf
rtmp {
server {
listen 1935;
chunk_size 4096;
application live {
live on;
record off;
}
# 開啟 HLS 輸出
hls on;
hls_path /tmp/hls;
hls_fragment 3s;
hls_playlist_length 30s;
}
}
❯ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo systemctl restart nginx
rtmp://<伺服器IP或是域名>/live/streamkey
推播串流喔listen 1935
會在伺服器上,開 1935
port 作為入口PRISM LIVE
<-- 免費這個蠻方便的,先這樣做!!
/tmp/hls
裡面有資料!!