hw-1

ubuntu install nginx and srs

ubuntu install nginx and srs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//for Ubuntu
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -y
sudo apt-get install -y gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5


git clone https://github.com/ossrs/srs.git
cd srs/trunk
./configure --with-nginx
make

./objs/srs -c conf/http.hls.conf

for((;;)); do \
ffmpeg -re -i /home/ubuntu/Rogue\ One\ -\ A\ Star\ Wars\ Story\ -\ Trailer\ 2.mp4 \
-vf scale=360:-2 -c:v libx264 -acodec copy \
-f flv -y rtmp://172.104.12.1:1935/live/livestream; \
sleep 1; \
done