admin管理员组

文章数量:1530281

概述

Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器。
nginx-rmtp-module是Nginx服务器的流媒体插件。

nginx通过rtmp模块提供rtmp服务, ffmpeg推送一个rtmp流到nginx, 然后客户端通过访问nginx来收看实时视频流。

先介绍一下windows下搭建nginx + rtmp

有两种方案:
(一)
1.下载nginx :http://nginx/
2.下载nginx-rmtp-module:https://github/arut/nginx-rtmp-module
3.配置nginx.conf

#nginx.conf

rtmp {

    server {

        listen 1935;

        chunk_size 4000;

        # TV mode: one publisher, many subscribers
        application wstv{

            # enable live streaming
            live on;

            # record first 1K of stream
            record all;
            record_path /tmp/av;
            record_max_size 1K;

            # append current timestamp to each flv
            record_unique on;

            # publish only from localhost
            allow publish 127.0.0.1;
            deny publish all;

            #allow play all;
        }

4.编译

./configure --add-module=/path/to/nginx-rtmp-module
make
make install

注意nginx版本在nginx (1.3.14 - 1.5.0)的configure 命令如下:
./configure –add-module=/path/to/nginx-rtmp-module –with-http_ssl_module

5.开启服务器&

本文标签: 实战命令教程ffmpegrtmp