smart_webrtc 使用说明汇总(按期更新)
smart_webrtc 单机版本web
smart_webrtc 集群版本chrome
smart_webrtc 对于机器的 CPU, 内存,网络要求比较高,发布版本对路数有所限制,若是想大规模应用,请私下联系我,ubuntu
个人联系方式
email : cwf12345@sina.com,qq : 99766553, webchat : 99766553 centos
smart_webrtc 百度网盘下载
连接: https://pan.baidu.com/s/18YQF1TvB9IULDoe9vaXYTw 提取码: twbw浏览器
smart_webrtc 使用流程简述
必须用 https 进行访问,程序内自带证书,方便演示,首先开启 https 服务,参见配置文件 安全
因为要用到 UDP ,所以要求服务器防火墙不能关闭对应的 UDP 端口bash
配置文件 config.xml 里的须要关注的地方是 :服务器
<config> ... ... <ssl> <serverkey>server.key</serverkey> <servercert>server.pem</servercert> </ssl> <http> <!-- https 端口 --> <sport>8181</sport> <!-- 开启 ssl --> <ssl>true</ssl> </http> ... ... </config>
网页及脚本 我的根据须要,编辑 js/main.js 文件,主要关注以下:网络
var addr = "https://" + ip + ":8181" + "/live/stream.wms?type=getoffer"; var addr = "https://" + ip + ":8181" + "/live/stream.wms?type=setcandidate&token=" + token;
webrtc url 格式相似以下:
https://192.168.1.1:8181/live/stream.wms多线程
smart_webrtc 支持那些平台
webrtc 服务器也支持三个版本 win, ubuntu ( 多线程和协程 ), centos ( 多线程和协程 )
使用说明
1. 配置好 smart_webrtc ,主要是 ssl 配置,以及 https 开启的选项。
2. 启动 smart_webrtc , 假设您的 https 端口是 8181, 地址是 192.168.1.1
3. 开启一个 rtmpd 客户端进行推流 ( h264 + aac )
4. 在 chrome 里,输入 https://192.168.1.1:8181,若是没有意外,就会进入 smart_webrtc 的播放器页面
5. 在地址栏输入 192.168.1.1 就能够进行播放了。您能够根据须要更改播放器页面。
播放器截图:
最简单的搭建方法
1. 百度网盘下载 smart_webrtc.zip 软件包
2. 解压, 而后继续解压 smart_webrtc_win.zip
3. 运行 smart_webrtc.exe , 假设您的 IP 是 192.168.1.1
6. 推流 rtmp 到smart_webrtc
ffmpeg.exe -re -i oceans.mp4 -vcodec libx264 -acodec aac -f flv rtmp://192.168.1.1/live/stream
5. 打开 chrome 浏览器输入 https://192.168.1.1,通常提示安全连接什么的,点继续。
7. 在播放器的地址框内输入 192.168.1.1 ,点播放按钮。