ffmpeg实战教程(九)windows下ffmpeg命令+nginx + rtmp实现推流,拉流。

本文介绍了在Windows环境下如何搭建nginx+rtmp服务,包括nginx的启动和停止命令,以及使用ffmpeg进行推流和拉流的操作。通过rtmp模块,ffmpeg可以将视频流推送到nginx服务器,然后通过VLC等播放器或网页端进行拉流播放。此外,还列举了一些常用的ffmpeg命令。
摘要由CSDN通过智能技术生成

概述

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

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

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

有两种方案:
(一)
1.下载nginx :http://nginx.org/
2.下载nginx-rmtp-module:https://github.com/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.开启服务器&

评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值