@vpalmisano/webrtcperf 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +296 -0
- package/app.min.js +2 -0
- package/build/src/app.d.ts +6 -0
- package/build/src/app.js +207 -0
- package/build/src/app.js.map +1 -0
- package/build/src/config.d.ts +104 -0
- package/build/src/config.js +880 -0
- package/build/src/config.js.map +1 -0
- package/build/src/generate-config-docs.d.ts +1 -0
- package/build/src/generate-config-docs.js +41 -0
- package/build/src/generate-config-docs.js.map +1 -0
- package/build/src/index.d.ts +9 -0
- package/build/src/index.js +26 -0
- package/build/src/index.js.map +1 -0
- package/build/src/media.d.ts +33 -0
- package/build/src/media.js +113 -0
- package/build/src/media.js.map +1 -0
- package/build/src/rtcstats.d.ts +302 -0
- package/build/src/rtcstats.js +418 -0
- package/build/src/rtcstats.js.map +1 -0
- package/build/src/server.d.ts +173 -0
- package/build/src/server.js +639 -0
- package/build/src/server.js.map +1 -0
- package/build/src/session.d.ts +277 -0
- package/build/src/session.js +1552 -0
- package/build/src/session.js.map +1 -0
- package/build/src/stats.d.ts +243 -0
- package/build/src/stats.js +1383 -0
- package/build/src/stats.js.map +1 -0
- package/build/src/utils.d.ts +249 -0
- package/build/src/utils.js +1220 -0
- package/build/src/utils.js.map +1 -0
- package/build/src/visqol.d.ts +6 -0
- package/build/src/visqol.js +61 -0
- package/build/src/visqol.js.map +1 -0
- package/build/src/vmaf.d.ts +83 -0
- package/build/src/vmaf.js +624 -0
- package/build/src/vmaf.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/package.json +129 -0
- package/src/app.ts +241 -0
- package/src/config.ts +852 -0
- package/src/generate-config-docs.ts +47 -0
- package/src/index.ts +9 -0
- package/src/media.ts +151 -0
- package/src/rtcstats.ts +507 -0
- package/src/server.ts +645 -0
- package/src/session.ts +1908 -0
- package/src/stats.ts +1668 -0
- package/src/utils.ts +1295 -0
- package/src/visqol.ts +62 -0
- package/src/vmaf.ts +771 -0
package/README.md
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+

