Skip to content

Commit 4b01054

Browse files
authored
Update README.md
1 parent 21442fe commit 4b01054

File tree

1 file changed

+138
-6
lines changed

1 file changed

+138
-6
lines changed

README.md

Lines changed: 138 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
11
# webrtc-issue-detector
2-
WebRTC diagnostic tool that detects issues with network or user devices
32

4-
----
3+
Diagnostic tool for WebRTC applications that analyzes WebRTC getStats() result in realtime and generates a report on possible issues.
4+
5+
6+
## Key features
7+
8+
- **Mean opinion score** - calculates [MOS](https://en.wikipedia.org/wiki/Mean_opinion_score) for inbound and outbound network connections that can indicate problems before it even appears.
9+
- **CPU issues** - indicates possible issues with encoding and decoding media streams.
10+
- **Server issues** - indicates possible server side issues.
11+
- **Fully customizable** - allows to create your own detectors or WebRTC getStats() parsers.
12+
513

614
## Installation
715
`yarn add webrtc-issue-detector`
816

917

1018
## Usage
11-
### Import
19+
20+
### Getting started
1221
```typescript
1322
import WebRTCIssueDetector from 'webrtc-issue-detector';
1423

15-
return new WebRTCIssueDetector({
16-
onIssues: (issues) => console.log('Issues detected:', issues),
17-
onNetworkScoresUpdated: (scores) => console.log('Network scores updated:', scores),
24+
// create it before the first instance of RTCPeerConnection is created
25+
const webRtcIssueDetector = new WebRTCIssueDetector({
26+
onIssues: (issues) => issues.map((issue) => {
27+
console.log('Issues type:', issue.type); // eg. "network"
28+
console.log('Issues reason:', issue.reason); // eg. "outbound-network-throughput"
29+
console.log('Issues reason:', issue.debug); // eg. "packetLoss: 12%, jitter: 230, rtt: 150"
30+
}),
31+
onNetworkScoresUpdated: (scores) => {
32+
console.log('Inbound network score', scores.inbound); // eg. 3.7
33+
console.log('Outbound network score', scores.outbound); // eg. 4.5
34+
}
1835
});
36+
37+
// start collecting getStats() and detecting issues
38+
webRtcIssueDetector.watchNewPeerConnections();
1939
```
2040

2141
### Configure
@@ -61,6 +81,118 @@ new WebRTCIssueDetector({
6181
});
6282
```
6383

84+
## Detectors
85+
86+
### AvailableOutgoingBitrateIssueDetector
87+
Detects issues with outgoing network connection.
88+
```js
89+
{
90+
type: 'network',
91+
reason: 'outbound-network-throughput',
92+
debug: '...'
93+
}
94+
```
95+
96+
### FramesDroppedIssueDetector
97+
Detects issues with decoder.
98+
```js
99+
{
100+
type: 'cpu',
101+
reason: 'decoder-cpu-throttling',
102+
debug: '...'
103+
}
104+
```
105+
106+
### FramesEncodedSentIssueDetector
107+
Detects issues with outbound network throughput.
108+
```js
109+
{
110+
type: 'network',
111+
reason: 'outbound-network-throughput',
112+
debug: '...'
113+
}
114+
```
115+
116+
### InboundNetworkIssueDetector
117+
Detects issues with inbound network connection.
118+
```js
119+
{
120+
type: 'network',
121+
reason: 'inbound-network-quality' | 'inbound-network-media-latency' | 'network-media-sync-failure',
122+
iceCandidate: 'ice-candidate-id'
123+
debug: '...'
124+
}
125+
```
126+
127+
Also can detect server side issues if there is high RTT and jitter is ok.
128+
```js
129+
{
130+
type: 'server',
131+
reason: 'server-issue',
132+
iceCandidate: 'ice-candidate-id'
133+
debug: '...'
134+
}
135+
```
136+
137+
### NetworkMediaSyncIssueDetector
138+
Detects issues with audio syncronization.
139+
```js
140+
{
141+
type: 'network',
142+
reason: 'network-media-sync-failure',
143+
ssrc: '...'
144+
debug: '...'
145+
}
146+
```
147+
148+
### OutboundNetworkIssueDetector
149+
Detects issues with outbound network connection.
150+
```js
151+
{
152+
type: 'network',
153+
reason: 'outbound-network-quality' | 'outbound-network-media-latency',
154+
iceCandidate: 'ice-candidate-id'
155+
debug: '...'
156+
}
157+
```
158+
159+
### QualityLimitationsIssueDetector
160+
Detects issues with encoder and outbound network. Based on native qualitiLimitationReason.
161+
```js
162+
{
163+
type: 'cpu',
164+
reason: 'encoder-cpu-throttling',
165+
ssrc: '...'
166+
debug: '...'
167+
}
168+
```
169+
170+
```js
171+
{
172+
type: 'network',
173+
reason: 'outbound-network-throughput',
174+
ssrc: '...'
175+
debug: '...'
176+
}
177+
```
178+
179+
### VideoCodecMismatchDetector
180+
Detects issues with decoding stream.
181+
```js
182+
{
183+
type: 'stream',
184+
reason: 'codec-mismatch',
185+
ssrc: '...',
186+
trackIdentifier: '...',
187+
debug: '...'
188+
}
189+
```
190+
191+
## Roadmap
192+
193+
- [ ] Adaptive getStats() call interval based on last getStats() exectution time
194+
- [ ] Structured issue debug
195+
- [ ] Issues detector for user devices permissions
64196

65197
## Test
66198
`yarn test`

0 commit comments

Comments
 (0)