一、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

  • Go implementation of webrtc-pc and webrtc-stats

  • DataChannels

  • Send/Receive audio and video

  • Renegotiation 重连??

  • Plan-B and Unified Plan

  • SettingEngine for Pion specific extensions

2.Connectivity

  • Full ICE Agent

  • ICE Restart

  • Trickle ICE ??

  • STUN

  • TURN (UDP, TCP, DTLS and TLS)

  • mDNS candidates

3.DataChannels

  • Ordered/Unordered 有序/无序

  • Lossy/Lossless 有损/无损

4.Media

  • API with direct RTP/RTCP access

  • Opus, PCM, H264, VP8 and VP9 packetizer

  • API also allows developer to pass their own packetizer

  • IVF, Ogg, H264 and Matroska provided for easy sending and saving

  • getUserMedia implementation (Requires Cgo)

  • Easy integration with x264, libvpx, GStreamer and ffmpeg.

  • Simulcast SFU的概念

  • SVC SFU的概念

  • NACK 断线重连??

  • Full loss recovery and congestion control is not complete, see pion/interceptor for progress

  • See ion for how an implementor can do it today

5.Security

  • TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 and TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA for DTLS v1.2

  • SRTP_AEAD_AES_256_GCM and SRTP_AES128_CM_HMAC_SHA1_80 for SRTP

  • Hardware acceleration available for GCM suites

【学习地址】:

FFmpeg/WebRTC/RTMP/NDK/Android音视频流媒体高级开发
【文章福利】:

免费领取更多音视频学习资料包、大厂面试题、技术视频和学习路线图,资料包括(C/C++,Linux,FFmpeg webRTC rtmp hls rtsp ffplay srs 等等)有需要的可以点击1079654574加群领取哦~

三、Samples

1.使用go run examples.go启动webserver,然后打开127.0.0.1:8080

2.部分示例需要复制浏览器的SDP,手动生成Go服务器的SDP再复制回来

3.Linux/macOS参照readme

Run echo $BROWSER_SDP | insertable-streams

个人推测,有可能是Go的环境变量没配置好,有点麻烦……

4.Windows参照readme

  • Paste the SessionDescription into a file.

  • Run

    insertable-streams < my_file

    使用power shell不行

使用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

说明:

  • 粉底是第三方库,天蓝底是pion的库

  • 红色框中的randutil/testify/logging,是基础库,很多库都依赖这3个库

分析:

  • 核心都是以x/net库为中心,一步步扩展

  • 直接依赖x/net的有4个库,transport/mdns/ice/dtls

    • 其中mdns/ice/dtls都依赖transport

    • ice依赖dtls/mdns

    • 总的来说.ice依赖mdns/dtls,她们都依赖transport

    • 依赖x/net的库,要么使用了网络连接,要么使用了网络工具库的功能

  • transport作为传输对象的封装,有以下库使用

    • quic, quic协议的实现

    • dtls, udp 安全传输协议的实现

    • srtp, 安全rtp传输协议的实现

    • ice, p2p连接解决方案的实现

    • turn, p2p中继协议的实现

    • mdns, 多播dns协议的实现

    • datachannel/sctp, webrtc数据传输通道的实现

    • transport作为传输对象的封装,屏蔽了底层网络传输细节

      • 让webrtc上层诸多传输协议复用,大大提高了效率

  • 按webrtc功能分

    • datachannel/sctp 对应webrtc datachannel

    • srtp/rtp/rtcp 对应webrtc媒体数据的传输

    • ice 对应p2p连通性解决方案

    • dlts 对应udp安全传输

源码阅读顺序:

  • 基础公共库

    • randutil

    • testify

    • logging

  • 基础库

    • x/net

    • transport

    • dtls

  • p2p

    • stun/turn

    • ice

  • rtp

    • rtp/rtcp/srtp

    • interceptor

  • sdp

  • 其他功能

    • mdns

    • datachannel/sctp

    • agoutil

    • quic

