@camstack/addon-static-turn 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.
@@ -23590,13 +23590,24 @@ method(object({
23590
23590
  /** Playback-speed multiplier for the render (1 = realtime). */
23591
23591
  var ExportSpeedSchema = number().min(.25).max(32);
23592
23592
  /**
23593
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23593
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23594
23594
  *
23595
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23596
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23597
- * playlist. Handing it absolute epochs would make every call site responsible
23598
- * for the same subtraction, and the one that forgot would emit a filter that
23599
- * selects nothing silently, as a uniform timelapse.
23595
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
23596
+ * derives these bounds from things that happened at a TIME (a track's
23597
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23598
+ * every segment present for the range, with each recording GAP removed. The
23599
+ * two agree only on a window that recorded without one interruption, and only
23600
+ * the render side knows the segments, so the translation lives there
23601
+ * (`export-dense-map.ts`, addon-pipeline).
23602
+ *
23603
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23604
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23605
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23606
+ * the video was a uniform timelapse, and the log line reported the five ranges
23607
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23608
+ *
23609
+ * Relative and not absolute epoch, because an absolute epoch would make every
23610
+ * call site responsible for the same subtraction.
23600
23611
  */
23601
23612
  var ExportDenseRangeSchema = object({
23602
23613
  fromSec: number().nonnegative(),
@@ -30726,25 +30737,32 @@ object({
30726
30737
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30727
30738
  object({
30728
30739
  /**
30729
- * How long a retained native frame is served before it counts as a miss.
30740
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30741
+ * detection result.
30730
30742
  *
30731
- * Must cover the FULL late-crop horizon: detection inference + the
30732
- * cross-process inference-result hop to hub post-analysis + tracking + the
30733
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30734
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30735
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30743
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30744
+ * a time window was never related to the event the pixels were waiting for.
30745
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30746
+ * at which moment the runner cuts the subject tiles it actually wanted and
30747
+ * releases the frame. The bound exists only so a runner that stops answering
30748
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30749
+ *
30750
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30751
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30752
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30753
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30754
+ * `holdOverflow` on the metrics line is what says you need it.
30736
30755
  */
30737
- ttlMs: number().int().min(250).max(1e4),
30756
+ holdFrames: number().int().min(1).max(64),
30738
30757
  /**
30739
30758
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30740
30759
  *
30741
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30742
- * which one is actually binding before reasoning from that. At the shipped
30743
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30744
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30745
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30746
- * change that admits fewer frames buys retention WINDOW at constant RAM
30747
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30760
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30761
+ * is what decides how much is held, and the ceiling is the number above which
30762
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30763
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30764
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30765
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30748
30766
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30749
30767
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30750
30768
  * to replace).
@@ -30770,22 +30788,45 @@ object({
30770
30788
  * there is the signal that some caller names frames outside the inference set
30771
30789
  * and that this must go back to `all`.
30772
30790
  */
30773
- admission: NativeLeaseAdmissionSchema
30791
+ admission: NativeLeaseAdmissionSchema,
30792
+ /**
30793
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30794
+ * compressed native crops the worker cuts at the moment a frame's detection
30795
+ * result arrives, and keeps long after the frame itself is freed.
30796
+ *
30797
+ * This is the knob that replaced the old retention window, and it buys about
30798
+ * three orders of magnitude more of it: a tile is one subject at native
30799
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30800
+ * the frame it was cut from. A frame on which nothing was detected costs
30801
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30802
+ * was interrogated per SUBJECT.
30803
+ *
30804
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30805
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30806
+ * reproduce that.
30807
+ */
30808
+ tileBudgetMb: number().int().min(0).max(1024)
30774
30809
  });
30775
30810
  /**
30776
- * The values in force when the operator has set nothing — byte-for-byte the
30777
- * constants the decode worker shipped with as env-var defaults, so making these
30778
- * settings changed no behaviour on the day it landed.
30811
+ * The values in force when the operator has set nothing.
30812
+ *
30813
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
30814
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
30815
+ * in the same change that redefines it would make a regression and a retune
30816
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
30817
+ * live traffic.
30779
30818
  */
30780
30819
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30781
- ttlMs: 1200,
30820
+ holdFrames: 8,
30782
30821
  budgetMb: 1024,
30783
30822
  activityMs: 15e3,
30823
+ tileBudgetMb: 64,
30784
30824
  admission: "inferred"
30785
30825
  };
30786
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
30826
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30787
30827
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30788
30828
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
30829
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30789
30830
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30790
30831
  //#endregion
30791
30832
  //#region src/static-turn.addon.ts
@@ -23589,13 +23589,24 @@ method(object({
23589
23589
  /** Playback-speed multiplier for the render (1 = realtime). */
23590
23590
  var ExportSpeedSchema = number().min(.25).max(32);
23591
23591
  /**
23592
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23592
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
23593
23593
  *
23594
- * Relative and not absolute epoch on purpose: the renderer's frame-select
23595
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23596
- * playlist. Handing it absolute epochs would make every call site responsible
23597
- * for the same subtraction, and the one that forgot would emit a filter that
23598
- * selects nothing silently, as a uniform timelapse.
23594
+ * **Wall clock, not ffmpeg's `t`** and the recorder translates. A caller
23595
+ * derives these bounds from things that happened at a TIME (a track's
23596
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
23597
+ * every segment present for the range, with each recording GAP removed. The
23598
+ * two agree only on a window that recorded without one interruption, and only
23599
+ * the render side knows the segments, so the translation lives there
23600
+ * (`export-dense-map.ts`, addon-pipeline).
23601
+ *
23602
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
23603
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
23604
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
23605
+ * the video was a uniform timelapse, and the log line reported the five ranges
23606
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
23607
+ *
23608
+ * Relative and not absolute epoch, because an absolute epoch would make every
23609
+ * call site responsible for the same subtraction.
23599
23610
  */
23600
23611
  var ExportDenseRangeSchema = object({
23601
23612
  fromSec: number().nonnegative(),
@@ -30725,25 +30736,32 @@ object({
30725
30736
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
30726
30737
  object({
30727
30738
  /**
30728
- * How long a retained native frame is served before it counts as a miss.
30739
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
30740
+ * detection result.
30729
30741
  *
30730
- * Must cover the FULL late-crop horizon: detection inference + the
30731
- * cross-process inference-result hop to hub post-analysis + tracking + the
30732
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
30733
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
30734
- * RAM per busy camera grows linearly with no measured hit-rate gain.
30742
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
30743
+ * a time window was never related to the event the pixels were waiting for.
30744
+ * A held frame now lives from delivery until the runner has its `FrameResult`
30745
+ * at which moment the runner cuts the subject tiles it actually wanted and
30746
+ * releases the frame. The bound exists only so a runner that stops answering
30747
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
30748
+ *
30749
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
30750
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
30751
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
30752
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
30753
+ * `holdOverflow` on the metrics line is what says you need it.
30735
30754
  */
30736
- ttlMs: number().int().min(250).max(1e4),
30755
+ holdFrames: number().int().min(1).max(64),
30737
30756
  /**
30738
30757
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
30739
30758
  *
30740
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
30741
- * which one is actually binding before reasoning from that. At the shipped
30742
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
30743
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
30744
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
30745
- * change that admits fewer frames buys retention WINDOW at constant RAM
30746
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
30759
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
30760
+ * is what decides how much is held, and the ceiling is the number above which
30761
+ * something is wrong. Before that it was the effective cap at 1024 MB with
30762
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
30763
+ * with the TTL expiring nothing, which is exactly the confusion the hold
30764
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
30747
30765
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
30748
30766
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
30749
30767
  * to replace).
@@ -30769,22 +30787,45 @@ object({
30769
30787
  * there is the signal that some caller names frames outside the inference set
30770
30788
  * and that this must go back to `all`.
30771
30789
  */
30772
- admission: NativeLeaseAdmissionSchema
30790
+ admission: NativeLeaseAdmissionSchema,
30791
+ /**
30792
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
30793
+ * compressed native crops the worker cuts at the moment a frame's detection
30794
+ * result arrives, and keeps long after the frame itself is freed.
30795
+ *
30796
+ * This is the knob that replaced the old retention window, and it buys about
30797
+ * three orders of magnitude more of it: a tile is one subject at native
30798
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
30799
+ * the frame it was cut from. A frame on which nothing was detected costs
30800
+ * nothing at all, which is the real change — the old lease paid per FRAME and
30801
+ * was interrogated per SUBJECT.
30802
+ *
30803
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
30804
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
30805
+ * reproduce that.
30806
+ */
30807
+ tileBudgetMb: number().int().min(0).max(1024)
30773
30808
  });
30774
30809
  /**
30775
- * The values in force when the operator has set nothing — byte-for-byte the
30776
- * constants the decode worker shipped with as env-var defaults, so making these
30777
- * settings changed no behaviour on the day it landed.
30810
+ * The values in force when the operator has set nothing.
30811
+ *
30812
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
30813
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
30814
+ * in the same change that redefines it would make a regression and a retune
30815
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
30816
+ * live traffic.
30778
30817
  */
30779
30818
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
30780
- ttlMs: 1200,
30819
+ holdFrames: 8,
30781
30820
  budgetMb: 1024,
30782
30821
  activityMs: 15e3,
30822
+ tileBudgetMb: 64,
30783
30823
  admission: "inferred"
30784
30824
  };
30785
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
30825
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
30786
30826
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
30787
30827
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
30828
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
30788
30829
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
30789
30830
  //#endregion
30790
30831
  //#region src/static-turn.addon.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-static-turn",
3
- "version": "1.2.13",
3
+ "version": "1.2.14",
4
4
  "description": "Static / self-hosted (coturn) TURN provider for CamStack",
5
5
  "keywords": [
6
6
  "camstack",