@camstack/addon-decoder-nodeav 1.2.13 → 1.2.14

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/index.js CHANGED
@@ -23713,13 +23713,24 @@ method(object({
23713
23713
  /** Playback-speed multiplier for the render (1 = realtime). */
23714
23714
  var ExportSpeedSchema = number().min(.25).max(32);
23715
23715
  /**
23716
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23716
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23717
23717
  *
23718
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23719
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23720
- * playlist. Handing it absolute epochs would make every call site responsible
23721
- * for the same subtraction, and the one that forgot would emit a filter that
23722
- * selects nothing silently, as a uniform timelapse.
23718
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
23719
+ * derives these bounds from things that happened at a TIME (a track's
23720
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23721
+ * every segment present for the range, with each recording GAP removed. The
23722
+ * two agree only on a window that recorded without one interruption, and only
23723
+ * the render side knows the segments, so the translation lives there
23724
+ * (`export-dense-map.ts`, addon-pipeline).
23725
+ *
23726
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23727
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23728
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23729
+ * the video was a uniform timelapse, and the log line reported the five ranges
23730
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23731
+ *
23732
+ * Relative and not absolute epoch, because an absolute epoch would make every
23733
+ * call site responsible for the same subtraction.
23723
23734
  */
23724
23735
  var ExportDenseRangeSchema = object({
23725
23736
  fromSec: number().nonnegative(),
@@ -30849,25 +30860,32 @@ object({
30849
30860
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30850
30861
  object({
30851
30862
  /**
30852
- * How long a retained native frame is served before it counts as a miss.
30863
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30864
+ * detection result.
30853
30865
  *
30854
- * Must cover the FULL late-crop horizon: detection inference + the
30855
- * cross-process inference-result hop to hub post-analysis + tracking + the
30856
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30857
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30858
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30866
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30867
+ * a time window was never related to the event the pixels were waiting for.
30868
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30869
+ * at which moment the runner cuts the subject tiles it actually wanted and
30870
+ * releases the frame. The bound exists only so a runner that stops answering
30871
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30872
+ *
30873
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30874
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30875
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30876
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30877
+ * `holdOverflow` on the metrics line is what says you need it.
30859
30878
  */
30860
- ttlMs: number().int().min(250).max(1e4),
30879
+ holdFrames: number().int().min(1).max(64),
30861
30880
  /**
30862
30881
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30863
30882
  *
30864
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30865
- * which one is actually binding before reasoning from that. At the shipped
30866
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30867
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30868
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30869
- * change that admits fewer frames buys retention WINDOW at constant RAM
30870
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30883
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30884
+ * is what decides how much is held, and the ceiling is the number above which
30885
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30886
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30887
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30888
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30871
30889
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30872
30890
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30873
30891
  * to replace).
@@ -30893,22 +30911,45 @@ object({
30893
30911
  * there is the signal that some caller names frames outside the inference set
30894
30912
  * and that this must go back to `all`.
30895
30913
  */
30896
- admission: NativeLeaseAdmissionSchema
30914
+ admission: NativeLeaseAdmissionSchema,
30915
+ /**
30916
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30917
+ * compressed native crops the worker cuts at the moment a frame's detection
30918
+ * result arrives, and keeps long after the frame itself is freed.
30919
+ *
30920
+ * This is the knob that replaced the old retention window, and it buys about
30921
+ * three orders of magnitude more of it: a tile is one subject at native
30922
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30923
+ * the frame it was cut from. A frame on which nothing was detected costs
30924
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30925
+ * was interrogated per SUBJECT.
30926
+ *
30927
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30928
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30929
+ * reproduce that.
30930
+ */
30931
+ tileBudgetMb: number().int().min(0).max(1024)
30897
30932
  });
30898
30933
  /**
30899
- * The values in force when the operator has set nothing — byte-for-byte the
30900
- * constants the decode worker shipped with as env-var defaults, so making these
30901
- * settings changed no behaviour on the day it landed.
30934
+ * The values in force when the operator has set nothing.
30935
+ *
30936
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
30937
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
30938
+ * in the same change that redefines it would make a regression and a retune
30939
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
30940
+ * live traffic.
30902
30941
  */
30903
30942
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30904
- ttlMs: 1200,
30943
+ holdFrames: 8,
30905
30944
  budgetMb: 1024,
30906
30945
  activityMs: 15e3,
30946
+ tileBudgetMb: 64,
30907
30947
  admission: "inferred"
30908
30948
  };
30909
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
30949
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30910
30950
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30911
30951
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
30952
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30912
30953
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30913
30954
  /**
30914
30955
  * Fixed-capacity ring buffer. When full, push() overwrites the oldest entry.
package/dist/index.mjs CHANGED
@@ -23709,13 +23709,24 @@ method(object({
23709
23709
  /** Playback-speed multiplier for the render (1 = realtime). */
23710
23710
  var ExportSpeedSchema = number().min(.25).max(32);
23711
23711
  /**
23712
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23712
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23713
23713
  *
23714
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23715
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23716
- * playlist. Handing it absolute epochs would make every call site responsible
23717
- * for the same subtraction, and the one that forgot would emit a filter that
23718
- * selects nothing silently, as a uniform timelapse.
23714
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
23715
+ * derives these bounds from things that happened at a TIME (a track's
23716
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23717
+ * every segment present for the range, with each recording GAP removed. The
23718
+ * two agree only on a window that recorded without one interruption, and only
23719
+ * the render side knows the segments, so the translation lives there
23720
+ * (`export-dense-map.ts`, addon-pipeline).
23721
+ *
23722
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23723
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23724
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23725
+ * the video was a uniform timelapse, and the log line reported the five ranges
23726
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23727
+ *
23728
+ * Relative and not absolute epoch, because an absolute epoch would make every
23729
+ * call site responsible for the same subtraction.
23719
23730
  */
23720
23731
  var ExportDenseRangeSchema = object({
23721
23732
  fromSec: number().nonnegative(),
@@ -30845,25 +30856,32 @@ object({
30845
30856
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30846
30857
  object({
30847
30858
  /**
30848
- * How long a retained native frame is served before it counts as a miss.
30859
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30860
+ * detection result.
30849
30861
  *
30850
- * Must cover the FULL late-crop horizon: detection inference + the
30851
- * cross-process inference-result hop to hub post-analysis + tracking + the
30852
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30853
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30854
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30862
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30863
+ * a time window was never related to the event the pixels were waiting for.
30864
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30865
+ * at which moment the runner cuts the subject tiles it actually wanted and
30866
+ * releases the frame. The bound exists only so a runner that stops answering
30867
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30868
+ *
30869
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30870
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30871
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30872
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30873
+ * `holdOverflow` on the metrics line is what says you need it.
30855
30874
  */
30856
- ttlMs: number().int().min(250).max(1e4),
30875
+ holdFrames: number().int().min(1).max(64),
30857
30876
  /**
30858
30877
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30859
30878
  *
30860
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30861
- * which one is actually binding before reasoning from that. At the shipped
30862
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30863
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30864
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30865
- * change that admits fewer frames buys retention WINDOW at constant RAM
30866
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30879
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30880
+ * is what decides how much is held, and the ceiling is the number above which
30881
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30882
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30883
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30884
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30867
30885
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30868
30886
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30869
30887
  * to replace).
@@ -30889,22 +30907,45 @@ object({
30889
30907
  * there is the signal that some caller names frames outside the inference set
30890
30908
  * and that this must go back to `all`.
30891
30909
  */
30892
- admission: NativeLeaseAdmissionSchema
30910
+ admission: NativeLeaseAdmissionSchema,
30911
+ /**
30912
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30913
+ * compressed native crops the worker cuts at the moment a frame's detection
30914
+ * result arrives, and keeps long after the frame itself is freed.
30915
+ *
30916
+ * This is the knob that replaced the old retention window, and it buys about
30917
+ * three orders of magnitude more of it: a tile is one subject at native
30918
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30919
+ * the frame it was cut from. A frame on which nothing was detected costs
30920
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30921
+ * was interrogated per SUBJECT.
30922
+ *
30923
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30924
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30925
+ * reproduce that.
30926
+ */
30927
+ tileBudgetMb: number().int().min(0).max(1024)
30893
30928
  });
30894
30929
  /**
30895
- * The values in force when the operator has set nothing — byte-for-byte the
30896
- * constants the decode worker shipped with as env-var defaults, so making these
30897
- * settings changed no behaviour on the day it landed.
30930
+ * The values in force when the operator has set nothing.
30931
+ *
30932
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
30933
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
30934
+ * in the same change that redefines it would make a regression and a retune
30935
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
30936
+ * live traffic.
30898
30937
  */
30899
30938
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30900
- ttlMs: 1200,
30939
+ holdFrames: 8,
30901
30940
  budgetMb: 1024,
30902
30941
  activityMs: 15e3,
30942
+ tileBudgetMb: 64,
30903
30943
  admission: "inferred"
30904
30944
  };
30905
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
30945
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30906
30946
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30907
30947
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
30948
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30908
30949
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30909
30950
  /**
30910
30951
  * Fixed-capacity ring buffer. When full, push() overwrites the oldest entry.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-nodeav",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",