bandwidth probe and estimation

1. 什么时候会触发探测 1)network available at startup 在启动时网络连通时 2)enable periodic alr probing 启用了定时 ALR 探测 3)large drop in estimated bandwidth 发现评估的带宽有大幅衰减 4) probing results indicate channel has greater capacity 探测结果揭示有更大的容量 2. 带宽探测的配置 These parameters configure the initial probes. First we send one or two probes of sizes p1 start_bitratebps and p2 start_bitratebps. Then whenever we get […] →Read more

How to add log to log file in WebRTC library

先写一个 LogSink class BweTestLogSink : public rtc::LogSink { public: BweTestLogSink(const std::string& filepath) { m_stream.open(filepath, std::ios::app | std::ios::out | std::ios::in); } ~BweTestLogSink() { m_stream.close(); } void OnLogMessage(const std::string& message) override { //std::cout << message << std::endl; m_stream << message; } private: std::ofstream m_stream; }; 2. 将这个 LogSink 加到 LogMessage 的输出流中 “`cpp //程序开始后 //add timestmap, thread into […] →Read more

Google Congestion Control 实现分析之二

总体流程 当收到 Transport Wide CC RTCP report 时候 ,会回调 OnTransportPacketsFeedback 方法 s=>start e=>end s1=>operation: send rtp with TWCC header s2=>operation: receive rtp packet s3=>operation: compose TWCC feedback s4=>operation: send rtcp packet s5=>operation: receive rtcp packet s6=>operation: parse rtcp packet s7=>operation: bandwidth estimate s8=>operation: adjust send bitrate s->s1->s2->s3->s4->s5->s6->s7->s8->e 主要的逻辑在发送方 title WebRTC congestion control v1 participant RtpSender […] →Read more

Google Congestion control 的实现分析之一

Overview 影响因素有 Packet loss, RTT 和 OWDV(One Way Delay Varion) 基于丢包的控制器:以丢包率, RTT 和 REMB 消息来估算一个目标发送码率 基于延迟的控制器:以包的到达信息,或者在接收方,或者在发送方接收反馈,估算一个最大的码率,然后传送给基于丢包的控制器 基于丢包的估算是保底的,丢包率大于 10% 就往下降码率,小于 2% 就往上升码率 基于延迟的控制器一开始用的是 Kalman filter, 后来改为 Trendline filter , 便于预测网络变化的趋势 Trendline filter 的输入参数有 Main interface method parameter description OnNetworkAvailability NetworkAvailability 当网络连接有效或无效时 OnNetworkRouteChange NetworkRouteChange 当网络地址更改时 OnProcessInterval ProcessInterval 定时回调,以检查网络 OnRemoteBitrateReport RemoteBitrateReport 当收到 REMB RTCP 消息时回调 OnRoundTripTimeUpdate RoundTripTimeUpdate 当 […] →Read more

拥塞控制技术笔记二:Transport wide Congestion control

Abstract 拥塞控制技术的笔记二: TWCC Authors Walter Fan  Category     learning note   Status WIP Updated 2022-2-12 概述 前面回顾拥塞控制的一些理论 拥塞控制技术笔记一: 理论篇, 接下来再回顾 WebRTC 中应用较广的 Google 提出来的 GCC(Google Congestion Control), 它有两个版本: GCC v1: 通过 RTP abs_send_time header 和 RTCP REMB message 扩展,基于丢包和延迟估算带宽占用和是否有拥塞,从而调整媒体流的发送速率,主要的估算和决策在接收方,采用了卡尔曼滤波 GCC v2: 通过 RTP transport wide cc sn header 和 RTCP transport feedback message 扩展,基于丢包和延迟估算带宽占用和是否有拥塞,从而调整媒体流的发送速率,主要的估算和决策在发送方,采用了线性回归和最小二乘法 下面来重点讲讲 GCC v2. 它首先定义了对 […] →Read more

拥塞控制技术笔记一:理论篇

Abstract 拥塞控制技术的笔记一 Authors Walter Fan  Category     learning notes   Status WIP Updated 2022-2-10 引言 如果带宽足够的话, 没有拥塞,没有大的延迟和抖动, 那么语音和视频的发送和接收都会很顺滑,一切会很美好. 现实总是很残酷的, 网络会断, 会丢包, 会变慢,在路由节点上会排队,会拥塞,就象城市的环线道路,平常车来车往,道路通畅,一到上下班的时候,大大小小的车辆就象乌龟一样慢慢向前爬。 视频会议需要低延迟和高带宽,可是实际情况中,高带宽是难以保证的,一旦网络出现拥塞,原本就不宽阔的“马路” 堵得更窄,延迟更大。这时候,就需要做拥塞控制 在网络会议中,如果延迟太大,对在线交流就会产生影响。语音会感觉很明显,视频相对迟钝一些。 以视频来说,据研究,大致的关系如下 延迟 感觉 0 ~ 400 毫秒 在交流过程中感觉不到延迟 400 ~ 800 毫秒 能感觉到延迟,但不影响沟通和交流 800 毫秒及以上 能感觉到延迟,并且影响沟通和交流 以一个每秒 24 帧 640*480 分辨率,以 H.264 编码的视频流,视频的比特率和用户感觉的关系如下 比特率 感觉 > 800kbps 用户对视频的清晰度感到满意,感知不到视频图像信息的丢失 480 ~ 800kbps 用户对视频的清晰度基本满意,有些人能感知到视频图像信息的丢失 < […] →Read more

The Three Rules of TDD

Robert C. Martin (“Uncle Bob”) provides a concise set of rules for practicing TDD. Write production code only to pass a failing unit test. Write no more of a unit test than sufficient to fail (compilation failures are failures). Write no more production code than necessary to pass the one failing unit test. Rule #1 […] →Read more

GDI, OpenGL, WebGL and Direct3D

The main APIs we used are: drawIimage renderText GDI The Graphics Device Interface (GDI) is a legacy component of Microsoft Windows responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. Windows apps use Windows API to interact with GDI, for such tasks as drawing lines and curves, rendering […] →Read more

WebRTC Congestion Control classes

Module remote_bitrate_estimator class RemoteEstimatorProxy It is used when send-side BWE is enabled: This proxy is instantiated on the receive side. It buffers a number of receive timestamps and then sends transport feedback messages back too the send side. class AimdRateControl A rate control implementation based on additive increases of bitrate when no over-use is detected […] →Read more

写作力读书笔记一

这本书是由高语罕写于1922 年,一百年之后,读起来仍有收获。 这位安徽老乡之前并未听说,网上搜索一下,竟然是这样一位高人。 第二章 如何从无到有写了一篇好文章 一 写什么:选题的七点建议 要部分的,不要全体的 微服务架构之道,不如 “微服务之道:度量驱动开发” 要具体的,不要抽象的 要是自己的经验或观察 或是自己的想象 或者自己对于所研究的学科的见解 要有吸引力 要简单明了 二 确定观点,摒弃五种偏见 point of view 作者的观察,易为师承所囿 作者的观察,易为主观见解与蔽 作者的观察,易为时代思想所囿 作者的观察,易为地方的见解所束缚 作者的观察,易为感情或客气所转移 誉之则升诸九天,毁之则堕诸必渊 爱之欲其生,恶之欲其死 三 取材:确立文章骨干 四 布局和起草 五 修饰与朗读 第三章 好文章的四要素 事实:宜写确切的事实 思想:宜有正确的思想 语言:宜用明白的语言 读者:我的文章是给谁看的 第四章 文章的戒律 戒虚伪, 戒夸大, 戒堆砌典故, 戒模仿, 戒轻薄 →Read more