默认情况下Ububtu 16.04 的nginx 的版本是1.10版的我们先升级下nginx
1.安装相关软件
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
sudo apt-get install libnginx-mod-rtmp
2.配制Nginx
rtmp {
server {
listen 1945;
chunk_size 4096;
application app {
live on;
}
application live{
live on;
hls on;
hls_path /home/im/files/live;
hls_fragment 3s;
hls_playlist_length 15s;
#推流到相关服务器
#push 60.xx.xx.xx:1935;
}
}
server {
listen 1946;
chunk_size 4096;
application live{
live on;
#从相关服务器拉流
pull rtmp://60.xx.xx.xx:1946/live;
}
}
}
nginx -s reload
OK 打完收功
网友评论