@vforsh/argus-watcher 0.5.2 → 0.5.4
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/dist/.tsbuildinfo +1 -1
- package/dist/cdp/ffmpeg.d.ts +22 -6
- package/dist/cdp/ffmpeg.d.ts.map +1 -1
- package/dist/cdp/ffmpeg.js +90 -30
- package/dist/cdp/ffmpeg.js.map +1 -1
- package/dist/cdp/recording.d.ts +3 -1
- package/dist/cdp/recording.d.ts.map +1 -1
- package/dist/cdp/recording.js +237 -132
- package/dist/cdp/recording.js.map +1 -1
- package/dist/cdp/recordingSession.d.ts +97 -0
- package/dist/cdp/recordingSession.d.ts.map +1 -0
- package/dist/cdp/recordingSession.js +157 -0
- package/dist/cdp/recordingSession.js.map +1 -0
- package/dist/cdp/scenarioBridge.d.ts +2 -0
- package/dist/cdp/scenarioBridge.d.ts.map +1 -1
- package/dist/cdp/scenarioBridge.js +49 -3
- package/dist/cdp/scenarioBridge.js.map +1 -1
- package/dist/cdp/screenshot.d.ts.map +1 -1
- package/dist/cdp/screenshot.js +3 -2
- package/dist/cdp/screenshot.js.map +1 -1
- package/dist/cdp/visualCapture.d.ts +20 -0
- package/dist/cdp/visualCapture.d.ts.map +1 -1
- package/dist/cdp/visualCapture.js +53 -42
- package/dist/cdp/visualCapture.js.map +1 -1
- package/dist/http/endpoints.d.ts +1 -1
- package/dist/http/endpoints.d.ts.map +1 -1
- package/dist/http/endpoints.js +1 -0
- package/dist/http/endpoints.js.map +1 -1
- package/dist/http/routes/getStatus.js +1 -0
- package/dist/http/routes/getStatus.js.map +1 -1
- package/dist/http/routes/postEval.d.ts.map +1 -1
- package/dist/http/routes/postEval.js +1 -0
- package/dist/http/routes/postEval.js.map +1 -1
- package/dist/http/routes/postRecord.d.ts.map +1 -1
- package/dist/http/routes/postRecord.js +9 -0
- package/dist/http/routes/postRecord.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/dist/sourcemaps/scriptFetcher.d.ts +27 -0
- package/dist/sourcemaps/scriptFetcher.d.ts.map +1 -0
- package/dist/sourcemaps/scriptFetcher.js +69 -0
- package/dist/sourcemaps/scriptFetcher.js.map +1 -0
- package/dist/sourcemaps/sourcemapResolver.d.ts +4 -1
- package/dist/sourcemaps/sourcemapResolver.d.ts.map +1 -1
- package/dist/sourcemaps/sourcemapResolver.js +5 -14
- package/dist/sourcemaps/sourcemapResolver.js.map +1 -1
- package/package.json +1 -1
package/dist/cdp/ffmpeg.d.ts
CHANGED
|
@@ -4,16 +4,19 @@ import type { RecordFormat } from '@vforsh/argus-core';
|
|
|
4
4
|
import type { VisualCaptureClip, VisualCaptureViewport } from './visualCapture.js';
|
|
5
5
|
/**
|
|
6
6
|
* The ffmpeg side of screen recording: spawning the encoder, building its arguments, and reading
|
|
7
|
-
* the
|
|
7
|
+
* the frame headers that size its filter graph.
|
|
8
8
|
*
|
|
9
9
|
* Split out of `recording.ts` because none of it touches CDP — the recorder pipes frames into a
|
|
10
10
|
* child process, and that process's argument construction, stderr ring, and ENOENT phrasing are a
|
|
11
11
|
* separate concern from screencast frame pacing.
|
|
12
12
|
*/
|
|
13
|
-
/**
|
|
14
|
-
export type
|
|
13
|
+
/** Wire format of the screencast frames piped into ffmpeg. */
|
|
14
|
+
export type FrameCodec = 'png' | 'jpeg';
|
|
15
|
+
/** Dimensions and encoding read from a screencast frame. */
|
|
16
|
+
export type FrameInfo = {
|
|
15
17
|
width: number;
|
|
16
18
|
height: number;
|
|
19
|
+
codec: FrameCodec;
|
|
17
20
|
};
|
|
18
21
|
type FfmpegChild = ChildProcessByStdio<Writable, null, Readable>;
|
|
19
22
|
/** A running ffmpeg encoder and a promise for its exit. */
|
|
@@ -22,16 +25,29 @@ export type FfmpegProcess = {
|
|
|
22
25
|
/** Resolves on a clean exit; rejects with the tail of stderr otherwise. */
|
|
23
26
|
completion: Promise<void>;
|
|
24
27
|
};
|
|
25
|
-
/** Spawn ffmpeg to encode a
|
|
28
|
+
/** Spawn ffmpeg to encode a screencast frame stream, resolving once the child has actually spawned. */
|
|
26
29
|
export declare const startFfmpeg: (options: {
|
|
27
30
|
absolutePath: string;
|
|
28
31
|
fps: number;
|
|
29
32
|
format: RecordFormat;
|
|
30
33
|
clip: VisualCaptureClip | undefined;
|
|
31
34
|
viewport: VisualCaptureViewport | undefined;
|
|
32
|
-
|
|
35
|
+
frame: FrameInfo;
|
|
33
36
|
}) => Promise<FfmpegProcess>;
|
|
34
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Read the encoding and pixel dimensions of a screencast frame.
|
|
39
|
+
*
|
|
40
|
+
* The codec is *detected*, never assumed from the `Page.startScreencast` request: ffmpeg is told
|
|
41
|
+
* up front which decoder sits on the pipe, and if that disagrees with the bytes it gets, every
|
|
42
|
+
* frame fails to decode and the encode dies with an empty file. Chrome is not the only producer
|
|
43
|
+
* here — test fakes and future capture paths feed this too — so the frames are the authority.
|
|
44
|
+
*
|
|
45
|
+
* The size matters because a CSS-pixel crop rectangle has to be translated into encoder
|
|
46
|
+
* coordinates, and the screencast reports no device pixel ratio worth trusting across DPR changes.
|
|
47
|
+
*
|
|
48
|
+
* @throws {Error} When the buffer is not a recognizable PNG or JPEG.
|
|
49
|
+
*/
|
|
50
|
+
export declare const readFrameInfo: (buffer: Buffer) => FrameInfo;
|
|
35
51
|
export declare const formatFfmpegError: (error: unknown) => Error;
|
|
36
52
|
export {};
|
|
37
53
|
//# sourceMappingURL=ffmpeg.d.ts.map
|
package/dist/cdp/ffmpeg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpeg.d.ts","sourceRoot":"","sources":["../../src/cdp/ffmpeg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAA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AC3C,KAAK,EAAE,SAAS,CAAA;CAChB,KAAG,OAAO,CAAC,aAAa,CA8CxB,CAAA;AAqDD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,SAW9C,CAAA;AAsDD,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,KAMlD,CAAA"}
|
package/dist/cdp/ffmpeg.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
/** Spawn ffmpeg to encode a
|
|
2
|
+
/** Spawn ffmpeg to encode a screencast frame stream, resolving once the child has actually spawned. */
|
|
3
3
|
export const startFfmpeg = async (options) => {
|
|
4
4
|
const ffmpeg = process.env.ARGUS_FFMPEG?.trim() || 'ffmpeg';
|
|
5
|
-
const filter = buildVideoFilter(options);
|
|
6
5
|
const args = [
|
|
7
6
|
'-hide_banner',
|
|
8
7
|
'-loglevel',
|
|
@@ -12,12 +11,12 @@ export const startFfmpeg = async (options) => {
|
|
|
12
11
|
'-framerate',
|
|
13
12
|
String(options.fps),
|
|
14
13
|
'-vcodec',
|
|
15
|
-
'png',
|
|
14
|
+
options.frame.codec === 'jpeg' ? 'mjpeg' : 'png',
|
|
16
15
|
'-i',
|
|
17
16
|
'pipe:0',
|
|
18
17
|
'-an',
|
|
19
18
|
'-vf',
|
|
20
|
-
|
|
19
|
+
buildVideoFilter(options),
|
|
21
20
|
...buildEncoderArgs(options.format),
|
|
22
21
|
'-y',
|
|
23
22
|
options.absolutePath,
|
|
@@ -46,43 +45,104 @@ export const startFfmpeg = async (options) => {
|
|
|
46
45
|
return { child, completion };
|
|
47
46
|
};
|
|
48
47
|
const buildVideoFilter = (options) => {
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const geometry = options.clip ? buildCropFilter(options.clip, options.viewport, options.frame) : 'scale=trunc(iw/2)*2:trunc(ih/2)*2';
|
|
49
|
+
if (options.format !== 'gif') {
|
|
50
|
+
return `${geometry},format=yuv420p`;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* One-pass palette generation, because the frames arrive on a pipe.
|
|
54
|
+
*
|
|
55
|
+
* The usual high-quality GIF recipe runs `palettegen` over the whole file and only then
|
|
56
|
+
* `paletteuse`, which needs two passes over a seekable input. A live screencast has neither,
|
|
57
|
+
* so this builds a palette per frame (`stats_mode=single`) and tells `paletteuse` to expect a
|
|
58
|
+
* new one each time (`new=1`). Slightly larger files than a global palette, no second pass,
|
|
59
|
+
* and no banding on the gradients that make up most app UI.
|
|
60
|
+
*/
|
|
61
|
+
return `${geometry},split[gifsrc][gifpal];[gifpal]palettegen=stats_mode=single[pal];[gifsrc][pal]paletteuse=new=1:dither=sierra2_4a`;
|
|
62
|
+
};
|
|
63
|
+
const buildCropFilter = (clip, viewport, frameSize) => {
|
|
64
|
+
if (!viewport) {
|
|
53
65
|
throw new Error('Unable to compute viewport size for recording crop');
|
|
54
66
|
}
|
|
55
|
-
const ratioX =
|
|
56
|
-
const ratioY =
|
|
57
|
-
const x = clampEven(
|
|
58
|
-
const y = clampEven(
|
|
59
|
-
const width = clampEven(
|
|
60
|
-
const height = clampEven(
|
|
61
|
-
return `crop=${width}:${height}:${x}:${y}
|
|
67
|
+
const ratioX = frameSize.width / viewport.width;
|
|
68
|
+
const ratioY = frameSize.height / viewport.height;
|
|
69
|
+
const x = clampEven(clip.x * ratioX, 0, frameSize.width - 2);
|
|
70
|
+
const y = clampEven(clip.y * ratioY, 0, frameSize.height - 2);
|
|
71
|
+
const width = clampEven(clip.width * ratioX, 2, frameSize.width - x);
|
|
72
|
+
const height = clampEven(clip.height * ratioY, 2, frameSize.height - y);
|
|
73
|
+
return `crop=${width}:${height}:${x}:${y}`;
|
|
62
74
|
};
|
|
63
75
|
const buildEncoderArgs = (format) => {
|
|
76
|
+
if (format === 'gif') {
|
|
77
|
+
return ['-loop', '0', '-f', 'gif'];
|
|
78
|
+
}
|
|
64
79
|
if (format === 'webm') {
|
|
65
|
-
|
|
80
|
+
// VP9 at constant quality: the old flat 1M VP8 bitrate smeared any 2x-DPR canvas.
|
|
81
|
+
return ['-c:v', 'libvpx-vp9', '-deadline', 'realtime', '-cpu-used', '5', '-crf', '32', '-b:v', '0', '-row-mt', '1', '-f', 'webm'];
|
|
66
82
|
}
|
|
67
83
|
// yuv420p + H.264 keeps files playable in Finder, QuickTime, iOS Photos, Slack, and browsers.
|
|
68
84
|
return ['-c:v', 'libx264', '-preset', 'veryfast', '-crf', '23', '-movflags', '+faststart', '-f', 'mp4'];
|
|
69
85
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Read the encoding and pixel dimensions of a screencast frame.
|
|
88
|
+
*
|
|
89
|
+
* The codec is *detected*, never assumed from the `Page.startScreencast` request: ffmpeg is told
|
|
90
|
+
* up front which decoder sits on the pipe, and if that disagrees with the bytes it gets, every
|
|
91
|
+
* frame fails to decode and the encode dies with an empty file. Chrome is not the only producer
|
|
92
|
+
* here — test fakes and future capture paths feed this too — so the frames are the authority.
|
|
93
|
+
*
|
|
94
|
+
* The size matters because a CSS-pixel crop rectangle has to be translated into encoder
|
|
95
|
+
* coordinates, and the screencast reports no device pixel ratio worth trusting across DPR changes.
|
|
96
|
+
*
|
|
97
|
+
* @throws {Error} When the buffer is not a recognizable PNG or JPEG.
|
|
98
|
+
*/
|
|
99
|
+
export const readFrameInfo = (buffer) => {
|
|
100
|
+
if (isPng(buffer)) {
|
|
101
|
+
return { width: buffer.readUInt32BE(16), height: buffer.readUInt32BE(20), codec: 'png' };
|
|
102
|
+
}
|
|
103
|
+
const jpegSize = readJpegSize(buffer);
|
|
104
|
+
if (jpegSize) {
|
|
105
|
+
return { ...jpegSize, codec: 'jpeg' };
|
|
106
|
+
}
|
|
107
|
+
throw new Error('Expected a PNG or JPEG screencast frame');
|
|
108
|
+
};
|
|
109
|
+
const isPng = (buffer) => buffer.length >= 24 &&
|
|
110
|
+
buffer[0] === 0x89 &&
|
|
111
|
+
buffer[1] === 0x50 &&
|
|
112
|
+
buffer[2] === 0x4e &&
|
|
113
|
+
buffer[3] === 0x47 &&
|
|
114
|
+
buffer[4] === 0x0d &&
|
|
115
|
+
buffer[5] === 0x0a &&
|
|
116
|
+
buffer[6] === 0x1a &&
|
|
117
|
+
buffer[7] === 0x0a;
|
|
118
|
+
/** Frame-header markers (SOF0-SOF15) that carry dimensions, minus the four that are not frame headers. */
|
|
119
|
+
const JPEG_NON_SOF_MARKERS = new Set([0xc4, 0xc8, 0xcc]);
|
|
120
|
+
const readJpegSize = (buffer) => {
|
|
121
|
+
if (buffer.length < 4 || buffer[0] !== 0xff || buffer[1] !== 0xd8) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
let offset = 2;
|
|
125
|
+
while (offset + 3 < buffer.length) {
|
|
126
|
+
if (buffer[offset] !== 0xff) {
|
|
127
|
+
offset += 1;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
const marker = buffer[offset + 1];
|
|
131
|
+
// Padding fill bytes and the standalone markers carry no length field.
|
|
132
|
+
if (marker === 0xff || marker === 0x01 || (marker >= 0xd0 && marker <= 0xd9)) {
|
|
133
|
+
offset += 2;
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const segmentLength = buffer.readUInt16BE(offset + 2);
|
|
137
|
+
if (marker >= 0xc0 && marker <= 0xcf && !JPEG_NON_SOF_MARKERS.has(marker)) {
|
|
138
|
+
if (offset + 9 > buffer.length) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
return { width: buffer.readUInt16BE(offset + 7), height: buffer.readUInt16BE(offset + 5) };
|
|
142
|
+
}
|
|
143
|
+
offset += 2 + segmentLength;
|
|
81
144
|
}
|
|
82
|
-
return
|
|
83
|
-
width: buffer.readUInt32BE(16),
|
|
84
|
-
height: buffer.readUInt32BE(20),
|
|
85
|
-
};
|
|
145
|
+
return null;
|
|
86
146
|
};
|
|
87
147
|
const clampEven = (value, min, max) => {
|
|
88
148
|
const clamped = Math.min(max, Math.max(min, Math.floor(value)));
|
package/dist/cdp/ffmpeg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpeg.js","sourceRoot":"","sources":["../../src/cdp/ffmpeg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA4B,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"ffmpeg.js","sourceRoot":"","sources":["../../src/cdp/ffmpeg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA4B,MAAM,oBAAoB,CAAA;AA6BpE,uGAAuG;AACvG,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,OAOjC,EAA0B,EAAE;IAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,QAAQ,CAAA;IAC3D,MAAM,IAAI,GAAG;QACZ,cAAc;QACd,WAAW;QACX,OAAO;QACP,IAAI;QACJ,YAAY;QACZ,YAAY;QACZ,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;QACnB,SAAS;QACT,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;QAChD,IAAI;QACJ,QAAQ;QACR,KAAK;QACL,KAAK;QACL,gBAAgB,CAAC,OAAO,CAAC;QACzB,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC;QACnC,IAAI;QACJ,OAAO,CAAC,YAAY;KACpB,CAAA;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,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AAwE,CAAC,CAAA;IAC3F,CAAC;IACD,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACjE,CAAC,CAAA"}
|
package/dist/cdp/recording.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { RecordRequest, RecordStartRequest, RecordStartResponse, RecordStopRequest, RecordStopResponse } from '@vforsh/argus-core';
|
|
1
|
+
import type { RecordRequest, RecordStartRequest, RecordStartResponse, RecordStatusSummary, RecordStopRequest, RecordStopResponse } from '@vforsh/argus-core';
|
|
2
2
|
import type { CdpSessionHandle } from './connection.js';
|
|
3
3
|
export type Recorder = {
|
|
4
4
|
capture: (request: RecordRequest) => Promise<RecordStopResponse>;
|
|
5
5
|
start: (request: RecordStartRequest) => Promise<RecordStartResponse>;
|
|
6
6
|
stop: (request: RecordStopRequest) => Promise<RecordStopResponse>;
|
|
7
|
+
/** Live recording summary, or `null` when nothing is recording. */
|
|
8
|
+
status: () => RecordStatusSummary | null;
|
|
7
9
|
onDetached: (reason?: string) => void;
|
|
8
10
|
};
|
|
9
11
|
export declare const createRecorder: (options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../src/cdp/recording.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../src/cdp/recording.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEX,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EAEnB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAgCvD,MAAM,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAChE,KAAK,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACpE,IAAI,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAA;IACjE,mEAAmE;IACnE,MAAM,EAAE,MAAM,mBAAmB,GAAG,IAAI,CAAA;IACxC,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,SAAS;IACvC,OAAO,EAAE,gBAAgB,CAAA;IACzB,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,sBAAsB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CACrD,KAAG,QAgSH,CAAA"}
|