nginx_rtmp_module初体验
来源:互联网 发布:网络存储工程师 编辑:程序博客网 时间:2024/04/30 13:20
编译安装
- git clone https://github.com/arut/nginx-rtmp-module.git
- 设nginx_rtmp_module文件目录为path,在nginx编译步骤中的configure中添加参数 –add-module=path;
- 编译nginx
配置
打开nginx文件,添加如下配置信息:
rtmp{ server{ listen 1935; chunk_size 4096; application test{ live on; } } }
测试
1. 启动nginx
2. 利用ffmpeg推流,命令如下:
ffmpeg -re -i test.mp4 -c copy -f flv rtmp://192.168.103.171/test/sxc
3. 利用ffpaly观看视频。
ffplay rtmp://192.168.103.171/test/sxc
备注
在利用ffmpeg推流时提示如下错误:
[tcp @ 0x7f98dc7003c0] Connection to tcp://192.168.103.171:1935 failed: Connection refused[rtmp @ 0x7f98dc50dae0] Cannot open connection tcp://192.168.103.171:1935rtmp://192.168.103.171/test/sxc: Connection refused
直接利用telnet命令也无法连接1935端口,与当初首次安装nginx时无法连接80端口类似,猜想是由于centos的防火墙引起的。
解决办法:
1. vim /etc/sysconfig/iptables
2. 在-A INPUT -j REJECT –reject-with icmp-host-prohibited的上面添加*-A INPUT -p tcp -m tcp –dport 1935 -j ACCEPT
3. service iptables restart
4. 再次利用telnet连接80端口,成功。
0 0
- nginx_rtmp_module初体验
- nginx_rtmp_module模块解释
- 初体验
- 初体验
- 初体验
- 初体验
- 初体验
- 初体验
- 初体验
- [体验]windows 8.1 update 1初体验
- JBUILDER X 初体验
- C#Builder初体验
- JBUILDERX 初体验
- ASP.net初体验
- DBA初体验
- Web标准初体验
- Longhorn初体验
- Statspack之初体验
- linux下 定时执行php脚本
- 自定义标签普通的不继承TagSupport的实例
- AP微积分内容是什么?
- Windows 10 IoT Serials 5
- SQL—保存更改和自增序列问题
- nginx_rtmp_module初体验
- 理解装饰者模式
- 编程相关命令
- html属性(1)
- SPI,MCP2515调试总结
- PHP中的curl网络请求
- java的四种引用
- ipcs命令
- 什么是全连接神经网络