nginx 配置rtmp實現視頻點播

yum install -y   gcc-c++ pcre pcre-devel zlib  zlib-devel  openssl openssl-devel git make
git clone https://github.com/arut/nginx-rtmp-module.git
wget http://nginx.org/download/nginx-1.16.0.tar.gz
tar -zxvf nginx-1.16.0.tar.gz
cd nginx-1.16.0
./configure --add-module=/root/nginx-rtmp-module
make &&make install
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=1935/tcp --permanent
firewall-cmd --reload   
/usr/local/nginx/sbin/nginx -s reload
rtmp://8.6.8.184/hls/test.mp4
rtmp {

    server {

        listen 1935;  #監聽的端口

        chunk_size 4000;
application vod {
                play /usr/local/nginx/html/hls;
            }

        application hls {  #rtmp推流請求路徑
            live on;
            hls on;
            hls_path /usr/local/nginx/html/hls;
            hls_fragment 5s;
        }
    }
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章