2020-03-02 Ubuntu 16.04 安装Nginx Rmtp

默认情况下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 打完收功

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容