首页 > 其他分享 >搭建RTMP server

搭建RTMP server

时间:2023-01-12 14:33:45浏览次数:39  
标签:RTMP tar gz module server nginx live rtmp 搭建

install nginx

wget https://nginx.org/download/nginx-1.20.1.tar.gz
tar -zxvf nginx-1.20.1.tar.gz

wget https://github.com/arut/nginx-rtmp-module/archive/refs/tags/v1.2.2.tar.gz
tar -zxvf v1.2.2.tar.gz
apt update && apt install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
cd nginx-1.20.1
./configure --prefix=/usr/local/nginx --add-module=./nginx-rtmp-module-1.2.2 --with-http_ssl_module

配置

vim conf/nginx.conf


rtmp {      
    server {    
        listen 1935; # 端口
        chunk_size 4000;     
        application live { # 请求路径
            live on;     
        }   
    }   
}

vi ~/.bashrc

export PATH=$PATH:/usr/local/nginx/sbin

source ~/.bashrc

lauch

nginx

test

  • push stream
ffmpeg -i xx.mp4 -f flv rtmp://ip地址:1935/live/xx
  • pull stream
ffplay rtmp://ip地址:1935/live/xx

标签:RTMP,tar,gz,module,server,nginx,live,rtmp,搭建
From: https://www.cnblogs.com/luoyinjie/p/17046591.html

相关文章