@vpalmisano/webrtcperf 4.7.1 → 4.7.2
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/app.min.js +1 -1
- package/build/src/media.d.ts +0 -1
- package/build/src/media.js +3 -10
- package/build/src/media.js.map +1 -1
- package/build/src/rtcstats.d.ts +1 -0
- package/build/src/rtcstats.js +1 -0
- package/build/src/rtcstats.js.map +1 -1
- package/build/src/session.d.ts +1 -0
- package/build/src/session.js +12 -4
- package/build/src/session.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/media.ts +3 -13
- package/src/rtcstats.ts +1 -0
- package/src/session.ts +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpalmisano/webrtcperf",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/vpalmisano/webrtcperf.git"
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
},
|
|
52
52
|
"license": "AGPL-3.0-or-later",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@google/genai": "^1.
|
|
55
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
56
|
-
"@puppeteer/browsers": "^2.
|
|
54
|
+
"@google/genai": "^1.46.0",
|
|
55
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
56
|
+
"@puppeteer/browsers": "^2.13.0",
|
|
57
57
|
"@vpalmisano/throttler": "0.0.14",
|
|
58
|
-
"@vpalmisano/webrtcperf-js": "^1.
|
|
58
|
+
"@vpalmisano/webrtcperf-js": "^1.2.3",
|
|
59
59
|
"axios": "^1.13.5",
|
|
60
60
|
"chalk-template": "^1.1.2",
|
|
61
61
|
"change-case": "^4.1.2",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"convict": "^6.2.4",
|
|
64
64
|
"convict-format-with-validator": "^6.2.0",
|
|
65
65
|
"debug-level": "^4.1.1",
|
|
66
|
-
"dockerode": "^4.0.
|
|
66
|
+
"dockerode": "^4.0.10",
|
|
67
67
|
"express": "^5.2.1",
|
|
68
68
|
"express-basic-auth": "^1.2.1",
|
|
69
69
|
"fast-stats": "^0.0.7",
|
|
@@ -79,15 +79,15 @@
|
|
|
79
79
|
"pidtree": "^0.6.0",
|
|
80
80
|
"pidusage": "^4.0.1",
|
|
81
81
|
"prom-client": "^15.1.3",
|
|
82
|
-
"puppeteer": "^24.
|
|
83
|
-
"puppeteer-core": "^24.
|
|
82
|
+
"puppeteer": "^24.40.0",
|
|
83
|
+
"puppeteer-core": "^24.40.0",
|
|
84
84
|
"puppeteer-extra": "^3.3.6",
|
|
85
85
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
86
86
|
"puppeteer-intercept-and-modify-requests": "^1.3.1",
|
|
87
87
|
"sprintf-js": "^1.1.3",
|
|
88
88
|
"tar-fs": "^3.1.1",
|
|
89
89
|
"toml": "^3.0.0",
|
|
90
|
-
"ws": "^8.
|
|
90
|
+
"ws": "^8.20.0",
|
|
91
91
|
"yaml": "^2.8.1",
|
|
92
92
|
"zod": "3"
|
|
93
93
|
},
|
package/src/media.ts
CHANGED
|
@@ -10,7 +10,6 @@ export type MediaPath = {
|
|
|
10
10
|
video: string
|
|
11
11
|
audio: string
|
|
12
12
|
mp4: string
|
|
13
|
-
m4a: string
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -79,24 +78,19 @@ export async function prepareFakeMedia({
|
|
|
79
78
|
const destMp4Path = useFakeMedia
|
|
80
79
|
? ''
|
|
81
80
|
: `${videoCachePath}/${name}_${videoWidth}x${videoHeight}_${videoFramerate}fps.mp4`
|
|
82
|
-
const destM4aPath = useFakeMedia ? '' : `${videoCachePath}/${name}.m4a`
|
|
83
81
|
|
|
84
82
|
if (
|
|
85
83
|
!existsSync(destVideoPath) ||
|
|
86
84
|
!existsSync(destAudioPath) ||
|
|
87
85
|
(destMp4Path && !existsSync(destMp4Path)) ||
|
|
88
|
-
(destM4aPath && !existsSync(destM4aPath)) ||
|
|
89
86
|
!videoCacheRaw
|
|
90
87
|
) {
|
|
91
|
-
log.info(
|
|
92
|
-
`Converting ${videoPath} to ${destVideoPath}, ${destAudioPath}${destMp4Path ? `, ${destMp4Path}` : ''}${destM4aPath ? `, ${destM4aPath}` : ''}`,
|
|
93
|
-
)
|
|
88
|
+
log.info(`Converting ${videoPath} to ${destVideoPath}, ${destAudioPath}${destMp4Path ? `, ${destMp4Path}` : ''}`)
|
|
94
89
|
const destVideoPathTmp = `${videoCachePath}/${name}_${videoWidth}x${videoHeight}_${videoFramerate}fps.tmp.${videoFormat}`
|
|
95
90
|
const destAudioPathTmp = `${videoCachePath}/${name}.tmp.wav`
|
|
96
91
|
const destMp4PathTmp = useFakeMedia
|
|
97
92
|
? ''
|
|
98
93
|
: `${videoCachePath}/${name}_${videoWidth}x${videoHeight}_${videoFramerate}fps.tmp.mp4`
|
|
99
|
-
const destM4aPathTmp = useFakeMedia ? '' : `${videoCachePath}/${name}.tmp.m4a`
|
|
100
94
|
|
|
101
95
|
try {
|
|
102
96
|
let source = `-i "${videoPath}"`
|
|
@@ -119,8 +113,8 @@ export async function prepareFakeMedia({
|
|
|
119
113
|
` ${videoMap} ${destVideoPathTmp}` +
|
|
120
114
|
` ${audioMap} -ar 48000 ${destAudioPathTmp}` +
|
|
121
115
|
(destMp4PathTmp
|
|
122
|
-
? ` ${videoMap} -c:v libx264 -crf 10
|
|
123
|
-
` ${audioMap} -c:a aac -ar 48000 -b:a 192k -f mp4 -movflags faststart ${
|
|
116
|
+
? ` ${videoMap} -c:v libx264 -crf 10` +
|
|
117
|
+
` ${audioMap} -c:a aac -ar 48000 -b:a 192k -f mp4 -movflags faststart ${destMp4PathTmp}`
|
|
124
118
|
: ''),
|
|
125
119
|
)
|
|
126
120
|
await fs.rename(destVideoPathTmp, destVideoPath)
|
|
@@ -128,9 +122,6 @@ export async function prepareFakeMedia({
|
|
|
128
122
|
if (destMp4PathTmp) {
|
|
129
123
|
await fs.rename(destMp4PathTmp, destMp4Path)
|
|
130
124
|
}
|
|
131
|
-
if (destM4aPathTmp) {
|
|
132
|
-
await fs.rename(destM4aPathTmp, destM4aPath)
|
|
133
|
-
}
|
|
134
125
|
} catch (err) {
|
|
135
126
|
log.error(`Error converting video: ${(err as Error).stack}`)
|
|
136
127
|
fs.unlink(destVideoPathTmp).catch(e => log.debug(e.message))
|
|
@@ -146,6 +137,5 @@ export async function prepareFakeMedia({
|
|
|
146
137
|
video: destVideoPath,
|
|
147
138
|
audio: destAudioPath,
|
|
148
139
|
mp4: destMp4Path,
|
|
149
|
-
m4a: destM4aPath,
|
|
150
140
|
}
|
|
151
141
|
}
|
package/src/rtcstats.ts
CHANGED
package/src/session.ts
CHANGED
|
@@ -86,6 +86,7 @@ declare global {
|
|
|
86
86
|
screenStartFrameDelay: number
|
|
87
87
|
}
|
|
88
88
|
collectCpuPressure: () => number
|
|
89
|
+
collectQuestionAnswerDelay: () => number
|
|
89
90
|
collectVideoStats: () => {
|
|
90
91
|
width: number
|
|
91
92
|
height: number
|
|
@@ -817,16 +818,19 @@ try {
|
|
|
817
818
|
console.error('[webrtcperf] Error parsing scriptParams:', err);
|
|
818
819
|
webrtcperf.params = {};
|
|
819
820
|
};
|
|
821
|
+
|
|
822
|
+
const webrtcperf_getServerUrl = (path, protocol = 'http', query = '') => {
|
|
823
|
+
return protocol + "${this.serverUseHttps ? 's' : ''}://localhost:${this.serverPort}/" + path + "?auth=${this.serverSecret}" + (query ? "&" + query : '')
|
|
824
|
+
}
|
|
820
825
|
`
|
|
821
826
|
|
|
822
827
|
if (this.serverPort) {
|
|
823
828
|
cmd += `\
|
|
824
|
-
webrtcperf.config.SAVE_MEDIA_URL = "ws
|
|
829
|
+
webrtcperf.config.SAVE_MEDIA_URL = webrtcperf_getServerUrl("", "ws", "action=write-stream");
|
|
825
830
|
`
|
|
826
831
|
if (this.mediaPath?.mp4 && !this.useFakeMedia) {
|
|
827
832
|
cmd += `\
|
|
828
|
-
webrtcperf.config.
|
|
829
|
-
webrtcperf.config.AUDIO_URL = "http${this.serverUseHttps ? 's' : ''}://localhost:${this.serverPort}/cache/${path.basename(this.mediaPath.m4a)}?auth=${this.serverSecret}";
|
|
833
|
+
webrtcperf.config.MEDIA_URL = webrtcperf_getServerUrl("cache/${path.basename(this.mediaPath.mp4)}");
|
|
830
834
|
`
|
|
831
835
|
}
|
|
832
836
|
}
|
|
@@ -1710,6 +1714,7 @@ mv ${logFilePath}.tmp ${logFilePath};
|
|
|
1710
1714
|
const pageCpu: Record<string, number> = {}
|
|
1711
1715
|
const pageMemory: Record<string, number> = {}
|
|
1712
1716
|
const cpuPressureStats: Record<string, number> = {}
|
|
1717
|
+
const questionAnswerDelayStats: Record<string, number> = {}
|
|
1713
1718
|
|
|
1714
1719
|
const videoWidth: Record<string, number> = {}
|
|
1715
1720
|
const videoHeight: Record<string, number> = {}
|
|
@@ -1738,6 +1743,7 @@ mv ${logFilePath}.tmp ${logFilePath};
|
|
|
1738
1743
|
audioEndToEndDelay,
|
|
1739
1744
|
videoEndToEndDelay,
|
|
1740
1745
|
cpuPressure,
|
|
1746
|
+
questionAnswerDelay,
|
|
1741
1747
|
videoStats,
|
|
1742
1748
|
customMetrics,
|
|
1743
1749
|
} = await page.evaluate(async () => ({
|
|
@@ -1745,6 +1751,7 @@ mv ${logFilePath}.tmp ${logFilePath};
|
|
|
1745
1751
|
audioEndToEndDelay: webrtcperf.collectAudioEndToEndStats(),
|
|
1746
1752
|
videoEndToEndDelay: webrtcperf.collectVideoEndToEndStats(),
|
|
1747
1753
|
cpuPressure: webrtcperf.collectCpuPressure(),
|
|
1754
|
+
questionAnswerDelay: webrtcperf.collectQuestionAnswerDelay(),
|
|
1748
1755
|
videoStats: webrtcperf.collectVideoStats(),
|
|
1749
1756
|
customMetrics: 'collectCustomMetrics' in window ? collectCustomMetrics() : null,
|
|
1750
1757
|
}))
|
|
@@ -1811,6 +1818,7 @@ mv ${logFilePath}.tmp ${logFilePath};
|
|
|
1811
1818
|
}
|
|
1812
1819
|
|
|
1813
1820
|
if (cpuPressure !== undefined) cpuPressureStats[pageKey] = cpuPressure
|
|
1821
|
+
if (questionAnswerDelay !== undefined) questionAnswerDelayStats[pageKey] = questionAnswerDelay
|
|
1814
1822
|
if (videoStats) {
|
|
1815
1823
|
videoWidth[pageKey] = videoStats.width
|
|
1816
1824
|
videoHeight[pageKey] = videoStats.height
|
|
@@ -1912,6 +1920,7 @@ mv ${logFilePath}.tmp ${logFilePath};
|
|
|
1912
1920
|
wsRecvBytes: wsRecvBytesStats,
|
|
1913
1921
|
wsRecvLatency: wsRecvLatencyStats,
|
|
1914
1922
|
cpuPressure: cpuPressureStats,
|
|
1923
|
+
questionAnswerDelay: questionAnswerDelayStats,
|
|
1915
1924
|
videoWidth,
|
|
1916
1925
|
videoHeight,
|
|
1917
1926
|
videoBufferedTime,
|