|
|
2
|
+
# WebRTC Perf
|
|
3
|
+
[GitHub page](https://github.com/vpalmisano/webrtcperf) | [Documentation](https://vpalmisano.github.io/webrtcperf)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/vpalmisano/webrtcperf/actions/workflows/build.yaml)
|
|
6
|
+
|
|
7
|
+
WebRTC performance and quality evaluation tool.
|
|
8
|
+
It allows to validate the audio/video quality and the client CPU/memory usage
|
|
9
|
+
when multiple connections join the same WebRTC service.
|
|
10
|
+
|
|
11
|
+
Main features:
|
|
12
|
+
- A NodeJS application/library using Puppeteer for controlling chromium instances.
|
|
13
|
+
- It can be executed:
|
|
14
|
+
- using the pre built Docker image; this is the suggested way to run the tool
|
|
15
|
+
without installing any dependency;
|
|
16
|
+
- from sources (using git pull or npm install);
|
|
17
|
+
- using the pre built executables generated for each platform.
|
|
18
|
+
- It allows to inject custom Javascript source files that will run into the
|
|
19
|
+
browser page context for automating some tasks (e.g. pressing a button to join
|
|
20
|
+
a conference room).
|
|
21
|
+
- It allows to throttle the networking configuration, limiting the ingress/egress
|
|
22
|
+
available bandwidth, the RTT or the packet loss %.
|
|
23
|
+
- It uses a patched version of chromium (see `./chromium` directory) that allows
|
|
24
|
+
to disable the video decoding, lowering the CPU requirements when running multiple
|
|
25
|
+
browser sessions.
|
|
26
|
+
- It contains an RTC stats logging module that allows to collect metrics and
|
|
27
|
+
send them to a Prometheus Pushgateway server for live visualization with Grafana.
|
|
28
|
+
- It allows to override getUserMedia and getDisplayMedia calls.
|
|
29
|
+
- It allows to define alert rules and generate reports.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
The tool can be executed from sources, using the pre built executables or using the Docker image.
|
|
33
|
+
|
|
34
|
+
Using Npm:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g @vpalmisano/webrtcperf
|
|
38
|
+
|
|
39
|
+
# Install FFMpeg:
|
|
40
|
+
sudo apt install ffmpeg # Linux
|
|
41
|
+
# or:
|
|
42
|
+
brew install ffmpeg # MacOS
|
|
43
|
+
|
|
44
|
+
# Run a Jitsi test:
|
|
45
|
+
webrtcperf \
|
|
46
|
+
--url="https://meet.jit.si/${JITSI_ROOM_URL}#config.prejoinPageEnabled=false" \
|
|
47
|
+
--display='' \
|
|
48
|
+
--show-page-log=false
|
|
49
|
+
# Press <q> to stop.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Using Docker:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
docker pull ghcr.io/vpalmisano/webrtcperf
|
|
56
|
+
docker run -it --rm \
|
|
57
|
+
-v /dev/shm:/dev/shm \
|
|
58
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
59
|
+
--url="https://meet.jit.si/$JITSI_ROOM_URL#config.prejoinPageEnabled=false" \
|
|
60
|
+
--show-page-log=false \
|
|
61
|
+
--sessions=1 \
|
|
62
|
+
--tabs-per-session=1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Stop the tool pressing `q` (normal browser close) or `x` (it will close the
|
|
66
|
+
process immediately).
|
|
67
|
+
|
|
68
|
+
## Configuration options
|
|
69
|
+
|
|
70
|
+
See the [config documentation](https://vpalmisano.github.io/webrtcperf/documents/config.html).
|
|
71
|
+
|
|
72
|
+
## Statistics
|
|
73
|
+
|
|
74
|
+
Example output:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
-- Mon, 06 Feb 2023 20:46:34 GMT -------------------------------------------------------------------
|
|
78
|
+
name count sum mean stddev 5p 95p min max
|
|
79
|
+
System CPU 1 15.89 0.00 15.89 15.89 15.89 15.89 %
|
|
80
|
+
System GPU 1 0.00 0.00 0.00 0.00 0.00 0.00 %
|
|
81
|
+
System Memory 1 72.18 0.00 72.18 72.18 72.18 72.18 %
|
|
82
|
+
CPU/page 1 84.42 84.42 0.00 84.42 84.42 84.42 84.42 %
|
|
83
|
+
Memory/page 1 1206.90 1206.90 0.00 1206.90 1206.90 1206.90 1206.90 MB
|
|
84
|
+
Pages 1 1 1 0 1 1 1 1
|
|
85
|
+
Errors 1 0 0 0 0 0 0 0
|
|
86
|
+
Warnings 1 0 0 0 0 0 0 0
|
|
87
|
+
Peer Connections 1 2 2 0 2 2 2 2
|
|
88
|
+
-- Inbound audio -----------------------------------------------------------------------------------
|
|
89
|
+
rate 2 28.73 14.36 14.36 0.00 28.73 0.00 28.73 Kbps
|
|
90
|
+
lost 1 0.00 0.00 0.00 0.00 0.00 0.00 %
|
|
91
|
+
jitter 2 0.00 0.00 0.00 0.00 0.00 0.00 s
|
|
92
|
+
avgJitterBufferDelay 1 35.29 0.00 35.29 35.29 35.29 35.29 ms
|
|
93
|
+
-- Inbound video -----------------------------------------------------------------------------------
|
|
94
|
+
received 2 2.66 1.33 1.32 0.01 2.64 0.01 2.64 MB
|
|
95
|
+
rate 2 967.41 483.71 483.71 0.00 967.41 0.00 967.41 Kbps
|
|
96
|
+
lost 1 0.00 0.00 0.00 0.00 0.00 0.00 %
|
|
97
|
+
jitter 2 0.01 0.01 0.01 0.02 0.01 0.02 s
|
|
98
|
+
avgJitterBufferDelay 1 50.48 0.00 50.48 50.48 50.48 50.48 ms
|
|
99
|
+
width 2 960 320 640 1280 640 1280 px
|
|
100
|
+
height 2 540 180 360 720 360 720 px
|
|
101
|
+
fps 1 15 0 15 15 15 15 fps
|
|
102
|
+
-- Outbound audio ----------------------------------------------------------------------------------
|
|
103
|
+
rate 2 42.84 21.42 21.42 0.00 42.84 0.00 42.84 Kbps
|
|
104
|
+
lost 1 0.00 0.00 0.00 0.00 0.00 0.00 %
|
|
105
|
+
roundTripTime 1 0.001 0.000 0.001 0.001 0.001 0.001 s
|
|
106
|
+
-- Outbound video ----------------------------------------------------------------------------------
|
|
107
|
+
sent 2 3.25 1.62 1.58 0.04 3.21 0.04 3.21 MB
|
|
108
|
+
rate 2 1131.25 565.63 565.63 0.00 1131.25 0.00 1131.25 Kbps
|
|
109
|
+
lost 1 0.00 0.00 0.00 0.00 0.00 0.00 %
|
|
110
|
+
roundTripTime 1 0.001 0.000 0.001 0.001 0.001 0.001 s
|
|
111
|
+
qualityLimitResolutionChanges 2 2 1 1 0 2 0 2
|
|
112
|
+
qualityLimitationCpu 2 0 0 0 0 0 0 0 %
|
|
113
|
+
qualityLimitationBandwidth 2 20 10 10 0 20 0 20 %
|
|
114
|
+
sentActiveEncodings 2 2 1 1 3 1 3 encodings
|
|
115
|
+
sentMaxBitrate 2 3700.00 1850.00 350.00 1500.00 2200.00 1500.00 2200.00 Kbps
|
|
116
|
+
width 2 640 640 0 1280 0 1280 px
|
|
117
|
+
height 2 360 360 0 720 0 720 px
|
|
118
|
+
fps 2 12 12 0 25 0 25 fps
|
|
119
|
+
pliCountReceived 2 1 0 1 2 1 2
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Statistics values:
|
|
123
|
+
|
|
124
|
+
| Name | Count | Description |
|
|
125
|
+
| :------------------------ | :----------- | :----------- |
|
|
126
|
+
| cpu | Total sessions | The browser process cpu usage. |
|
|
127
|
+
| memory | Total sessions | The browser process memory usage. |
|
|
128
|
+
| tabs | Total sessions | The browser current opened tabs. |
|
|
129
|
+
| received | Total inbound streams | The `bytesReceived` value for each stream. |
|
|
130
|
+
| sent | Total outbound streams | The `bytesSent` value for each stream. |
|
|
131
|
+
| retransmitted | Total outbound streams | The `retransmittedBytesSent` value for each stream. |
|
|
132
|
+
| rate | Total streams | The stream bitrate. |
|
|
133
|
+
| lost | Total streams | The stream [lost packets](https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats-packetslost) %. |
|
|
134
|
+
| jitter | Total streams | The stream [jitter](https://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats-jitter) in seconds. |
|
|
135
|
+
| avgJitterBufferDelay | Total decoded tracks | The inbound average [jitter buffer delay](https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferdelay). |
|
|
136
|
+
| qualityLimitResolutionChanges | Total outbound video streams | The `qualityLimitationResolutionChanges` [value](https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges) for each outbound video stream. |
|
|
137
|
+
| width | Total sent or received videos | The sent or received video width. |
|
|
138
|
+
| height | Total sent or received videos | The sent or received video height. |
|
|
139
|
+
| fps | Total sent | The sent video frames per second. |
|
|
140
|
+
|
|
141
|
+
## Prometheus / Grafana
|
|
142
|
+
See the [prometheus stack](prometheus-stack/README.md).
|
|
143
|
+
|
|
144
|
+
## Examples
|
|
145
|
+
|
|
146
|
+
### Mediasoup demo
|
|
147
|
+
|
|
148
|
+
Starts one send-receive participant:
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
docker run -it --rm --name=webrtcperf-publisher \
|
|
152
|
+
-v /dev/shm:/dev/shm \
|
|
153
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
154
|
+
--url=$MEDIASOUP_DEMO_URL \
|
|
155
|
+
--url-query='roomId=test&displayName=Publisher($s-$t)' \
|
|
156
|
+
--sessions=1 \
|
|
157
|
+
--tabs-per-session=1
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Starts 10 receive-only participants:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
docker run -it --rm --name=webrtcperf-viewer \
|
|
164
|
+
-v /dev/shm:/dev/shm \
|
|
165
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
166
|
+
--url=$MEDIASOUP_DEMO_URL \
|
|
167
|
+
--url-query='roomId=test&displayName=Viewer($s-$t)&produce=false' \
|
|
168
|
+
--sessions=1 \
|
|
169
|
+
--tabs-per-session=10
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Edumeet
|
|
173
|
+
|
|
174
|
+
Starts one send-receive participant, with a random audio activation pattern:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
docker run -it --rm \
|
|
178
|
+
-v /dev/shm:/dev/shm \
|
|
179
|
+
-v $PWD/examples:/scripts:ro \
|
|
180
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
181
|
+
--url=$EDUMEET_URL \
|
|
182
|
+
--url-query='displayName=Publisher($s-$t)' \
|
|
183
|
+
--script-path=/scripts/edumeet-sendrecv.js \
|
|
184
|
+
--sessions=1 \
|
|
185
|
+
--tabs-per-session=1
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Starts 10 receive-only participants:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
docker run -it --rm \
|
|
192
|
+
-v /dev/shm:/dev/shm \
|
|
193
|
+
-v $PWD/examples:/scripts:ro \
|
|
194
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
195
|
+
--url=$EDUMEET_URL \
|
|
196
|
+
--url-query='displayName=Viewer($s-$t)' \
|
|
197
|
+
--script-path=/scripts/edumeet-recv.js \
|
|
198
|
+
--sessions=1 \
|
|
199
|
+
--tabs-per-session=10
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Jitsi
|
|
203
|
+
|
|
204
|
+
Starts one send-receive participant:
|
|
205
|
+
|
|
206
|
+
```sh
|
|
207
|
+
docker run -it --rm \
|
|
208
|
+
-v /dev/shm:/dev/shm \
|
|
209
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
210
|
+
--url=$JITSI_ROOM_URL \
|
|
211
|
+
--url-query='#config.prejoinPageEnabled=false&userInfo.displayName=Participant($s-$t)' \
|
|
212
|
+
--sessions=1 \
|
|
213
|
+
--tabs-per-session=1
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Starts 10 receive-only participants:
|
|
217
|
+
|
|
218
|
+
```sh
|
|
219
|
+
docker run -it --rm \
|
|
220
|
+
-v /dev/shm:/dev/shm \
|
|
221
|
+
ghcr.io/vpalmisano/webrtcperf \
|
|
222
|
+
--url=$ROOM_URL \
|
|
223
|
+
--url-query='#config.prejoinPageEnabled=false&userInfo.displayName=Participant($s-$t)' \
|
|
224
|
+
--sessions=1 \
|
|
225
|
+
--tabs-per-session=10
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Running from source code
|
|
229
|
+
|
|
230
|
+
The `DEBUG_LEVEL` environment variable can be used to enable debug messages;
|
|
231
|
+
see [debug-level](https://github.com/commenthol/debug-level#readme) for syntax.
|
|
232
|
+
|
|
233
|
+
```sh
|
|
234
|
+
git clone https://github.com/vpalmisano/webrtcperf.git
|
|
235
|
+
|
|
236
|
+
cd webrtcperf
|
|
237
|
+
|
|
238
|
+
# Optional: build the chromium customized version
|
|
239
|
+
# cd chromium
|
|
240
|
+
# ./build.sh setup
|
|
241
|
+
# ./build.sh apply_patch
|
|
242
|
+
# ./build.sh build
|
|
243
|
+
# install the package (on Ubuntu/Debian)
|
|
244
|
+
# dpkg -i ./chromium-browser-unstable_<version>-1_amd64.deb
|
|
245
|
+
# cd ..
|
|
246
|
+
|
|
247
|
+
yarn build
|
|
248
|
+
|
|
249
|
+
# sendrecv test
|
|
250
|
+
DEBUG_LEVEL=DEBUG:* yarn start \
|
|
251
|
+
--url=https://127.0.0.1:3443/test \
|
|
252
|
+
--url-query='displayName=SendRecv($s/$S-$t/$T)' \
|
|
253
|
+
--script-path=./examples/edumeet-sendrecv.js \
|
|
254
|
+
--sessions=1 \
|
|
255
|
+
--tabs-per-session=1
|
|
256
|
+
|
|
257
|
+
# recv only
|
|
258
|
+
DEBUG_LEVEL=DEBUG:* yarn start \
|
|
259
|
+
--url=https://127.0.0.1:3443/test \
|
|
260
|
+
--url-query='displayName=Recv($s/$S-$t/$T)' \
|
|
261
|
+
--script-path=./examples/edumeet-recv.js \
|
|
262
|
+
--sessions=1 \
|
|
263
|
+
--tabs-per-session=10
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## Using the VMAF calculator
|
|
267
|
+
Run a test adding the following options:
|
|
268
|
+
```sh
|
|
269
|
+
--script-params="{timestampWatermarkVideo:true,saveSendVideoTrack:'0',saveRecvVideoTrack:'1'}" \
|
|
270
|
+
--server-port=5000 \
|
|
271
|
+
--server-use-https=true \
|
|
272
|
+
--server-data=/data \
|
|
273
|
+
--vmaf-path /data
|
|
274
|
+
```
|
|
275
|
+
With `saveSendVideoTrack` and `saveRecvVideoTrack` you can specify the sessions that will be saved at sender and receiver side (in this example it will save all the video streams sent in the session with index `0` and received in session `1`).
|
|
276
|
+
The sent/received videos will be saved in the `/data` directory.
|
|
277
|
+
The tool will generate a `.vmaf.json` and a `.vmaf.png` files in the `data/vmaf` directory. Adding the `--vmaf-preview` option, a `.mp4` file containing the side-by-side video comparison will be generated.
|
|
278
|
+
|
|
279
|
+
## Using the VISQOL calculator
|
|
280
|
+
Run a test adding the following options:
|
|
281
|
+
```sh
|
|
282
|
+
--script-params="{saveSendAudioTrack:'0',saveRecvAudioTrack:'1'}" \
|
|
283
|
+
--server-port=5000 \
|
|
284
|
+
--server-use-https=true \
|
|
285
|
+
--server-data=/data \
|
|
286
|
+
--visqol-path /data
|
|
287
|
+
```
|
|
288
|
+
With `saveSendAudioTrack` and `saveRecvAudioTrack` you can specify the sessions that will be saved at sender and receiver side (in this example it will save all the audio streams sent in the session with index `0` and received in session `1`).
|
|
289
|
+
The sent/received audio files will be saved in the `/data` directory.
|
|
290
|
+
The tool will generate a `visqol.csv` file in the `data` directory.
|
|
291
|
+
|
|
292
|
+
## Authors
|
|
293
|
+
- Vittorio Palmisano [[github](https://github.com/vpalmisano)]
|
|
294
|
+
|
|
295
|
+
## License
|
|
296
|
+
[AGPL](./LICENSE)
|