@camstack/types 1.2.220 → 1.2.222
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/{canonical-hash-CBuveiaU.js → canonical-hash-BS9dQmcQ.js} +11 -0
- package/dist/{canonical-hash-B-5nFwFn.mjs → canonical-hash-C5pB-QV1.mjs} +11 -0
- package/dist/capabilities/camera-grid-layout.cap.d.ts +4 -10
- package/dist/ffmpeg/invocation.d.ts +22 -2
- package/dist/index.js +17 -7
- package/dist/index.mjs +17 -7
- package/dist/node.js +1 -1
- package/dist/node.mjs +1 -1
- package/package.json +1 -1
|
@@ -129,6 +129,17 @@ function buildRateControlArgs(video) {
|
|
|
129
129
|
}
|
|
130
130
|
/** The whole video block (`-vf` … `-c:v` … knobs), after `-i`. */
|
|
131
131
|
function buildVideoArgs(video, outputArgs, filterGraph) {
|
|
132
|
+
if (video.kind === "raw") {
|
|
133
|
+
if (filterGraph && video.filter !== void 0) throw new Error("FfmpegInvocation: video.filter cannot be combined with a filter graph — fold the filter into the graph");
|
|
134
|
+
return [
|
|
135
|
+
...video.filter !== void 0 ? ["-vf", video.filter] : [],
|
|
136
|
+
"-c:v",
|
|
137
|
+
"rawvideo",
|
|
138
|
+
"-pix_fmt",
|
|
139
|
+
video.pixelFormat,
|
|
140
|
+
...video.fps !== void 0 ? ["-r", String(video.fps)] : []
|
|
141
|
+
];
|
|
142
|
+
}
|
|
132
143
|
if (video.kind === "copy") {
|
|
133
144
|
if (filterGraph) throw new Error("FfmpegInvocation: a filter graph produces a NEW picture, so video.kind must be `encode`");
|
|
134
145
|
return [
|
|
@@ -129,6 +129,17 @@ function buildRateControlArgs(video) {
|
|
|
129
129
|
}
|
|
130
130
|
/** The whole video block (`-vf` … `-c:v` … knobs), after `-i`. */
|
|
131
131
|
function buildVideoArgs(video, outputArgs, filterGraph) {
|
|
132
|
+
if (video.kind === "raw") {
|
|
133
|
+
if (filterGraph && video.filter !== void 0) throw new Error("FfmpegInvocation: video.filter cannot be combined with a filter graph — fold the filter into the graph");
|
|
134
|
+
return [
|
|
135
|
+
...video.filter !== void 0 ? ["-vf", video.filter] : [],
|
|
136
|
+
"-c:v",
|
|
137
|
+
"rawvideo",
|
|
138
|
+
"-pix_fmt",
|
|
139
|
+
video.pixelFormat,
|
|
140
|
+
...video.fps !== void 0 ? ["-r", String(video.fps)] : []
|
|
141
|
+
];
|
|
142
|
+
}
|
|
132
143
|
if (video.kind === "copy") {
|
|
133
144
|
if (filterGraph) throw new Error("FfmpegInvocation: a filter graph produces a NEW picture, so video.kind must be `encode`");
|
|
134
145
|
return [
|
|
@@ -89,13 +89,12 @@ declare const GridProfileOfferSchema: z.ZodObject<{
|
|
|
89
89
|
}>;
|
|
90
90
|
offered: z.ZodBoolean;
|
|
91
91
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
92
|
+
canvas: z.ZodString;
|
|
92
93
|
}, z.core.$strip>;
|
|
93
94
|
export declare const GridLayoutViewSchema: z.ZodObject<{
|
|
94
95
|
instanceId: z.ZodString;
|
|
95
96
|
deviceId: z.ZodNumber;
|
|
96
97
|
name: z.ZodString;
|
|
97
|
-
width: z.ZodNumber;
|
|
98
|
-
height: z.ZodNumber;
|
|
99
98
|
fps: z.ZodNumber;
|
|
100
99
|
cells: z.ZodArray<z.ZodObject<{
|
|
101
100
|
deviceId: z.ZodNumber;
|
|
@@ -120,6 +119,7 @@ export declare const GridLayoutViewSchema: z.ZodObject<{
|
|
|
120
119
|
}>;
|
|
121
120
|
offered: z.ZodBoolean;
|
|
122
121
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
122
|
+
canvas: z.ZodString;
|
|
123
123
|
}, z.core.$strip>>;
|
|
124
124
|
}, z.core.$strip>;
|
|
125
125
|
export type GridNormalizedRect = z.infer<typeof GridNormalizedRectSchema>;
|
|
@@ -129,8 +129,6 @@ export type GridLayoutView = z.infer<typeof GridLayoutViewSchema>;
|
|
|
129
129
|
export declare const GridLayoutPatchSchema: z.ZodObject<{
|
|
130
130
|
deviceId: z.ZodNumber;
|
|
131
131
|
name: z.ZodOptional<z.ZodString>;
|
|
132
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
133
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
134
132
|
fps: z.ZodOptional<z.ZodNumber>;
|
|
135
133
|
cells: z.ZodArray<z.ZodObject<{
|
|
136
134
|
deviceId: z.ZodNumber;
|
|
@@ -187,8 +185,6 @@ export declare const cameraGridLayoutCapability: {
|
|
|
187
185
|
instanceId: z.ZodString;
|
|
188
186
|
deviceId: z.ZodNumber;
|
|
189
187
|
name: z.ZodString;
|
|
190
|
-
width: z.ZodNumber;
|
|
191
|
-
height: z.ZodNumber;
|
|
192
188
|
fps: z.ZodNumber;
|
|
193
189
|
cells: z.ZodArray<z.ZodObject<{
|
|
194
190
|
deviceId: z.ZodNumber;
|
|
@@ -213,14 +209,13 @@ export declare const cameraGridLayoutCapability: {
|
|
|
213
209
|
}>;
|
|
214
210
|
offered: z.ZodBoolean;
|
|
215
211
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
212
|
+
canvas: z.ZodString;
|
|
216
213
|
}, z.core.$strip>>;
|
|
217
214
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
218
215
|
/** Write the geometry back. Returns the grid as it now stands, profiles included. */
|
|
219
216
|
readonly saveLayout: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
220
217
|
deviceId: z.ZodNumber;
|
|
221
218
|
name: z.ZodOptional<z.ZodString>;
|
|
222
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
223
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
224
219
|
fps: z.ZodOptional<z.ZodNumber>;
|
|
225
220
|
cells: z.ZodArray<z.ZodObject<{
|
|
226
221
|
deviceId: z.ZodNumber;
|
|
@@ -241,8 +236,6 @@ export declare const cameraGridLayoutCapability: {
|
|
|
241
236
|
instanceId: z.ZodString;
|
|
242
237
|
deviceId: z.ZodNumber;
|
|
243
238
|
name: z.ZodString;
|
|
244
|
-
width: z.ZodNumber;
|
|
245
|
-
height: z.ZodNumber;
|
|
246
239
|
fps: z.ZodNumber;
|
|
247
240
|
cells: z.ZodArray<z.ZodObject<{
|
|
248
241
|
deviceId: z.ZodNumber;
|
|
@@ -267,6 +260,7 @@ export declare const cameraGridLayoutCapability: {
|
|
|
267
260
|
}>;
|
|
268
261
|
offered: z.ZodBoolean;
|
|
269
262
|
missingSources: z.ZodArray<z.ZodNumber>;
|
|
263
|
+
canvas: z.ZodString;
|
|
270
264
|
}, z.core.$strip>>;
|
|
271
265
|
}, z.core.$strip>, "mutation">;
|
|
272
266
|
};
|
|
@@ -193,7 +193,27 @@ export interface FfmpegVideoCopyPlan {
|
|
|
193
193
|
readonly kind: 'copy';
|
|
194
194
|
readonly bitstreamFilter?: string;
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Decode, filter, and hand the PIXELS on — no encoder at all.
|
|
198
|
+
*
|
|
199
|
+
* The one consumer is a composition this repo assembles itself
|
|
200
|
+
* (`grid-compositor.ts`): its tiles are copied into a canvas, so encoding them
|
|
201
|
+
* on the way out and decoding them again on the way in would be two codecs paid
|
|
202
|
+
* to deliver the frames that were already there.
|
|
203
|
+
*
|
|
204
|
+
* `pixelFormat` is REQUIRED, unlike on an encode plan where it is a hint.
|
|
205
|
+
* Raw frames carry no header, so their format is not written down anywhere on
|
|
206
|
+
* the wire: whoever reads them has to be told, and a default here would be a
|
|
207
|
+
* fact one side knows and the other guesses.
|
|
208
|
+
*/
|
|
209
|
+
export interface FfmpegVideoRawPlan {
|
|
210
|
+
readonly kind: 'raw';
|
|
211
|
+
readonly pixelFormat: string;
|
|
212
|
+
/** A simple `-vf` chain (crop, scale). Never combined with a filter graph. */
|
|
213
|
+
readonly filter?: string;
|
|
214
|
+
readonly fps?: number;
|
|
215
|
+
}
|
|
216
|
+
export type FfmpegVideoPlan = FfmpegVideoCopyPlan | FfmpegVideoEncodePlan | FfmpegVideoRawPlan;
|
|
197
217
|
export type FfmpegAudioCodecId = 'opus' | 'aac' | 'pcmu' | 'pcma';
|
|
198
218
|
export interface FfmpegAudioEncodePlan {
|
|
199
219
|
readonly kind: 'encode';
|
|
@@ -290,7 +310,7 @@ export type FfmpegSink = {
|
|
|
290
310
|
*/
|
|
291
311
|
| {
|
|
292
312
|
readonly kind: 'stdout';
|
|
293
|
-
readonly container: 'h264' | 'hevc' | 'mpegts' | 'flv';
|
|
313
|
+
readonly container: 'h264' | 'hevc' | 'mpegts' | 'flv' | 'rawvideo';
|
|
294
314
|
} | FfmpegFmp4Sink
|
|
295
315
|
/**
|
|
296
316
|
* Two independent mapped RTP outputs. Generic ffmpeg RTP vocabulary — the
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_sleep = require("./sleep-VlZxDyXq.js");
|
|
3
3
|
const require_event_category = require("./event-category-BVfsrBYA.js");
|
|
4
|
-
const require_canonical_hash = require("./canonical-hash-
|
|
4
|
+
const require_canonical_hash = require("./canonical-hash-BS9dQmcQ.js");
|
|
5
5
|
const require_enums = require("./enums.js");
|
|
6
6
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
7
7
|
let zod = require("zod");
|
|
@@ -32551,16 +32551,28 @@ var GridProfileOfferSchema = zod.z.object({
|
|
|
32551
32551
|
]),
|
|
32552
32552
|
offered: zod.z.boolean(),
|
|
32553
32553
|
/** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
|
|
32554
|
-
missingSources: zod.z.array(zod.z.number().int().positive())
|
|
32554
|
+
missingSources: zod.z.array(zod.z.number().int().positive()),
|
|
32555
|
+
/**
|
|
32556
|
+
* The canvas this profile composes onto, `WxH`, or empty when it is not
|
|
32557
|
+
* offered. DERIVED from the cells and the sources' own size at this profile —
|
|
32558
|
+
* it is reported because nothing else in the system would ever say what the
|
|
32559
|
+
* grid came out as, and because it is the number an operator would otherwise
|
|
32560
|
+
* expect to type.
|
|
32561
|
+
*/
|
|
32562
|
+
canvas: zod.z.string()
|
|
32555
32563
|
});
|
|
32556
32564
|
var GridLayoutViewSchema = zod.z.object({
|
|
32557
32565
|
/** The persisted grid row this camera was declared from. */
|
|
32558
32566
|
instanceId: zod.z.string(),
|
|
32559
32567
|
deviceId: zod.z.number().int().nonnegative(),
|
|
32560
32568
|
name: zod.z.string(),
|
|
32561
|
-
/**
|
|
32562
|
-
|
|
32563
|
-
|
|
32569
|
+
/**
|
|
32570
|
+
* NO canvas size. A grid's resolution is not authored: each profile derives
|
|
32571
|
+
* its own from the cells and its sources' dimensions. The two numbers that
|
|
32572
|
+
* used to be here were a text field that silently decided both how much the
|
|
32573
|
+
* composite cost and how sharp it was — see `profiles[].canvas` for what it
|
|
32574
|
+
* came out as.
|
|
32575
|
+
*/
|
|
32564
32576
|
fps: zod.z.number().int(),
|
|
32565
32577
|
cells: zod.z.array(GridLayoutCellSchema),
|
|
32566
32578
|
/** What the catalog will publish, and what it refuses to. Read-only. */
|
|
@@ -32569,8 +32581,6 @@ var GridLayoutViewSchema = zod.z.object({
|
|
|
32569
32581
|
var GridLayoutPatchSchema = zod.z.object({
|
|
32570
32582
|
deviceId: zod.z.number().int().nonnegative(),
|
|
32571
32583
|
name: zod.z.string().min(1).max(160).optional(),
|
|
32572
|
-
width: zod.z.number().int().min(160).max(7680).optional(),
|
|
32573
|
-
height: zod.z.number().int().min(120).max(4320).optional(),
|
|
32574
32584
|
fps: zod.z.number().int().min(1).max(60).optional(),
|
|
32575
32585
|
/**
|
|
32576
32586
|
* The whole cell list at once. A per-cell patch would need an ordering the
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $ as CAM_PROFILE_ORDER, A as DeviceType, At as isEvent, B as systemMethod, Bt as isAudioChunkFormat, C as customAction, Ct as SHARE_VIEW_KINDS, D as ChargingStatus, Dt as createDurableState, E as deviceCustomAction, Et as normalizeAddonInitResult, F as event, Ft as hydrateSchema, G as ReadinessRegistry, H as nodePin, I as expandCapMethods, It as resolveHydratedFieldValue, J as readinessKey, K as ReadinessTimeoutError, L as isDeviceConfigCap, Lt as AUDIO_CHUNK_FORMATS, M as DEFAULT_RUNTIME_STATE_DURABILITY, Mt as WELL_KNOWN_TAB_MAP, N as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Nt as collectHydratedFieldEntries, O as DeviceFeature, Ot as createEvent, P as DEVICE_STATUS_METHOD, Pt as collectHydratedFieldValues, Q as BrokerStatusSchema, R as method, Rt as audioChunkBytesPerSample, S as DEVICE_CHILDREN_BATCH_MAX, St as DATAPLANE_SECRET_HEADER, T as describeCustomActions, Tt as BaseAddon, U as readNodePin, V as CAP_NODE_PIN_CONTEXT_KEY, W as toNodeId, X as AudioChunkFormatSchema, Y as scopeKey, Z as BrokerStatsSchema, _ as createMirrorSource, _t as SubscribeFramesResultSchema, a as asJsonObject, at as DecodedFrameSchema, b as deviceOpsCapability, bt as parseProfileBrokerId, c as parseJsonArray, ct as FrameHandleSchema, d as BOOT_RECOVERY_BACKOFF_MS, dt as ProfileSlotStatusSchema, et as CamProfileSchema, f as DEVICE_SCOPED_CAPS, ft as StreamSourceEntrySchema, g as createLazyTrpcSource, gt as SubscribeFramesInputSchema, h as createEventBusSliceSource, ht as SubscribeAudioChunksResultSchema, i as asJsonArray, it as DecodedAudioChunkSchema, j as adminUiCapability, jt as WELL_KNOWN_TABS, k as DeviceRole, kt as emitReadiness, l as parseJsonObject, lt as ProfileRtspEntrySchema, m as createDeviceProxy, mt as SubscribeAudioChunksInputSchema, n as sleepCancellable, nt as CamStreamResolutionSchema, o as asNumber, ot as EncodedPacketSchema, p as isDeviceScopedCap, pt as StreamSourceSchema, q as emitDownForOwnedCaps, r as asBoolean, rt as CameraStreamSchema, s as asString, st as FrameHandleFormatSchema, t as sleep, tt as CamStreamKindSchema, u as parseJsonUnknown, ut as ProfileSlotSchema, v as createSliceHandle, vt as makeProfileBrokerId, w as defineCustomActions, wt as DisposerChain, x as viewerUiCapability, xt as selectAssignedProfileSlots, y as RawStateResultSchema, yt as makeSourceBrokerId, z as resolveCapMount, zt as expandAudioChunkToF32le } from "./sleep-GU_us3DG.mjs";
|
|
2
2
|
import { t as EventCategory } from "./event-category-BVDXG4tB.mjs";
|
|
3
|
-
import { a as buildAudioArgs, c as buildVideoArgs, d as logBannerArgs, f as pickVideoEncoder, i as audioPlanFromEncodeProfile, l as invocationFromEncodeProfile, n as Fmp4BoxSplitter, o as buildFfmpegArgs, p as resolveStreamMaps, r as AUDIO_PRESETS, s as buildInputArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-
|
|
3
|
+
import { a as buildAudioArgs, c as buildVideoArgs, d as logBannerArgs, f as pickVideoEncoder, i as audioPlanFromEncodeProfile, l as invocationFromEncodeProfile, n as Fmp4BoxSplitter, o as buildFfmpegArgs, p as resolveStreamMaps, r as AUDIO_PRESETS, s as buildInputArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-C5pB-QV1.mjs";
|
|
4
4
|
import { EventSourceType } from "./enums.mjs";
|
|
5
5
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -32550,16 +32550,28 @@ var GridProfileOfferSchema = z.object({
|
|
|
32550
32550
|
]),
|
|
32551
32551
|
offered: z.boolean(),
|
|
32552
32552
|
/** Sources that cannot serve it. Empty when it is offered, or when there are no cells. */
|
|
32553
|
-
missingSources: z.array(z.number().int().positive())
|
|
32553
|
+
missingSources: z.array(z.number().int().positive()),
|
|
32554
|
+
/**
|
|
32555
|
+
* The canvas this profile composes onto, `WxH`, or empty when it is not
|
|
32556
|
+
* offered. DERIVED from the cells and the sources' own size at this profile —
|
|
32557
|
+
* it is reported because nothing else in the system would ever say what the
|
|
32558
|
+
* grid came out as, and because it is the number an operator would otherwise
|
|
32559
|
+
* expect to type.
|
|
32560
|
+
*/
|
|
32561
|
+
canvas: z.string()
|
|
32554
32562
|
});
|
|
32555
32563
|
var GridLayoutViewSchema = z.object({
|
|
32556
32564
|
/** The persisted grid row this camera was declared from. */
|
|
32557
32565
|
instanceId: z.string(),
|
|
32558
32566
|
deviceId: z.number().int().nonnegative(),
|
|
32559
32567
|
name: z.string(),
|
|
32560
|
-
/**
|
|
32561
|
-
|
|
32562
|
-
|
|
32568
|
+
/**
|
|
32569
|
+
* NO canvas size. A grid's resolution is not authored: each profile derives
|
|
32570
|
+
* its own from the cells and its sources' dimensions. The two numbers that
|
|
32571
|
+
* used to be here were a text field that silently decided both how much the
|
|
32572
|
+
* composite cost and how sharp it was — see `profiles[].canvas` for what it
|
|
32573
|
+
* came out as.
|
|
32574
|
+
*/
|
|
32563
32575
|
fps: z.number().int(),
|
|
32564
32576
|
cells: z.array(GridLayoutCellSchema),
|
|
32565
32577
|
/** What the catalog will publish, and what it refuses to. Read-only. */
|
|
@@ -32568,8 +32580,6 @@ var GridLayoutViewSchema = z.object({
|
|
|
32568
32580
|
var GridLayoutPatchSchema = z.object({
|
|
32569
32581
|
deviceId: z.number().int().nonnegative(),
|
|
32570
32582
|
name: z.string().min(1).max(160).optional(),
|
|
32571
|
-
width: z.number().int().min(160).max(7680).optional(),
|
|
32572
|
-
height: z.number().int().min(120).max(4320).optional(),
|
|
32573
32583
|
fps: z.number().int().min(1).max(60).optional(),
|
|
32574
32584
|
/**
|
|
32575
32585
|
* The whole cell list at once. A per-cell patch would need an ordering the
|
package/dist/node.js
CHANGED
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
const require_canonical_hash = require("./canonical-hash-
|
|
24
|
+
const require_canonical_hash = require("./canonical-hash-BS9dQmcQ.js");
|
|
25
25
|
const require_err_msg = require("./err-msg-COpsHMw2.js");
|
|
26
26
|
let node_crypto = require("node:crypto");
|
|
27
27
|
let node_fs = require("node:fs");
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as Fmp4BoxSplitter, o as buildFfmpegArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-
|
|
1
|
+
import { n as Fmp4BoxSplitter, o as buildFfmpegArgs, t as canonicalHash, u as isSoftwareDecode } from "./canonical-hash-C5pB-QV1.mjs";
|
|
2
2
|
import { t as errMsg } from "./err-msg-IQTHeDzc.mjs";
|
|
3
3
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
4
4
|
import * as fs from "node:fs";
|