@camstack/addon-provider-amcrest 0.2.15 → 0.2.16

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/addon.js CHANGED
@@ -25303,13 +25303,24 @@ method(object({
25303
25303
  /** Playback-speed multiplier for the render (1 = realtime). */
25304
25304
  var ExportSpeedSchema = number().min(.25).max(32);
25305
25305
  /**
25306
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25306
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25307
25307
  *
25308
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25309
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25310
- * playlist. Handing it absolute epochs would make every call site responsible
25311
- * for the same subtraction, and the one that forgot would emit a filter that
25312
- * selects nothing silently, as a uniform timelapse.
25308
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25309
+ * derives these bounds from things that happened at a TIME (a track's
25310
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25311
+ * every segment present for the range, with each recording GAP removed. The
25312
+ * two agree only on a window that recorded without one interruption, and only
25313
+ * the render side knows the segments, so the translation lives there
25314
+ * (`export-dense-map.ts`, addon-pipeline).
25315
+ *
25316
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25317
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25318
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25319
+ * the video was a uniform timelapse, and the log line reported the five ranges
25320
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25321
+ *
25322
+ * Relative and not absolute epoch, because an absolute epoch would make every
25323
+ * call site responsible for the same subtraction.
25313
25324
  */
25314
25325
  var ExportDenseRangeSchema = object({
25315
25326
  fromSec: number().nonnegative(),
@@ -34265,25 +34276,32 @@ object({
34265
34276
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34266
34277
  object({
34267
34278
  /**
34268
- * How long a retained native frame is served before it counts as a miss.
34279
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34280
+ * detection result.
34269
34281
  *
34270
- * Must cover the FULL late-crop horizon: detection inference + the
34271
- * cross-process inference-result hop to hub post-analysis + tracking + the
34272
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34273
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34274
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34282
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34283
+ * a time window was never related to the event the pixels were waiting for.
34284
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34285
+ * at which moment the runner cuts the subject tiles it actually wanted and
34286
+ * releases the frame. The bound exists only so a runner that stops answering
34287
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34288
+ *
34289
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34290
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34291
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34292
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34293
+ * `holdOverflow` on the metrics line is what says you need it.
34275
34294
  */
34276
- ttlMs: number().int().min(250).max(1e4),
34295
+ holdFrames: number().int().min(1).max(64),
34277
34296
  /**
34278
34297
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34279
34298
  *
34280
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34281
- * which one is actually binding before reasoning from that. At the shipped
34282
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34283
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34284
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34285
- * change that admits fewer frames buys retention WINDOW at constant RAM
34286
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34299
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34300
+ * is what decides how much is held, and the ceiling is the number above which
34301
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34302
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34303
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34304
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34287
34305
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34288
34306
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34289
34307
  * to replace).
@@ -34309,22 +34327,45 @@ object({
34309
34327
  * there is the signal that some caller names frames outside the inference set
34310
34328
  * and that this must go back to `all`.
34311
34329
  */
34312
- admission: NativeLeaseAdmissionSchema
34330
+ admission: NativeLeaseAdmissionSchema,
34331
+ /**
34332
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34333
+ * compressed native crops the worker cuts at the moment a frame's detection
34334
+ * result arrives, and keeps long after the frame itself is freed.
34335
+ *
34336
+ * This is the knob that replaced the old retention window, and it buys about
34337
+ * three orders of magnitude more of it: a tile is one subject at native
34338
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34339
+ * the frame it was cut from. A frame on which nothing was detected costs
34340
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34341
+ * was interrogated per SUBJECT.
34342
+ *
34343
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34344
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34345
+ * reproduce that.
34346
+ */
34347
+ tileBudgetMb: number().int().min(0).max(1024)
34313
34348
  });
34314
34349
  /**
34315
- * The values in force when the operator has set nothing — byte-for-byte the
34316
- * constants the decode worker shipped with as env-var defaults, so making these
34317
- * settings changed no behaviour on the day it landed.
34350
+ * The values in force when the operator has set nothing.
34351
+ *
34352
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34353
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34354
+ * in the same change that redefines it would make a regression and a retune
34355
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34356
+ * live traffic.
34318
34357
  */
34319
34358
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34320
- ttlMs: 1200,
34359
+ holdFrames: 8,
34321
34360
  budgetMb: 1024,
34322
34361
  activityMs: 15e3,
34362
+ tileBudgetMb: 64,
34323
34363
  admission: "inferred"
34324
34364
  };
34325
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34365
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34326
34366
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34327
34367
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34368
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34328
34369
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34329
34370
  //#endregion
34330
34371
  //#region src/digest-auth.ts
package/dist/addon.mjs CHANGED
@@ -25304,13 +25304,24 @@ method(object({
25304
25304
  /** Playback-speed multiplier for the render (1 = realtime). */
25305
25305
  var ExportSpeedSchema = number().min(.25).max(32);
25306
25306
  /**
25307
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25307
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25308
25308
  *
25309
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25310
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25311
- * playlist. Handing it absolute epochs would make every call site responsible
25312
- * for the same subtraction, and the one that forgot would emit a filter that
25313
- * selects nothing silently, as a uniform timelapse.
25309
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
25310
+ * derives these bounds from things that happened at a TIME (a track's
25311
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25312
+ * every segment present for the range, with each recording GAP removed. The
25313
+ * two agree only on a window that recorded without one interruption, and only
25314
+ * the render side knows the segments, so the translation lives there
25315
+ * (`export-dense-map.ts`, addon-pipeline).
25316
+ *
25317
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25318
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25319
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25320
+ * the video was a uniform timelapse, and the log line reported the five ranges
25321
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25322
+ *
25323
+ * Relative and not absolute epoch, because an absolute epoch would make every
25324
+ * call site responsible for the same subtraction.
25314
25325
  */
25315
25326
  var ExportDenseRangeSchema = object({
25316
25327
  fromSec: number().nonnegative(),
@@ -34266,25 +34277,32 @@ object({
34266
34277
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34267
34278
  object({
34268
34279
  /**
34269
- * How long a retained native frame is served before it counts as a miss.
34280
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34281
+ * detection result.
34270
34282
  *
34271
- * Must cover the FULL late-crop horizon: detection inference + the
34272
- * cross-process inference-result hop to hub post-analysis + tracking + the
34273
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34274
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34275
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34283
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34284
+ * a time window was never related to the event the pixels were waiting for.
34285
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34286
+ * at which moment the runner cuts the subject tiles it actually wanted and
34287
+ * releases the frame. The bound exists only so a runner that stops answering
34288
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34289
+ *
34290
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34291
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34292
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34293
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34294
+ * `holdOverflow` on the metrics line is what says you need it.
34276
34295
  */
34277
- ttlMs: number().int().min(250).max(1e4),
34296
+ holdFrames: number().int().min(1).max(64),
34278
34297
  /**
34279
34298
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34280
34299
  *
34281
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34282
- * which one is actually binding before reasoning from that. At the shipped
34283
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34284
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34285
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34286
- * change that admits fewer frames buys retention WINDOW at constant RAM
34287
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34300
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34301
+ * is what decides how much is held, and the ceiling is the number above which
34302
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34303
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34304
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34305
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34288
34306
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34289
34307
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34290
34308
  * to replace).
@@ -34310,22 +34328,45 @@ object({
34310
34328
  * there is the signal that some caller names frames outside the inference set
34311
34329
  * and that this must go back to `all`.
34312
34330
  */
34313
- admission: NativeLeaseAdmissionSchema
34331
+ admission: NativeLeaseAdmissionSchema,
34332
+ /**
34333
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34334
+ * compressed native crops the worker cuts at the moment a frame's detection
34335
+ * result arrives, and keeps long after the frame itself is freed.
34336
+ *
34337
+ * This is the knob that replaced the old retention window, and it buys about
34338
+ * three orders of magnitude more of it: a tile is one subject at native
34339
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34340
+ * the frame it was cut from. A frame on which nothing was detected costs
34341
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34342
+ * was interrogated per SUBJECT.
34343
+ *
34344
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34345
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34346
+ * reproduce that.
34347
+ */
34348
+ tileBudgetMb: number().int().min(0).max(1024)
34314
34349
  });
34315
34350
  /**
34316
- * The values in force when the operator has set nothing — byte-for-byte the
34317
- * constants the decode worker shipped with as env-var defaults, so making these
34318
- * settings changed no behaviour on the day it landed.
34351
+ * The values in force when the operator has set nothing.
34352
+ *
34353
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34354
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34355
+ * in the same change that redefines it would make a regression and a retune
34356
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34357
+ * live traffic.
34319
34358
  */
34320
34359
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34321
- ttlMs: 1200,
34360
+ holdFrames: 8,
34322
34361
  budgetMb: 1024,
34323
34362
  activityMs: 15e3,
34363
+ tileBudgetMb: 64,
34324
34364
  admission: "inferred"
34325
34365
  };
34326
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34366
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34327
34367
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34328
34368
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34369
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34329
34370
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34330
34371
  //#endregion
34331
34372
  //#region src/digest-auth.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-amcrest",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
5
5
  "keywords": [
6
6
  "camstack",