smart_webrtc 使用說明匯總(定期更新)
smart_webrtc 單機版本

smart_webrtc 集群版本

smart_webrtc 對于機器的 CPU, 記憶體,網路要求比較高,發布版本對路數有所限制,如果想大規模應用,請私下聯系我,
我的聯系方式
email : cwf12345@sina.com,qq : 99766553, webchat : 99766553
smart_webrtc 百度網盤下載
鏈接: https://pan.baidu.com/s/18YQF1TvB9IULDoe9vaXYTw 提取碼: twbw
smart_webrtc 使用流程簡述
必須用 https 進行訪問,程式內自帶證書,方便演示,首先開啟 https 服務,參見組態檔
由于要用到 UDP ,因此要求服務器防火墻不能關閉對應的 UDP 埠
組態檔 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 ,點播放按鈕,
為什么我的頁面播放不了?
smart_webrtc 里面帶的是一個演示的證書和私鑰,對于 chrome 不是合法的,因此導致 chrome 訪問 smart_webrtc 或 smart_rtmpd 時,經常出現
ssl: 06C82F38, err: 336151574, error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown
這種錯誤會導致,smart_webrtc 的播放頁面下載不全,播放頁面包括 index.html, js/main.js, js/common.js, js/adapter.js 這幾個檔案,可能這幾個檔案下載不全,解決方法時多重繪頁面幾次,F5 解決大法,然后點播放,就應該可以了,建議用正規的證書,避免整個問題,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/54308.html
標籤:AI
