rtsp通过ffmpeg+nginx发布成rtmp和http-flv部署文档

1、部署nginx

1.1准备环境

1.1.1服务器资源

服务名称:测试环境服务器

IP:[请查看资源分配文档]

操作系统:CentOS 6.8 x64

1.2 安装nginx

1.2.1 nginx下载

nginx下载

下载地址:nginx.org/en/download…

nginx-http-flv-module下载

下载地址:github.com/winshining/…

1.2.2 nginx安装

把nginx-1.16.1.tar.gz和nginx-http-flv-module-1.2.7.tar.gz,上传到/opt/tools目录下

创建nginx目录

# mkdir /usr/local/nginx

解压nginx和nginx-flv

# cd /opt/tools
​
# tar -zxvf nginx-1.16.1.tar.gz
​
# tar -zxvf nginx-http-flv-module-1.2.7.tar.gz -C /usr/local/nginx/

目录改名

# cd /usr/local/nginx
​
# mv nginx-http-flv-module-1.2.7 nginx-http-flv-module

安装nginx所需依赖项

yum -y install gcc-c++
​
yum -y install pcre pcre-devel  
​
yum -y install zlib zlib-devel
​
yum -y install openssl openssl-devel

安装nginx

# cd /opt/tools/nginx-1.16.1
​
# ./configure --prefix=/usr/local/nginx  --add-module=/usr/local/nginx/nginx-http-flv-module
​
# make && make install

修改配置文件

# cd /usr/local/nginx
​
# vi conf/nginx.conf

修改为以下内容:

worker_processes  1;
events {
    worker_connections  1024;
}
#rtmp配置
rtmp {
    out_queue   4096;
    out_cork       8;
    max_streams  128;
    server {
        listen 1935;
        application live {
            live on;
            record off;
            gop_cache on;
        }
    }
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server {
        listen       80;  #nginx的端口,默认是80
        server_name  localhost;
        location / {
            root   html;
         
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值