WebRTC学习笔记七 pion/webrtc相关推荐

  1. webrtc学习笔记二:webrtc介绍

    文章目录 Webrtc概述 Webrtc能做啥? 学到什么? https://appr.tc https://blog.csdn.net/ZDK_csdn/article/details/890128 ...

  2. Typescript 学习笔记七:泛型

    中文网:https://www.tslang.cn/ 官网:http://www.typescriptlang.org/ 目录: Typescript 学习笔记一:介绍.安装.编译 Typescrip ...

  3. 吴恩达《机器学习》学习笔记七——逻辑回归(二分类)代码

    吴恩达<机器学习>学习笔记七--逻辑回归(二分类)代码 一.无正则项的逻辑回归 1.问题描述 2.导入模块 3.准备数据 4.假设函数 5.代价函数 6.梯度下降 7.拟合参数 8.用训练 ...

  4. websocket 获取连接id_Swoole学习笔记七:搭建WebSocket长连接 之 使用 USER_ID 作为身份凭证...

    Swoole学习笔记七:搭建WebSocket长连接 之 使用 USER_ID 作为身份凭证 2年前 阅读 3678 评论 0 喜欢 0 ### 0.前言 前面基本的WebSocket操作,我们基本都 ...

  5. ROS学习笔记七:使用rqt_console和roslaunch

    ROS学习笔记七:使用rqt_console和roslaunch 本节主要介绍在调试时使用的rqt_console和rqt_logger_level,以及一次性打开多个节点的工具roslaunch. ...

  6. 【K210】K210学习笔记七——使用K210拍摄照片并在MaixHub上进行训练

    [K210]K210学习笔记七--使用K210拍摄照片并在MaixHub上进行训练 前言 K210准备工作 K210如何拍摄照片 准备工作 拍摄相关代码定义 用K210拍摄到的照片在MaixHub平台 ...

  7. Learning ROS for Robotics Programming Second Edition学习笔记(七) indigo PCL xtion pro live

    中文译著已经出版,详情请参考:http://blog.csdn.net/ZhangRelay/article/category/6506865 Learning ROS forRobotics Pro ...

  8. window的dos命令学习笔记 七

    文章目录 一.dos历史学习笔记(后期整合到这里,我想能学到这里的应该不多了,嘿嘿,加油) 二.执行状态返回值(`%errorlevel%`,和shell中`$?`相似): 三.视窗 1.color ...

  9. ESP32学习笔记(七) 复位和时钟

    ESP32学习笔记(七) 复位和时钟 目录: ESP32学习笔记(一) 芯片型号介绍 ESP32学习笔记(二) 开发环境搭建 VSCode+platformio ESP32学习笔记(三) 硬件资源介绍 ...

最新文章

  1. nn.moduleList 和Sequential由来、用法和实例 —— 写网络模型
  2. 硅谷风投押注计算机网络安全市场
  3. 视野逐渐变暗之跳转场景
  4. 怎么修改与服务器的操作系统,怎么修改与服务器的操作系统
  5. 专访《Javascript设计模式与开发实践》作者曾探:爱编程 爱生活
  6. ASP.NET Core 3.0:将会拥有更少的依赖
  7. mysql数值类型占用字节及范围_mysql数据类型及占用字节数【mysql】
  8. IT人员看待和预防癌症十大建议
  9. empinfo Oracle数据库,Oracle:其他数据库对象
  10. nginx: [warn] conflicting server name localhost on 0.0.0.0:80, ignored
  11. 关于《windows游戏编程大师技巧》的源代码
  12. 无人机飞行控制逻辑以及不稳定原因分析
  13. 体制内名校生和普校生发展有无差别?看懂这3个潜规则,越混越好
  14. 考虑一个包含n个元素的普通二叉最小堆数据结构,它支持最坏情况时间代价为O(lgn)的操作INSERT和EXTRACT-MIN。请给出一个势函数Φ,使得INSERT的平摊代价为O(lgn),EXTRAC
  15. 钢琴艺术培训市场现状研究分析报告 -
  16. matlab 理论力学,MATLAB理论力学/高等学校教材
  17. 5000字:一文看懂用户运营之增长八卦模型
  18. 第4章第1节-不撞南墙不回头-深度优先搜索
  19. 【面试】Raft算法详解
  20. Kvm与webvirtmgr虚拟化安装

热门文章

  1. 第六章 图论 AcWing 1635. 最大集团
  2. 怎么做好宝贝标题优化?
  3. iOS 使用TestFlight进行App外部测试
  4. 多商户商城系统功能拆解39讲-平台端营销-砍价记录
  5. 【教育小程序案例】线下培训机构辅导教育
  6. cf_global_round7
  7. 腾讯云、阿里云都“服”了,云容灾你还迟疑什么?
  8. 通过高德地图API(WEB端)获取中国所有省市(可扩展)的列表
  9. 字节跳动 录屏功能_免费屏幕录制软件有哪些?原来这么多
  10. 简单控件的应用(二)—学生管理系统