rtmp直播
mac 环境.
安装
./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等是否正常