@camstack/addon-pipeline 1.1.28 → 1.1.30
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/audio-analyzer/index.js +1 -1
- package/dist/audio-analyzer/index.mjs +1 -1
- package/dist/audio-codec-ffmpeg/index.js +1 -5
- package/dist/audio-codec-ffmpeg/index.mjs +1 -5
- package/dist/decoder-ffmpeg/index.js +102 -352
- package/dist/decoder-ffmpeg/index.mjs +82 -332
- package/dist/decoder-nodeav/index.js +6 -4
- package/dist/decoder-nodeav/index.mjs +6 -4
- package/dist/detection-pipeline/index.js +254 -186
- package/dist/detection-pipeline/index.mjs +254 -186
- package/dist/{dist-Biq62zt4.js → dist-Cwc0TUQr.js} +7 -42
- package/dist/{dist-C6_wgXqF.mjs → dist-DjuGmyG9.mjs} +7 -42
- package/dist/ffmpeg-args-C5GPp8Cw.mjs +323 -0
- package/dist/ffmpeg-args-D6h1edXK.js +418 -0
- package/dist/frame-dropper-AjheBGMG.mjs +22 -0
- package/dist/frame-dropper-DKLM6pMz.js +27 -0
- package/dist/{frame-handle-plane-BIoY6nRV.mjs → frame-handle-plane-Bkxz-TTD.mjs} +1 -1
- package/dist/{frame-handle-plane-D6BzyEgy.js → frame-handle-plane-DQNCTrpC.js} +1 -1
- package/dist/{frame-ring-sink-9J0wCdLF.js → frame-ring-sink-8LLV-cvH.js} +1 -1
- package/dist/{frame-ring-sink-Cs9vby6v.mjs → frame-ring-sink-ClEWjiRU.mjs} +1 -1
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +2 -2
- package/dist/pipeline-runner/index.mjs +2 -2
- package/dist/recorder/index.js +1 -1
- package/dist/recorder/index.mjs +1 -1
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DoReAb4y.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-D567z31g.mjs} +3 -3
- package/dist/stream-broker/{hostInit-C0SuwQhL.mjs → hostInit-B_b3PIZB.mjs} +3 -3
- package/dist/stream-broker/index.js +168 -121
- package/dist/stream-broker/index.mjs +159 -112
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-Br2yi8ah.js → MaskShapeCanvas-DI4BY7W2-x-DZOuQL.js} +1 -1
- package/embed-dist/assets/{MotionZonesSettings-NcxxQN8r-BSCcPdPf.js → MotionZonesSettings-NcxxQN8r-DTeuDGCU.js} +1 -1
- package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-ztxvxSjS.js → PrivacyMaskSettings-APgPLF7p-CirtxO3e.js} +1 -1
- package/embed-dist/assets/{index-CeZV1B-2.js → index-CpUy8OIE.js} +9 -9
- package/embed-dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/frame-dropper-7RTo_YyG.js +0 -68
- package/dist/frame-dropper-CwkBTPGV.mjs +0 -51
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
//#region src/stream-broker/stream-broker/ffmpeg-args-common.ts
|
|
2
|
+
var AUDIO_ENCODER_BY_CODEC = {
|
|
3
|
+
opus: "libopus",
|
|
4
|
+
aac: "aac",
|
|
5
|
+
pcmu: "pcm_mulaw",
|
|
6
|
+
pcma: "pcm_alaw",
|
|
7
|
+
copy: "copy"
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Build the audio-encode args `-c:a <enc> [-b:a Nk] [-ar N] [-ac N]`. Each knob
|
|
11
|
+
* is emitted only when provided, in this fixed order — matching what every
|
|
12
|
+
* broker site already emitted by hand.
|
|
13
|
+
*/
|
|
14
|
+
function audioEncoderArgs(codec, opts = {}) {
|
|
15
|
+
const args = ["-c:a", AUDIO_ENCODER_BY_CODEC[codec]];
|
|
16
|
+
if (opts.bitrateKbps !== void 0) args.push("-b:a", `${opts.bitrateKbps}k`);
|
|
17
|
+
if (opts.sampleRateHz !== void 0) args.push("-ar", String(opts.sampleRateHz));
|
|
18
|
+
if (opts.channels !== void 0) args.push("-ac", String(opts.channels));
|
|
19
|
+
return args;
|
|
20
|
+
}
|
|
21
|
+
/** The `-hide_banner -loglevel <level>` preamble every broker ffmpeg site opens with. */
|
|
22
|
+
function logBannerArgs(level) {
|
|
23
|
+
return [
|
|
24
|
+
"-hide_banner",
|
|
25
|
+
"-loglevel",
|
|
26
|
+
level
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/decoder-ffmpeg/ffmpeg-args.ts
|
|
31
|
+
/**
|
|
32
|
+
* Pure, side-effect-free ffmpeg argument construction for the
|
|
33
|
+
* `decoder-ffmpeg` addon.
|
|
34
|
+
*
|
|
35
|
+
* The addon decodes video in an **ffmpeg subprocess** (unlike `decoder-nodeav`
|
|
36
|
+
* which decodes in-process via node-av's native bindings). On the Intel hub,
|
|
37
|
+
* node-av's VA-API decode path SIGBUSes (uncatchable) on 8MP h264 and takes the
|
|
38
|
+
* whole decoder runner down; ffmpeg-as-subprocess decodes the same hardware
|
|
39
|
+
* cleanly because a crash is isolated to the child process.
|
|
40
|
+
*
|
|
41
|
+
* These helpers are extracted from the session so the argument shape is
|
|
42
|
+
* unit-testable without spawning a real ffmpeg binary.
|
|
43
|
+
*
|
|
44
|
+
* Validated working command on the Intel hub (renderD128, 8MP h264, ~50fps,
|
|
45
|
+
* exit 0):
|
|
46
|
+
*
|
|
47
|
+
* ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
|
|
48
|
+
* -hwaccel_output_format vaapi -f h264 -i <in> \
|
|
49
|
+
* -vf hwdownload,format=nv12,scale=640:360,format=gray \
|
|
50
|
+
* -f rawvideo -y /dev/null
|
|
51
|
+
*/
|
|
52
|
+
/** Default DRM render node used for the VA-API / QSV hardware decode path. */
|
|
53
|
+
var DEFAULT_VAAPI_RENDER_DEVICE = "/dev/dri/renderD128";
|
|
54
|
+
/** Whether a resolved hwaccel value means "decode in software" (no `-hwaccel`). */
|
|
55
|
+
function isSoftwareHwAccel(hwaccel) {
|
|
56
|
+
return hwaccel === null || hwaccel === "" || hwaccel === "none";
|
|
57
|
+
}
|
|
58
|
+
/** Backends whose decoded frames stay on the GPU and need an explicit
|
|
59
|
+
* `-hwaccel_output_format <m>` + `hwdownload,format=nv12` chain. */
|
|
60
|
+
function needsHwDownload(hwaccel) {
|
|
61
|
+
return hwaccel === "vaapi" || hwaccel === "qsv";
|
|
62
|
+
}
|
|
63
|
+
/** Decode backend → its GPU scaler filter. */
|
|
64
|
+
var GPU_SCALE_FILTER_BY_BACKEND = {
|
|
65
|
+
vaapi: "scale_vaapi",
|
|
66
|
+
qsv: "scale_qsv",
|
|
67
|
+
videotoolbox: "scale_vt"
|
|
68
|
+
};
|
|
69
|
+
/** Every GPU scaler this addon knows how to drive — used to scan `-filters`. */
|
|
70
|
+
var KNOWN_GPU_SCALE_FILTERS = [
|
|
71
|
+
"scale_vaapi",
|
|
72
|
+
"scale_qsv",
|
|
73
|
+
"scale_vt"
|
|
74
|
+
];
|
|
75
|
+
/**
|
|
76
|
+
* The GPU scaler that pairs with a decode backend, ignoring build support — a
|
|
77
|
+
* static hwaccel → filter map. Returns null for software / a backend with no
|
|
78
|
+
* GPU scaler (e.g. `cuda`, `drm`). Case-insensitive.
|
|
79
|
+
*/
|
|
80
|
+
function gpuScaleFilterForBackend(hwaccel) {
|
|
81
|
+
if (hwaccel === null) return null;
|
|
82
|
+
return GPU_SCALE_FILTER_BY_BACKEND[hwaccel.toLowerCase()] ?? null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Resolve the GPU scaler to use for a decode backend GIVEN the filters the
|
|
86
|
+
* configured ffmpeg build actually offers ({@link parseAvailableGpuScaleFilters}).
|
|
87
|
+
* Returns the filter when the backend maps to one AND the build has it; null
|
|
88
|
+
* otherwise — the caller then emits the CPU-scale chain (graceful fallback).
|
|
89
|
+
*/
|
|
90
|
+
function resolveGpuScaleFilter(hwaccel, availableFilters) {
|
|
91
|
+
const filter = gpuScaleFilterForBackend(hwaccel);
|
|
92
|
+
if (filter === null) return null;
|
|
93
|
+
return availableFilters.has(filter) ? filter : null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse `ffmpeg -filters` stdout into the set of {@link KNOWN_GPU_SCALE_FILTERS}
|
|
97
|
+
* the build offers. Matches whole filter tokens (word-boundary) so the plain
|
|
98
|
+
* `scale` filter is never mistaken for a GPU scaler. PURE — the spawn lives in
|
|
99
|
+
* the addon; only the parse is here so it is unit-tested.
|
|
100
|
+
*/
|
|
101
|
+
function parseAvailableGpuScaleFilters(filtersStdout) {
|
|
102
|
+
const present = /* @__PURE__ */ new Set();
|
|
103
|
+
for (const filter of KNOWN_GPU_SCALE_FILTERS) if (new RegExp(`\\b${filter}\\b`).test(filtersStdout)) present.add(filter);
|
|
104
|
+
return present;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Whether the decode keeps frames on the GPU — needs `-hwaccel_output_format`
|
|
108
|
+
* and an `hwdownload` in the filtergraph. VA-API / QSV always do (their decoded
|
|
109
|
+
* surfaces live on the GPU); another backend only when a GPU scaler will run on
|
|
110
|
+
* those surfaces (e.g. `videotoolbox` + `scale_vt`).
|
|
111
|
+
*/
|
|
112
|
+
function keepFramesOnGpu(hwaccel, gpuScaleFilter) {
|
|
113
|
+
return needsHwDownload(hwaccel) || gpuScaleFilter !== null;
|
|
114
|
+
}
|
|
115
|
+
/** Map a cap codec string to the ffmpeg `-f` input demuxer/format. */
|
|
116
|
+
function codecToInputFormat(codec) {
|
|
117
|
+
switch (codec.toLowerCase()) {
|
|
118
|
+
case "h265":
|
|
119
|
+
case "hevc": return "hevc";
|
|
120
|
+
default: return "h264";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Map the cap-level output format to a raw ffmpeg pixel format. */
|
|
124
|
+
function rawPixelForFormat(outputFormat) {
|
|
125
|
+
return outputFormat === "gray" ? "gray" : "rgb24";
|
|
126
|
+
}
|
|
127
|
+
/** Packed bytes-per-pixel for a raw output format (rgb24 = 3, gray = 1). */
|
|
128
|
+
function channelsForPixel(pixel) {
|
|
129
|
+
return pixel === "gray" ? 1 : 3;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The maximum output width for a given `scale` divisor — matches the node-av
|
|
133
|
+
* scaler's `maxW = floor(640 / scale)` rule so both decoders produce
|
|
134
|
+
* comparably-sized frames for the motion / detection pipeline.
|
|
135
|
+
*/
|
|
136
|
+
function maxDecodeWidth(scale) {
|
|
137
|
+
return Math.max(2, Math.floor(640 / (scale > 1 ? scale : 1)));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Compute exact output geometry from a known source resolution — the node-av
|
|
141
|
+
* rule (`outWidth = min(srcW, floor(640/scale))`, `outHeight =
|
|
142
|
+
* round(outWidth*srcH/srcW)`). Provided for callers that DO know the source
|
|
143
|
+
* dimensions; the live broker path leaves them to ffmpeg (`-2` height).
|
|
144
|
+
*/
|
|
145
|
+
function computeOutputGeometry(srcWidth, srcHeight, scale) {
|
|
146
|
+
const width = Math.min(srcWidth, maxDecodeWidth(scale));
|
|
147
|
+
return {
|
|
148
|
+
width,
|
|
149
|
+
height: Math.round(width * srcHeight / srcWidth)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** Build the `-vf` filtergraph string for the requested hwaccel + pixel format. */
|
|
153
|
+
function buildVideoFilter(hwaccel, pixel, outWidth, outHeight, maxW, gpuScaleFilter) {
|
|
154
|
+
const exact = outWidth !== void 0 && outWidth > 0 && outHeight !== void 0 && outHeight > 0;
|
|
155
|
+
if (gpuScaleFilter !== null) return `${gpuScaleFilter}=${exact ? `w=${outWidth}:h=${outHeight}` : `w=min(iw\\,${maxW}):h=-2`},hwdownload,format=nv12,format=${pixel}`;
|
|
156
|
+
const scaleAndFormat = `scale=${exact ? `${outWidth}:${outHeight}` : `min(iw\\,${maxW}):-2`},format=${pixel}`;
|
|
157
|
+
return needsHwDownload(hwaccel) ? `hwdownload,format=nv12,${scaleAndFormat}` : scaleAndFormat;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Build the full ffmpeg argv for a decode session. PURE — no spawn, no env
|
|
161
|
+
* access — so the argument shape is asserted in unit tests.
|
|
162
|
+
*
|
|
163
|
+
* Notes:
|
|
164
|
+
* - `-loglevel info -nostats`: the session parses the muxer's `Output #0`
|
|
165
|
+
* stream line from stderr to learn the exact output W×H (the broker does not
|
|
166
|
+
* pass source geometry for the shm path). `-nostats` suppresses the periodic
|
|
167
|
+
* `frame= …` counter while keeping the one-shot Output block.
|
|
168
|
+
* - The input is `pipe:0` (Annex-B packets written to stdin) in push mode, or
|
|
169
|
+
* `options.inputUrl` (the owner's restream, dialed by ffmpeg itself —
|
|
170
|
+
* `-rtsp_transport tcp` for rtsp URLs) in pull mode; the output is raw video
|
|
171
|
+
* on `pipe:1` either way.
|
|
172
|
+
*/
|
|
173
|
+
function buildFfmpegDecodeArgs(config, options) {
|
|
174
|
+
const inputFormat = codecToInputFormat(config.codec);
|
|
175
|
+
const pixel = rawPixelForFormat(config.outputFormat);
|
|
176
|
+
const maxW = maxDecodeWidth(config.scale);
|
|
177
|
+
const { hwaccel } = options;
|
|
178
|
+
const gpuScaleFilter = options.gpuScaleFilter ?? null;
|
|
179
|
+
const vf = buildVideoFilter(hwaccel, pixel, options.outWidth, options.outHeight, maxW, gpuScaleFilter);
|
|
180
|
+
let hwaccelArgs;
|
|
181
|
+
if (isSoftwareHwAccel(hwaccel) || hwaccel === null) hwaccelArgs = [];
|
|
182
|
+
else {
|
|
183
|
+
hwaccelArgs = ["-hwaccel", hwaccel];
|
|
184
|
+
if (needsHwDownload(hwaccel)) hwaccelArgs.push("-hwaccel_device", options.renderDevice ?? "/dev/dri/renderD128");
|
|
185
|
+
if (keepFramesOnGpu(hwaccel, gpuScaleFilter)) hwaccelArgs.push("-hwaccel_output_format", hwaccel);
|
|
186
|
+
}
|
|
187
|
+
const inputArgs = options.inputUrl !== void 0 ? [
|
|
188
|
+
...options.inputUrl.startsWith("rtsp") ? ["-rtsp_transport", "tcp"] : [],
|
|
189
|
+
"-i",
|
|
190
|
+
options.inputUrl
|
|
191
|
+
] : [
|
|
192
|
+
"-f",
|
|
193
|
+
inputFormat,
|
|
194
|
+
"-i",
|
|
195
|
+
"pipe:0"
|
|
196
|
+
];
|
|
197
|
+
return [
|
|
198
|
+
...logBannerArgs("info"),
|
|
199
|
+
"-nostats",
|
|
200
|
+
"-fflags",
|
|
201
|
+
"+nobuffer+flush_packets",
|
|
202
|
+
"-flags",
|
|
203
|
+
"low_delay",
|
|
204
|
+
"-probesize",
|
|
205
|
+
"1M",
|
|
206
|
+
"-analyzeduration",
|
|
207
|
+
"0",
|
|
208
|
+
...hwaccelArgs,
|
|
209
|
+
...inputArgs,
|
|
210
|
+
"-vf",
|
|
211
|
+
vf,
|
|
212
|
+
"-f",
|
|
213
|
+
"rawvideo",
|
|
214
|
+
"-pix_fmt",
|
|
215
|
+
pixel,
|
|
216
|
+
"pipe:1"
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Parse the exact output geometry from ffmpeg's stderr. The muxer prints an
|
|
221
|
+
* `Output #0, rawvideo …` block whose `Stream #0:0: Video: rawvideo …, <fmt>,
|
|
222
|
+
* WIDTHxHEIGHT …` line carries the scaled dimensions. Gating on the `Output #`
|
|
223
|
+
* marker avoids picking up the INPUT stream's (source) resolution, which is
|
|
224
|
+
* printed earlier.
|
|
225
|
+
*
|
|
226
|
+
* Returns `null` until the Output block with a `WxH` token has been seen.
|
|
227
|
+
*/
|
|
228
|
+
function parseFfmpegOutputDims(stderr) {
|
|
229
|
+
const outputIdx = stderr.indexOf("Output #");
|
|
230
|
+
if (outputIdx < 0) return null;
|
|
231
|
+
const match = stderr.slice(outputIdx).match(/(\d{2,5})x(\d{2,5})/);
|
|
232
|
+
if (!match) return null;
|
|
233
|
+
const width = Number(match[1]);
|
|
234
|
+
const height = Number(match[2]);
|
|
235
|
+
if (!Number.isInteger(width) || !Number.isInteger(height) || width <= 0 || height <= 0) return null;
|
|
236
|
+
return {
|
|
237
|
+
width,
|
|
238
|
+
height
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Pick the first kernel-preferred `-hwaccel` method the configured ffmpeg build
|
|
243
|
+
* actually supports, or `null` (software) when it supports none. Mirrors the
|
|
244
|
+
* broker's `pickDecodeHwAccel` (`ffmpeg-invocation.ts`) so the decoder gates
|
|
245
|
+
* decode-hwaccel against the same probed evidence:
|
|
246
|
+
* - empty `preferred` → `null` (software);
|
|
247
|
+
* - empty `supportedMethods` (probe miss) → keep the top preference and let the
|
|
248
|
+
* session's per-child software fallback cover a genuine failure;
|
|
249
|
+
* - otherwise the first preference the build supports, or `null`.
|
|
250
|
+
*/
|
|
251
|
+
function pickDecodeHwAccel(preferred, supportedMethods) {
|
|
252
|
+
if (preferred.length === 0) return null;
|
|
253
|
+
if (supportedMethods.length === 0) return preferred[0] ?? null;
|
|
254
|
+
const supported = new Set(supportedMethods.map((m) => m.toLowerCase()));
|
|
255
|
+
return preferred.find((name) => supported.has(name.toLowerCase())) ?? null;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Canonical decode-hwaccel preference order for the ffmpeg-subprocess decoder.
|
|
259
|
+
*
|
|
260
|
+
* `vaapi` is ranked ABOVE `qsv` deliberately: on the Intel hub the `qsv` decode
|
|
261
|
+
* child exits early (`code=171`, no frames) while the `vaapi` path decodes 8MP
|
|
262
|
+
* h264 cleanly at ~50fps. The kernel probe (`resolveHwAccel`) tends to surface
|
|
263
|
+
* `qsv` first on Intel, so we re-rank its result through this table before
|
|
264
|
+
* building the attempt chain. `videotoolbox` leads for macOS; `cuda` / `nvdec`
|
|
265
|
+
* trail for NVIDIA. A method not listed here keeps its incoming relative order,
|
|
266
|
+
* placed AFTER every ranked one.
|
|
267
|
+
*/
|
|
268
|
+
var DECODE_HWACCEL_RANK = [
|
|
269
|
+
"videotoolbox",
|
|
270
|
+
"vaapi",
|
|
271
|
+
"qsv",
|
|
272
|
+
"cuda",
|
|
273
|
+
"nvdec",
|
|
274
|
+
"d3d11va",
|
|
275
|
+
"dxva2",
|
|
276
|
+
"amf",
|
|
277
|
+
"vdpau",
|
|
278
|
+
"drm"
|
|
279
|
+
];
|
|
280
|
+
/** Rank index for {@link DECODE_HWACCEL_RANK} — unranked methods sort last. */
|
|
281
|
+
function decodeHwAccelRankIndex(method) {
|
|
282
|
+
const idx = DECODE_HWACCEL_RANK.indexOf(method.toLowerCase());
|
|
283
|
+
return idx < 0 ? DECODE_HWACCEL_RANK.length : idx;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Build the ORDERED list of hardware `-hwaccel` methods to attempt for an
|
|
287
|
+
* `'auto'` decode session, best-first. The session walks this chain on an
|
|
288
|
+
* early-exit-with-no-frames and only falls to software once it is exhausted.
|
|
289
|
+
*
|
|
290
|
+
* Strategy:
|
|
291
|
+
* - Seed candidates from the kernel-preferred order UNION the canonical rank
|
|
292
|
+
* UNION the build's supported list, so a method the kernel omitted but the
|
|
293
|
+
* build supports (the Intel `vaapi` case — kernel surfaces only `qsv`) is
|
|
294
|
+
* still attempted.
|
|
295
|
+
* - When the build's supported-method list is known (non-empty), keep only
|
|
296
|
+
* methods it actually offers; on a probe miss (empty) keep just the kernel
|
|
297
|
+
* preferences (avoid blindly spawning every backend).
|
|
298
|
+
* - Re-rank the survivors by {@link DECODE_HWACCEL_RANK} so `vaapi` precedes
|
|
299
|
+
* `qsv`. A supported method not in the rank table keeps its position AFTER
|
|
300
|
+
* every ranked one (stable sort). Returns lowercased method names; empty ⇒
|
|
301
|
+
* pure software.
|
|
302
|
+
*/
|
|
303
|
+
function rankDecodeHwAccels(preferred, supportedMethods) {
|
|
304
|
+
const supported = new Set(supportedMethods.map((m) => m.toLowerCase()));
|
|
305
|
+
const hasSupportList = supported.size > 0;
|
|
306
|
+
const pool = hasSupportList ? [
|
|
307
|
+
...preferred,
|
|
308
|
+
...DECODE_HWACCEL_RANK,
|
|
309
|
+
...supportedMethods
|
|
310
|
+
] : [...preferred];
|
|
311
|
+
const seen = /* @__PURE__ */ new Set();
|
|
312
|
+
const candidates = [];
|
|
313
|
+
for (const raw of pool) {
|
|
314
|
+
const method = raw.toLowerCase();
|
|
315
|
+
if (seen.has(method)) continue;
|
|
316
|
+
seen.add(method);
|
|
317
|
+
if (hasSupportList && !supported.has(method)) continue;
|
|
318
|
+
candidates.push(method);
|
|
319
|
+
}
|
|
320
|
+
return candidates.sort((a, b) => decodeHwAccelRankIndex(a) - decodeHwAccelRankIndex(b));
|
|
321
|
+
}
|
|
322
|
+
//#endregion
|
|
323
|
+
Object.defineProperty(exports, "DECODE_HWACCEL_RANK", {
|
|
324
|
+
enumerable: true,
|
|
325
|
+
get: function() {
|
|
326
|
+
return DECODE_HWACCEL_RANK;
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
Object.defineProperty(exports, "DEFAULT_VAAPI_RENDER_DEVICE", {
|
|
330
|
+
enumerable: true,
|
|
331
|
+
get: function() {
|
|
332
|
+
return DEFAULT_VAAPI_RENDER_DEVICE;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
Object.defineProperty(exports, "audioEncoderArgs", {
|
|
336
|
+
enumerable: true,
|
|
337
|
+
get: function() {
|
|
338
|
+
return audioEncoderArgs;
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
Object.defineProperty(exports, "buildFfmpegDecodeArgs", {
|
|
342
|
+
enumerable: true,
|
|
343
|
+
get: function() {
|
|
344
|
+
return buildFfmpegDecodeArgs;
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
Object.defineProperty(exports, "channelsForPixel", {
|
|
348
|
+
enumerable: true,
|
|
349
|
+
get: function() {
|
|
350
|
+
return channelsForPixel;
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
Object.defineProperty(exports, "codecToInputFormat", {
|
|
354
|
+
enumerable: true,
|
|
355
|
+
get: function() {
|
|
356
|
+
return codecToInputFormat;
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
Object.defineProperty(exports, "computeOutputGeometry", {
|
|
360
|
+
enumerable: true,
|
|
361
|
+
get: function() {
|
|
362
|
+
return computeOutputGeometry;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
Object.defineProperty(exports, "isSoftwareHwAccel", {
|
|
366
|
+
enumerable: true,
|
|
367
|
+
get: function() {
|
|
368
|
+
return isSoftwareHwAccel;
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
Object.defineProperty(exports, "logBannerArgs", {
|
|
372
|
+
enumerable: true,
|
|
373
|
+
get: function() {
|
|
374
|
+
return logBannerArgs;
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
Object.defineProperty(exports, "maxDecodeWidth", {
|
|
378
|
+
enumerable: true,
|
|
379
|
+
get: function() {
|
|
380
|
+
return maxDecodeWidth;
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
Object.defineProperty(exports, "parseAvailableGpuScaleFilters", {
|
|
384
|
+
enumerable: true,
|
|
385
|
+
get: function() {
|
|
386
|
+
return parseAvailableGpuScaleFilters;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
Object.defineProperty(exports, "parseFfmpegOutputDims", {
|
|
390
|
+
enumerable: true,
|
|
391
|
+
get: function() {
|
|
392
|
+
return parseFfmpegOutputDims;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
Object.defineProperty(exports, "pickDecodeHwAccel", {
|
|
396
|
+
enumerable: true,
|
|
397
|
+
get: function() {
|
|
398
|
+
return pickDecodeHwAccel;
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
Object.defineProperty(exports, "rankDecodeHwAccels", {
|
|
402
|
+
enumerable: true,
|
|
403
|
+
get: function() {
|
|
404
|
+
return rankDecodeHwAccels;
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
Object.defineProperty(exports, "rawPixelForFormat", {
|
|
408
|
+
enumerable: true,
|
|
409
|
+
get: function() {
|
|
410
|
+
return rawPixelForFormat;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
Object.defineProperty(exports, "resolveGpuScaleFilter", {
|
|
414
|
+
enumerable: true,
|
|
415
|
+
get: function() {
|
|
416
|
+
return resolveGpuScaleFilter;
|
|
417
|
+
}
|
|
418
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/stream-broker/stream-broker/frame-dropper.ts
|
|
2
|
+
var FrameDropper = class {
|
|
3
|
+
intervalMs;
|
|
4
|
+
lastPassedAt = -Infinity;
|
|
5
|
+
constructor(maxFps) {
|
|
6
|
+
this.intervalMs = maxFps > 0 ? 1e3 / maxFps : 0;
|
|
7
|
+
}
|
|
8
|
+
shouldKeep() {
|
|
9
|
+
if (this.intervalMs === 0) return true;
|
|
10
|
+
const now = Date.now();
|
|
11
|
+
if (now - this.lastPassedAt >= this.intervalMs) {
|
|
12
|
+
this.lastPassedAt = now;
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
setMaxFps(maxFps) {
|
|
18
|
+
this.intervalMs = maxFps > 0 ? 1e3 / maxFps : 0;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { FrameDropper as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/stream-broker/stream-broker/frame-dropper.ts
|
|
2
|
+
var FrameDropper = class {
|
|
3
|
+
intervalMs;
|
|
4
|
+
lastPassedAt = -Infinity;
|
|
5
|
+
constructor(maxFps) {
|
|
6
|
+
this.intervalMs = maxFps > 0 ? 1e3 / maxFps : 0;
|
|
7
|
+
}
|
|
8
|
+
shouldKeep() {
|
|
9
|
+
if (this.intervalMs === 0) return true;
|
|
10
|
+
const now = Date.now();
|
|
11
|
+
if (now - this.lastPassedAt >= this.intervalMs) {
|
|
12
|
+
this.lastPassedAt = now;
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
setMaxFps(maxFps) {
|
|
18
|
+
this.intervalMs = maxFps > 0 ? 1e3 / maxFps : 0;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
Object.defineProperty(exports, "FrameDropper", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return FrameDropper;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-Cwc0TUQr.js");
|
|
2
2
|
let _camstack_shm_ring = require("@camstack/shm-ring");
|
|
3
3
|
//#region src/shared/decoder-backend-keys.ts
|
|
4
4
|
/** Built-in default when a node has no selection — the subprocess decoder. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as RingBuffer } from "./dist-
|
|
1
|
+
import { p as RingBuffer } from "./dist-DjuGmyG9.mjs";
|
|
2
2
|
import { FrameRingWriter, MIN_RING_SLOTS, computeSegmentSize, computeSlotByteLength, createSegment, deriveSlotCount } from "@camstack/shm-ring";
|
|
3
3
|
//#region src/shared/decoder-backend-keys.ts
|
|
4
4
|
/** Built-in default when a node has no selection — the subprocess decoder. */
|
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
5
|
+
const require_dist = require("../dist-Cwc0TUQr.js");
|
|
6
6
|
let _camstack_shm_ring = require("@camstack/shm-ring");
|
|
7
7
|
let node_fs = require("node:fs");
|
|
8
8
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as motionDetectionCapability, T as evaluateZoneRules, V as BaseAddon, W as DeviceType, q as hydrateSchema } from "../dist-
|
|
1
|
+
import { A as motionDetectionCapability, T as evaluateZoneRules, V as BaseAddon, W as DeviceType, q as hydrateSchema } from "../dist-DjuGmyG9.mjs";
|
|
2
2
|
import { FrameRingReaderCache } from "@camstack/shm-ring";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -2,8 +2,8 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_dist = require("../dist-
|
|
6
|
-
const require_frame_handle_plane = require("../frame-handle-plane-
|
|
5
|
+
const require_dist = require("../dist-Cwc0TUQr.js");
|
|
6
|
+
const require_frame_handle_plane = require("../frame-handle-plane-DQNCTrpC.js");
|
|
7
7
|
const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
|
|
8
8
|
let _camstack_shm_ring = require("@camstack/shm-ring");
|
|
9
9
|
//#region src/pipeline-runner/bench-actions.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as errMsg, C as defineCustomActions, G as EventCategory, K as createEvent, N as pipelineRunnerCapability, V as BaseAddon, Y as makeSourceBrokerId, b as customAction, et as _enum, it as lazy, j as nodePin, lt as string, nt as boolean, ot as number, st as object, tt as array } from "../dist-
|
|
2
|
-
import { t as FrameHandlePlane } from "../frame-handle-plane-
|
|
1
|
+
import { B as errMsg, C as defineCustomActions, G as EventCategory, K as createEvent, N as pipelineRunnerCapability, V as BaseAddon, Y as makeSourceBrokerId, b as customAction, et as _enum, it as lazy, j as nodePin, lt as string, nt as boolean, ot as number, st as object, tt as array } from "../dist-DjuGmyG9.mjs";
|
|
2
|
+
import { t as FrameHandlePlane } from "../frame-handle-plane-Bkxz-TTD.mjs";
|
|
3
3
|
import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
|
|
4
4
|
import { FrameRingReaderCache } from "@camstack/shm-ring";
|
|
5
5
|
//#region src/pipeline-runner/bench-actions.ts
|
package/dist/recorder/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_model_download_service_C_IHWnXx = require("../model-download-service-C-IHWnXx-DxM2DSns.js");
|
|
2
|
-
const require_dist = require("../dist-
|
|
2
|
+
const require_dist = require("../dist-Cwc0TUQr.js");
|
|
3
3
|
const require_hub_hostname = require("../hub-hostname-DAJXlOgV.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_path = require("node:path");
|
package/dist/recorder/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as errMsg, G as EventCategory, I as storageEvictableCapability, P as recordingCapability, Q as selectAssignedProfileSlots, V as BaseAddon, W as DeviceType, c as EVENT_PAD_MS, ct as record, f as RecordingConfigSchema, k as migrateConfigToBands, lt as string, q as hydrateSchema } from "../dist-
|
|
1
|
+
import { B as errMsg, G as EventCategory, I as storageEvictableCapability, P as recordingCapability, Q as selectAssignedProfileSlots, V as BaseAddon, W as DeviceType, c as EVENT_PAD_MS, ct as record, f as RecordingConfigSchema, k as migrateConfigToBands, lt as string, q as hydrateSchema } from "../dist-DjuGmyG9.mjs";
|
|
2
2
|
import { t as resolveHubHostname } from "../hub-hostname-cCknRYKj.mjs";
|
|
3
3
|
import { t as createFileDataPlaneHandler } from "../model-download-service-C-IHWnXx-BPy6aoAx.mjs";
|
|
4
4
|
import { promises } from "node:fs";
|
|
@@ -3,7 +3,7 @@ import "./dist-CYZr2fwk.mjs";
|
|
|
3
3
|
var e = {
|
|
4
4
|
"@camstack/sdk": {
|
|
5
5
|
name: "@camstack/sdk",
|
|
6
|
-
version: "1.1.
|
|
6
|
+
version: "1.1.15",
|
|
7
7
|
scope: ["default"],
|
|
8
8
|
loaded: !1,
|
|
9
9
|
from: "addon_stream_broker_widgets",
|
|
@@ -18,7 +18,7 @@ var e = {
|
|
|
18
18
|
},
|
|
19
19
|
"@camstack/types": {
|
|
20
20
|
name: "@camstack/types",
|
|
21
|
-
version: "1.1.
|
|
21
|
+
version: "1.1.24",
|
|
22
22
|
scope: ["default"],
|
|
23
23
|
loaded: !1,
|
|
24
24
|
from: "addon_stream_broker_widgets",
|
|
@@ -33,7 +33,7 @@ var e = {
|
|
|
33
33
|
},
|
|
34
34
|
"@camstack/ui-library": {
|
|
35
35
|
name: "@camstack/ui-library",
|
|
36
|
-
version: "1.1.
|
|
36
|
+
version: "1.1.20",
|
|
37
37
|
scope: ["default"],
|
|
38
38
|
loaded: !1,
|
|
39
39
|
from: "addon_stream_broker_widgets",
|
|
@@ -36,7 +36,7 @@ async function r() {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"@camstack/types": {
|
|
39
|
-
version: "1.1.
|
|
39
|
+
version: "1.1.24",
|
|
40
40
|
scope: "default",
|
|
41
41
|
shareConfig: {
|
|
42
42
|
singleton: !0,
|
|
@@ -45,7 +45,7 @@ async function r() {
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"@camstack/sdk": {
|
|
48
|
-
version: "1.1.
|
|
48
|
+
version: "1.1.15",
|
|
49
49
|
scope: "default",
|
|
50
50
|
shareConfig: {
|
|
51
51
|
singleton: !0,
|
|
@@ -81,7 +81,7 @@ async function r() {
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"@camstack/ui-library": {
|
|
84
|
-
version: "1.1.
|
|
84
|
+
version: "1.1.20",
|
|
85
85
|
scope: "default",
|
|
86
86
|
shareConfig: {
|
|
87
87
|
singleton: !0,
|