@trillboards/edge-platform-rtsp 0.2.19 → 0.2.21

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.
@@ -0,0 +1,426 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ import { spawn } from 'child_process';
6
+ import { EventEmitter } from 'events';
7
+ import { type AdoptedSegmentInput, type RecordedSegment, type SegmentStreamInfo } from './RTSPStreamCameraProvider';
8
+ /**
9
+ * MainStreamSession — the camera's MAIN stream, on a session of its own.
10
+ *
11
+ * A connector feed reads each camera's SUBSTREAM (640x480 / 800x448 on the Texas
12
+ * recorder), where a hand is 5-10 px. Whether a model can see theft in the act
13
+ * on full-resolution pixels is a question about the MAIN stream, so this module
14
+ * opens it beside the feed's substream session, on the store PC, as cheaply as
15
+ * a stream can be read: one RTSP session, every output a stream copy.
16
+ *
17
+ * ── ONE SESSION, PLUGGABLE OUTPUTS ────────────────────────────────────────
18
+ *
19
+ * The session owns the process: the input (credentials in a 0600 ffconcat file,
20
+ * never argv), its admission, its stderr, its clock, its restarts. Everything it
21
+ * PRODUCES is an output (`MainStreamOutput`): each contributes its own ffmpeg
22
+ * output arguments to the next session and handles what it writes. The ring
23
+ * recorder is one output (`MainStreamRingOutput`: segments into the feed's local
24
+ * ring). A second output — a decoded face-zone crop for one camera, say — is a
25
+ * second class implementing the same interface, added with `addOutput`; the
26
+ * session restarts once to carry it and the recorder is untouched. At most one
27
+ * output may claim the session's stdout (`pipe:1`).
28
+ *
29
+ * ── NO DECODE, AND THEREFORE NO LOOKS ─────────────────────────────────────
30
+ *
31
+ * The ring output is `-map 0:v -c:v copy` into the segment muxer, exactly the
32
+ * second output the substream session has always used (`buildSegmentOutputArgs`,
33
+ * audio left out): ffmpeg opens no decoder for a stream it only copies, scales
34
+ * nothing and emits no frame. Nothing here is a `CameraProvider`, so no look,
35
+ * detector call or review can read from it: a camera that records its main
36
+ * stream and has no alert route is looked at exactly as before (its substream
37
+ * provider is idle and pulls one health frame a minute).
38
+ *
39
+ * ── BOUNDED AGAINST THE RECORDER ──────────────────────────────────────────
40
+ *
41
+ * Main-stream sessions — the probe and the recorder alike — are admitted from
42
+ * their OWN lane per physical recorder (`captureSourceKey`: host:port), capped
43
+ * at `DEFAULT_MAX_MAIN_STREAM_SESSIONS_PER_SOURCE` (1). The substream lanes
44
+ * (`CaptureAdmission`, the persistent-session lane) are untouched by a probe,
45
+ * which is the shape `RTSPAudioProvider` took for the same reason: a long-lived
46
+ * pull must never take a slot the frame path counts on. A RECORDING session
47
+ * additionally holds a priority-0 ticket in the recorder's persistent-session
48
+ * lane, so a recorder that turns out to be full sheds the main-stream recording
49
+ * before any feed and never before an alert camera (priority 1). The lane never
50
+ * queues: a refused session reports `session_limit` and tries again after the
51
+ * restart delay. Restarts double from `MAIN_STREAM_RESTART_BASE_MS` to
52
+ * `MAIN_STREAM_RESTART_MAX_MS` (one an hour on a fault that persists); a session
53
+ * that ran `MAIN_STREAM_HEALTHY_RUN_MS` resets the delay.
54
+ *
55
+ * ── THE CLOCK ─────────────────────────────────────────────────────────────
56
+ *
57
+ * The substream session dates its segments from its first DECODED frame. This
58
+ * session decodes nothing, so it reads ffmpeg's `-progress` instead: every half
59
+ * second ffmpeg reports how far into the output it is (`out_time_us`), and
60
+ * `wall clock - out_time` is when output time 0 happened. The smallest value
61
+ * over the last minute (`MAIN_STREAM_CLOCK_WINDOW_MS`) is the least-delayed
62
+ * report, and following it lets the anchor track a camera clock that drifts
63
+ * against the PC's over a session that runs for days.
64
+ */
65
+ /** Main-stream sessions (probe or recorder) one connector holds per recorder host:port. */
66
+ export declare const DEFAULT_MAX_MAIN_STREAM_SESSIONS_PER_SOURCE = 1;
67
+ /** First restart delay after a session ends; doubles to the max. */
68
+ export declare const MAIN_STREAM_RESTART_BASE_MS = 10000;
69
+ /** Ceiling on the restart delay: at most one retry an hour against a fault that persists. */
70
+ export declare const MAIN_STREAM_RESTART_MAX_MS = 3600000;
71
+ /** A session that ran this long, with output flowing, resets the restart delay. */
72
+ export declare const MAIN_STREAM_HEALTHY_RUN_MS = 60000;
73
+ /** A session whose output has not started this long after spawn is killed (and counted). */
74
+ export declare const MAIN_STREAM_STARTUP_TIMEOUT_MS = 30000;
75
+ /** The window the clock's minimum is taken over. */
76
+ export declare const MAIN_STREAM_CLOCK_WINDOW_MS = 60000;
77
+ /** Session work directories of the main-stream recorder: never the substream's `rec-`. */
78
+ export declare const MAIN_STREAM_WORKDIR_PREFIX = "main-";
79
+ /**
80
+ * One main-stream session slot on the recorder this URL names, or null when the
81
+ * connector already holds as many as `limit` there (or the URL names no
82
+ * recorder). Never queues. Release it exactly once.
83
+ */
84
+ export declare function acquireMainStreamSlot(streamUrl: string, limit?: number): (() => void) | null;
85
+ /** Live main-stream occupancy for a recorder, for diagnostics. */
86
+ export declare function mainStreamSessionStatsFor(streamUrl: string): {
87
+ key: string;
88
+ active: number;
89
+ limit: number;
90
+ } | null;
91
+ /** Test seam: forget every recorder's main-stream lane. */
92
+ export declare function __resetMainStreamAdmissionForTests(): void;
93
+ /**
94
+ * ffmpeg input args for an RTSP URL: the URL goes into a 0600 ffconcat file and
95
+ * only the file's path reaches argv, exactly as every provider in this package
96
+ * does, so a password (an XMEye path carries one) never appears in `ps` output.
97
+ */
98
+ export declare function buildMainStreamInputArgs(o: {
99
+ rtspUrl: string;
100
+ transport: 'tcp' | 'udp';
101
+ timeoutUs: number;
102
+ ffmpegMajorVersion: number;
103
+ }): {
104
+ args: string[];
105
+ cleanup: () => void;
106
+ };
107
+ /** What an output sees of the session it rides. */
108
+ export interface MainStreamOutputContext {
109
+ /** The session's number (1-based, counting restarts). */
110
+ readonly session: number;
111
+ /** ffmpeg's description of the main stream once it printed it, else null. */
112
+ readonly input: SegmentStreamInfo | null;
113
+ /** Wall-clock ms of output time 0, from ffmpeg's progress against this host's clock; null until reported. */
114
+ readonly mediaZeroWallMs: number | null;
115
+ readonly ffmpegMajorVersion: number;
116
+ now(): number;
117
+ log(level: 'info' | 'warn', message: string): void;
118
+ /** Ask the session to re-read every output's arguments (it restarts once if they changed). */
119
+ refresh(): void;
120
+ }
121
+ /** How a session ended, as each of its outputs is told. */
122
+ export interface MainStreamSessionEnd {
123
+ exitCode: number | null;
124
+ /** Wall-clock ms the process lived. */
125
+ ranMs: number;
126
+ /** ffmpeg reported output time above 0: the main stream delivered. */
127
+ progressed: boolean;
128
+ /** Stopped on purpose (a stop, a reconfigure, a shed), not a fault. */
129
+ stopped: boolean;
130
+ /** ffmpeg's stderr, URL-scrubbed and bounded: for the caller's failure classification. */
131
+ stderr: string;
132
+ }
133
+ /**
134
+ * One output of a main-stream session. The session owns the process; an output
135
+ * owns only its own ffmpeg output arguments and what that output writes.
136
+ */
137
+ export interface MainStreamOutput {
138
+ /** Stable name; `addOutput` replaces an output of the same name. */
139
+ readonly name: string;
140
+ /**
141
+ * What this output asks of the next session, as a key that changes exactly
142
+ * when its arguments would; null to sit the session out. PURE: the session
143
+ * calls it to decide whether a running session still matches.
144
+ */
145
+ plan(ctx: MainStreamOutputContext): string | null;
146
+ /**
147
+ * Its ffmpeg output arguments for a session about to start, after `plan`
148
+ * returned a key (prepare any file it writes here). Null drops it from that
149
+ * session.
150
+ */
151
+ outputArgs(ctx: MainStreamOutputContext): string[] | null;
152
+ /** Its arguments write to the session's stdout (`pipe:1`); at most one output may. */
153
+ readonly writesStdout?: boolean;
154
+ /** ffmpeg described the input. */
155
+ onInput?(ctx: MainStreamOutputContext): void;
156
+ /** Every second while a session carrying this output runs. */
157
+ onTick?(ctx: MainStreamOutputContext): void;
158
+ /** A session that carried this output ended. */
159
+ onSessionEnd?(ctx: MainStreamOutputContext, end: MainStreamSessionEnd): void;
160
+ /** The session's stdout (`pipe:1`), for the one output whose arguments write there. */
161
+ onStdout?(chunk: Buffer): void;
162
+ }
163
+ export type MainStreamSessionState =
164
+ /** No output wants a session (or `start` was never called). */
165
+ 'idle'
166
+ /** A session is spawned; its output has not started yet. */
167
+ | 'starting'
168
+ /** ffmpeg reports output flowing. */
169
+ | 'running'
170
+ /** Waiting out the restart delay after a session ended. */
171
+ | 'backoff'
172
+ /** The recorder's main-stream lane (or persistent-session lane) had no room; retrying after the delay. */
173
+ | 'session_limit'
174
+ /** `stop()` was called. */
175
+ | 'stopped';
176
+ export interface MainStreamSessionStats {
177
+ state: MainStreamSessionState;
178
+ sessions: number;
179
+ restarts: number;
180
+ input: SegmentStreamInfo | null;
181
+ mediaZeroWallMs: number | null;
182
+ outputs: string[];
183
+ nextRetryAtMs: number | null;
184
+ lastEnd: (Omit<MainStreamSessionEnd, 'stderr'> & {
185
+ atMs: number;
186
+ summary: string;
187
+ }) | null;
188
+ }
189
+ export interface MainStreamSessionConfig {
190
+ /** The camera's MAIN stream URL. Credentials never reach argv or a log line. */
191
+ rtspUrl: string;
192
+ transport?: 'tcp' | 'udp';
193
+ /** Socket I/O timeout (µs). Default 10 s. */
194
+ timeoutUs?: number;
195
+ ffmpegPath?: string;
196
+ /** For the `-timeout`/`-stimeout` split and `-min_seg_duration`. Default 6. */
197
+ ffmpegMajorVersion?: number;
198
+ /** Main-stream sessions per recorder host:port. Default 1. */
199
+ maxSessionsPerSource?: number;
200
+ /** Hold a priority-0 ticket in the recorder's persistent-session lane while running. Default true. */
201
+ sharePersistentLane?: boolean;
202
+ restartDelayMs?: number;
203
+ maxRestartDelayMs?: number;
204
+ healthyRunMs?: number;
205
+ startupTimeoutMs?: number;
206
+ spawnFn?: typeof spawn;
207
+ now?: () => number;
208
+ onLog?: (level: 'info' | 'warn', message: string) => void;
209
+ }
210
+ /**
211
+ * One long-lived ffmpeg on a camera's main stream, carrying every output that
212
+ * wants it. Events: `'state'` (MainStreamSessionState) on every change and
213
+ * `'session_end'` (MainStreamSessionEnd) when a session ends.
214
+ */
215
+ export declare class MainStreamSession extends EventEmitter {
216
+ private readonly rtspUrl;
217
+ private readonly transport;
218
+ private readonly timeoutUs;
219
+ private readonly ffmpegPath;
220
+ private readonly ffmpegMajorVersion;
221
+ private readonly maxSessionsPerSource;
222
+ private readonly sharePersistentLane;
223
+ private readonly restartDelayMs;
224
+ private readonly maxRestartDelayMs;
225
+ private readonly healthyRunMs;
226
+ private readonly startupTimeoutMs;
227
+ private readonly spawnFn;
228
+ private readonly now;
229
+ private readonly onLog?;
230
+ private readonly outputs;
231
+ private wanted;
232
+ private state;
233
+ private live;
234
+ private sessions;
235
+ private restarts;
236
+ private currentDelayMs;
237
+ private retryTimer;
238
+ private retryAtMs;
239
+ private tickTimer;
240
+ private startupTimer;
241
+ private releaseSlot;
242
+ private laneTicket;
243
+ private input;
244
+ /** (wall ms - out_time ms) per progress report over the clock window. */
245
+ private clockSamples;
246
+ private mediaZeroWallMs;
247
+ private lastEnd;
248
+ constructor(config: MainStreamSessionConfig);
249
+ /** Add (or replace, by name) an output. A running session restarts once to carry it. */
250
+ addOutput(output: MainStreamOutput): void;
251
+ removeOutput(name: string): void;
252
+ /** Want a session from now on. Idempotent. */
253
+ start(): void;
254
+ /**
255
+ * Re-read every output's arguments. A running session whose argv no longer
256
+ * matches restarts once (its replacement starts as it exits); one that no
257
+ * output wants stops and gives its slots back.
258
+ */
259
+ refresh(): void;
260
+ /** Stop for good: kill the session and release every slot. */
261
+ stop(): Promise<void>;
262
+ getStats(): MainStreamSessionStats;
263
+ getState(): MainStreamSessionState;
264
+ private context;
265
+ /** The outputs that want the next session, in add order, and their joined plan key; null when none does. */
266
+ private plan;
267
+ private ensureSession;
268
+ private spawnSession;
269
+ private onStderr;
270
+ /** One -progress report: advance the clock and mark the stream as delivering. */
271
+ private onProgress;
272
+ private tick;
273
+ private onEnd;
274
+ private shed;
275
+ private refused;
276
+ private scheduleRetry;
277
+ private clearRetry;
278
+ private killLive;
279
+ private releaseSlots;
280
+ private setState;
281
+ private log;
282
+ }
283
+ /** Where the ring output puts a closed segment: the feed's ring (RTSPStreamCameraProvider.adoptSegment). */
284
+ export interface SegmentRingSink {
285
+ adoptSegment(input: AdoptedSegmentInput): RecordedSegment | null;
286
+ }
287
+ /** What the ring output records. Null (or `enabled: false`) records nothing. */
288
+ export interface MainStreamRingConfig {
289
+ /** The feed's directory: the ring is `<dir>/closed/`, this output's work directories `<dir>/main-*`. */
290
+ dir: string;
291
+ /** `-segment_time` (10 for the local buffer, the continuous knob otherwise). */
292
+ segmentSeconds: number;
293
+ /** The label stamped on every segment (`buffer` for the local buffer), or null. */
294
+ label: string | null;
295
+ enabled: boolean;
296
+ /** The codec the probe measured: decides the hvc1 tag from the first session. */
297
+ codec?: string | null;
298
+ }
299
+ export type MainStreamRingState = 'off'
300
+ /** Configured on; the session has not written a segment yet. */
301
+ | 'waiting' | 'recording'
302
+ /** The main stream is not H.264 or HEVC, which the index cannot hold. */
303
+ | 'unsupported_codec';
304
+ export interface MainStreamRingStats {
305
+ state: MainStreamRingState;
306
+ segmentsClosed: number;
307
+ segmentsRecovered: number;
308
+ secondsClosed: number;
309
+ bytesClosed: number;
310
+ /** Bytes per second of the segments this output closed, or null before the first. */
311
+ measuredBytesPerSec: number | null;
312
+ partialsDeleted: number;
313
+ lastSegmentAtMs: number | null;
314
+ lastError: string | null;
315
+ }
316
+ /**
317
+ * The main-stream RECORDER: a stream copy of the main stream's video into the
318
+ * segment muxer, every closed segment handed to the feed's ring (`sink`), where
319
+ * the alert-window cut, the uploader and the buffer report find it exactly as
320
+ * they find a substream segment. Same file shape (`buildSegmentOutputArgs`,
321
+ * video only), same sidecar and name (the sink writes them), the work
322
+ * directories prefixed `main-` so the substream session's recovery never reads
323
+ * a live one. Leftovers of an earlier process are handed to the sink once,
324
+ * before this output's first session.
325
+ */
326
+ export declare class MainStreamRingOutput implements MainStreamOutput {
327
+ readonly name = "ring";
328
+ private readonly sink;
329
+ private config;
330
+ private work;
331
+ private recoveredFor;
332
+ private unsupportedCodec;
333
+ private readonly counters;
334
+ private readonly now;
335
+ constructor(options: {
336
+ sink: SegmentRingSink;
337
+ now?: () => number;
338
+ });
339
+ /** Change what to record; the session's `refresh` restarts it once when the arguments change. */
340
+ setRecording(next: MainStreamRingConfig | null): void;
341
+ getConfig(): MainStreamRingConfig | null;
342
+ getStats(): MainStreamRingStats;
343
+ plan(ctx: MainStreamOutputContext): string | null;
344
+ outputArgs(ctx: MainStreamOutputContext): string[] | null;
345
+ onInput(ctx: MainStreamOutputContext): void;
346
+ onTick(ctx: MainStreamOutputContext): void;
347
+ onSessionEnd(ctx: MainStreamOutputContext, _end: MainStreamSessionEnd): void;
348
+ private readList;
349
+ /** Hand every listed segment to the ring, in list order; a refused move waits for the next tick. */
350
+ private flush;
351
+ /**
352
+ * When a segment's first frame was captured: the session's progress clock,
353
+ * held to the one fact a close gives — a segment cannot end after it was seen
354
+ * closed. Without a clock yet, its end is the moment it was seen closed.
355
+ */
356
+ private captureStartFor;
357
+ private persistAnchor;
358
+ /**
359
+ * Hand out what an earlier process left in `<dir>/main-*`: listed segments go
360
+ * to the ring (recovered), everything else is a partial and is deleted.
361
+ */
362
+ private recover;
363
+ private recoverWorkDir;
364
+ private removeWorkDir;
365
+ private unlink;
366
+ }
367
+ export interface MainStreamProbeOptions {
368
+ rtspUrl: string;
369
+ transport?: 'tcp' | 'udp';
370
+ ffmpegPath?: string;
371
+ ffmpegMajorVersion?: number;
372
+ /** Socket I/O timeout (µs). Default 10 s. */
373
+ timeoutUs?: number;
374
+ /** Media seconds of packets to measure. Default 5. */
375
+ sampleSeconds?: number;
376
+ /** Hard wall-clock bound: ffmpeg is killed at it. Default 25 s. */
377
+ deadlineMs?: number;
378
+ spawnFn?: typeof spawn;
379
+ now?: () => number;
380
+ }
381
+ export interface MainStreamProbeResult {
382
+ /** ffmpeg's description of the main stream (codec, size, nominal fps), or null. */
383
+ stream: SegmentStreamInfo | null;
384
+ /** Video packets copied in the sample, their bytes, and the media seconds they span. */
385
+ packets: number;
386
+ bytes: number;
387
+ mediaSeconds: number | null;
388
+ /** Measured: packets per media second, else the stream's nominal rate. */
389
+ fps: number | null;
390
+ /** Measured: packet bytes x 8 / media seconds. */
391
+ bitrateBps: number | null;
392
+ /** ffmpeg opened the input (the recorder answered DESCRIBE/SETUP). */
393
+ inputOpened: boolean;
394
+ timedOut: boolean;
395
+ exitCode: number | null;
396
+ /** ffmpeg's stderr, URL-scrubbed and bounded: the caller classifies a failure from it. */
397
+ stderr: string;
398
+ elapsedMs: number;
399
+ }
400
+ /** The probe's argv after the input: the first video stream, copied, ~`sampleSeconds`, as packet lines. */
401
+ export declare function buildMainStreamProbeOutputArgs(sampleSeconds: number): string[];
402
+ /**
403
+ * Read ffmpeg's `framecrc` packet lines: `#tb 0: 1/90000` gives the time base,
404
+ * then one line per packet, `stream, dts, pts, duration, size, crc[, F=..]`.
405
+ */
406
+ export declare class FramecrcPacketReader {
407
+ private partial;
408
+ private tb;
409
+ packets: number;
410
+ bytes: number;
411
+ private firstPts;
412
+ private lastEnd;
413
+ push(text: string): void;
414
+ /** Media seconds from the first packet's pts to the last packet's end, or null. */
415
+ mediaSeconds(): number | null;
416
+ }
417
+ /**
418
+ * One bounded look at a main stream: ffmpeg copies about `sampleSeconds` of its
419
+ * video packets (no decode) and reports each one; the probe measures the size,
420
+ * codec, frame rate and bitrate the camera really sends. Killed at `deadlineMs`
421
+ * whatever happens. Never retries: a refusal, an auth failure or a timeout is
422
+ * what the caller reports. The caller holds the recorder's main-stream slot
423
+ * (`acquireMainStreamSlot`) around it.
424
+ */
425
+ export declare function probeMainStream(options: MainStreamProbeOptions): Promise<MainStreamProbeResult>;
426
+ //# sourceMappingURL=MainStreamSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MainStreamSession.d.ts","sourceRoot":"","sources":["../src/MainStreamSession.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAUtC,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAEpB,KAAK,iBAAiB,EACvB,M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