nginx 搭建rtmp直播服务器

rtmp直播

mac 环境.

安装

nginx 官网地址
rtmp 模块地址

./configure --add-module=../nginx-rtmp-module/ --with-http_ssl_module  
make && make install

部署

直播

rtmp {
server {
    listen 1935;
    chunk_size 4096;
    application live {
        live on;
        record off;
    }
}

直播地址为 : rtmp://192.168.31.185/live/

点播

application vod {
    play /var/flvs;
}

点播地址 : rtmp://192.168.31.185/vod/ 后面加上配置目录下对应文件名

http://www.tuicool.com/articles/iauQNr 点播处的地址写法不对,是rtmp开头

问题

openssl 安装升级

brew 安装
  • brew install openssl
  • ln -s /usr/local/Cellar/openssl/1.0.2j/bin/openssl /usr/bin/openssl
  • 这样系统自带的openssl 还是在/usr/bin 下, 但不会影响我们新装的openssl
  • openssl version 确认版本
源码安装

https://www.openssl.org/
openssl 建议选用1.0.2 稳定版 http://stackoverflow.com/questions/35965735/how-to-make-librtmp-compile-on-mac-os-x
./config 执行时会有提示 选择编译的版本,x86_64需要执行后面的命令
./Configure darwin64-x86_64-cc
查看编译位数 lipo -info *.a


没有安装openssl库的 [需要下载openssl](https://www.openssl.org/)并指定路径 –with-openssl=../openssl-OpenSSL_1_0_2j/

手动修改 objs/Makefile:
./config –prefix=/Users/xxx/Downloads/openssl-1.0.1e/.openssl no-shared no-threads
改成
./Configure darwin64-x86_64-cc –prefix=/Users/xxx/Downloads/openssl-1.0.1e/.openssl no-shared no-threads

直播排查

通过ffmpeg推流、ffplay拉流验证服务是否正常
通过自己程序推流时,抓包查看rtmp交互流程,并注意是否有关键帧
调用ffmpeg库推流时,注意编码后avpkt的 flag、pts、dts、duration等是否正常

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值