WebRTC学习笔记七 pion/webrtc

2021-04-12  本文已影响0人  合肥黑

https://github.com/pion/webrtc

先来理解一下官方的readme

一、Usage用法
1.使用Go Modules

Go Modules are mandatory for using Pion WebRTC. So make sure you set export GO111MODULE=on, and explicitly specify /v2 or /v3 when importing.

2.常见示例

example applications contains code samples of common things people build with Pion WebRTC.

3.更多示例

example-webrtc-applications contains more full featured examples that use 3rd party libraries.

4.真实案例

awesome-pion contains projects that have used Pion, and serve as real world examples of usage.

5.GoDoc

GoDoc is an auto generated API reference. All our Public APIs are commented.

6.FAQ

FAQ has answers to common questions. If you have a question not covered please ask in Slack we are always looking to expand it.

7.我还没搞清这些特性有没有实现……

Now go build something awesome! Here are some ideas to get your creative juices flowing:

Send a video file to multiple browser in real time for perfectly synchronized movie watching.
Send a webcam on an embedded device to your browser with no additional server required!
Securely send data between two servers, without using pub/sub.
Record your webcam and do special effects server side.
Build a conferencing application that processes audio/video and make decisions off of it.
Remotely control a robots and stream its cameras in realtime.

二、Features特性
1.PeerConnection API
2.Connectivity
3.DataChannels
4.Media
5.Security
三、Samples

参考
【go/webrtc】使用insertable-streams给每一帧添加额外数据
How to generate "Golang base64 Session Description"

1.使用go run examples.go启动webserver,然后打开127.0.0.1:8080
image.png
2.部分示例需要复制浏览器的SDP,手动生成Go服务器的SDP再复制回来
image.png
3.Linux/macOS参照readme

Run echo $BROWSER_SDP | insertable-streams

image.png
个人推测,有可能是Go的环境变量没配置好,有点麻烦……
4.Windows参照readme
使用Cmd是可以的

将生成的SDP复制到Golang base64 Session Description即可连接

四、ION

ION的来由和发展https://zhuanlan.zhihu.com/p/206492402
ION-SFU整体流程https://zhuanlan.zhihu.com/p/258559751

五、源码阅读

https://github.com/63isOK/pion-log

image.png
说明:

分析:

源码阅读顺序:

上一篇 下一篇

猜你喜欢

热点阅读