Windows下nginx-http-flv-module服务部署

音视频应用开发系列文章目录

1.新建文件夹nginx-rtmp

2.将《Windows下nginx-http-flv-module编译》生成的nginx.exe拷贝到nginx-rtmp目录下

3.将nginx源码目录下的conf文件夹拷贝到nginx-rtmp目录下

4.将nginx源码目录下的docs/html文件夹拷贝到nginx-rtmp目录下

5.在nginx-rtmp目录下新建logs和temp文件夹

6.将nginx-http-flv-module目录下的stat.xsl拷贝到nginx-rtmp/html目录下

7.配置conf/nginx.conf文件

worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
#error_log  logs/error.log  debug;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

# 添加RTMP服务
rtmp {
    server {
        listen 1935; # 监听端口

        chunk_size 4000;
        application live {
            live on;
			gop_cache on;
        }
    }
}

# HTTP服务
http {
    include       mime.types;
    default_type  application/octet-stream;

    #access_log  logs/access.log  main;

    server {
        listen       8080; # 监听端口
 
		location /stat.xsl {
            root html;
        }
		location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
		location / {
            root html;
        }
    }
}

8.整个服务部署文件构架如下

nginx-rtmp
│  nginx.exe
│  
├─conf
│      fastcgi.conf
│      fastcgi_params
│      koi-utf
│      koi-win
│      mime.types
│      nginx.conf
│      scgi_params
│      uwsgi_params
│      win-utf
│      
├─html
│      50x.html
│      index.html
│      stat.xsl
│      
├─logs
│      access.log
│      error.log
│      
└─temp
    ├─client_body_temp
    ├─fastcgi_temp
    ├─proxy_temp
    ├─scgi_temp
    └─uwsgi_temp

9.启动nginx

a.进入nginx-rtmp目录下双击nginx.exe

b.WIN+R->cmd命令行进入nginx-rtmp目录下执行 start /b nginx.exe -c conf\nginx.conf

10.使用ffmpeg推流,VLC拉流

11.网页打开http://your_ip:8080/stat可以看到nginx媒体流的状态

12.关闭nginx

WIN+R->cmd命令行进入nginx-rtmp目录下执行 nginx.exe –s stop

13.下载本文部署好的戳这里

评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值