nginx rtmp centos配置

nginx rtmp centos配置

nginx-rtmp-module

git clone https://github.com/arut/nginx-rtmp-module.git

下载安装nginx

wget http://nginx.org/download/nginx-1.8.1.tar.gz 
tar -zxvf nginx-1.8.1.tar.gz 
cd nginx-1.8.1 
./configure --prefix=/usr/local/nginx  --add-module=../nginx-rtmp-module  --with-http_ssl_module   
make && make install

设置nginx

vi /usr/local/nginx/conf/nginx.conf

内容:

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       809;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}    
rtmp {
        out_queue 4096;
        out_cork 8;
        max_streams 4096;
        server {
            listen 90;

            drop_idle_publisher 30s;

            application live {
                live on;
            }
        }
    }

启动:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

参考:
https://www.cnblogs.com/boonya/p/7910967.html

卸载

# 如果有自启动,则删除 Nginx 的自启动
chkconfig nginx off
服务 nginx 信息读取出错:没有那个文件或目录
# 查找nginx的安装目录
whereis nginx
nginx: /usr/local/nginx
# 停止nginx服务
/usr/local/nginx/sbin/nginx -s stop
# 删除安装目录
rm -rf /usr/local/nginx/
# 查找是否还有残余的
find / -name nginx
/usr/local/lib64/nginx-1.15.7/objs/nginx
rm -rf /usr/local/lib64/nginx-1.15.7/

推流测试:

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i "视频资源源地址"  -c:v h264_nvenc -an  -crf 20 -b:a 96k -b:v 2048k -preset medium -tune animation -vf scale_npp=1024:-1 -f flv rtmp://ip:90/live/test

拉流测试

使用:
rtmp://ip:90/live/test
地址播放即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程圈子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值