@trillboards/edge-platform-rtsp 0.2.17 → 0.2.20
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/LiveViewH264Capture.d.ts +39 -0
- package/dist/LiveViewH264Capture.d.ts.map +1 -0
- package/dist/LiveViewH264Capture.js +211 -0
- package/dist/LiveViewH264Capture.js.map +1 -0
- package/dist/MainStreamSession.d.ts +426 -0
- package/dist/MainStreamSession.d.ts.map +1 -0
- package/dist/MainStreamSession.js +1269 -0
- package/dist/MainStreamSession.js.map +1 -0
- package/dist/RTSPStreamCameraProvider.d.ts +72 -0
- package/dist/RTSPStreamCameraProvider.d.ts.map +1 -1
- package/dist/RTSPStreamCameraProvider.js +125 -4
- package/dist/RTSPStreamCameraProvider.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
export interface H264AccessUnit {
|
|
5
|
+
bytes: Buffer;
|
|
6
|
+
randomAccess: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** FFmpeg inserts AUD delimiters. Hold at most one incomplete unit. */
|
|
9
|
+
export declare class H264AccessUnits {
|
|
10
|
+
private readonly buffer;
|
|
11
|
+
private length;
|
|
12
|
+
private scanned;
|
|
13
|
+
private started;
|
|
14
|
+
push(chunk: Buffer): H264AccessUnit[];
|
|
15
|
+
private scan;
|
|
16
|
+
}
|
|
17
|
+
export declare function liveViewRtspInput(rtspUrl: string): {
|
|
18
|
+
args: string[];
|
|
19
|
+
input: string;
|
|
20
|
+
};
|
|
21
|
+
export interface LiveViewCaptureDiagnostic {
|
|
22
|
+
stage: 'started' | 'first_access_unit' | 'ended';
|
|
23
|
+
reason: 'none' | 'aborted' | 'first_unit_timeout' | 'frame_stall' | 'spawn_failed' | 'input_failed' | 'stream_failed' | 'submission_failed' | 'process_ended';
|
|
24
|
+
elapsedMs: number;
|
|
25
|
+
inputBytes: number;
|
|
26
|
+
parsedUnits: number;
|
|
27
|
+
submittedUnits: number;
|
|
28
|
+
exitCode: number | null;
|
|
29
|
+
rtspStatus: number | null;
|
|
30
|
+
}
|
|
31
|
+
/** Run in the owned media worker, inside its kill-on-close Windows job. */
|
|
32
|
+
export declare function runLiveViewH264Capture({ ffmpegPath, rtspUrl, signal, onAccessUnit, onDiagnostic, }: {
|
|
33
|
+
ffmpegPath: string;
|
|
34
|
+
rtspUrl: string;
|
|
35
|
+
signal: AbortSignal;
|
|
36
|
+
onAccessUnit(bytes: Buffer, timestamp: number): void | Promise<void>;
|
|
37
|
+
onDiagnostic?(event: Readonly<LiveViewCaptureDiagnostic>): void;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
//# sourceMappingURL=LiveViewH264Capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveViewH264Capture.d.ts","sourceRoot":"","sources":["../src/LiveViewH264Capture.ts"],"names":[],"mappings":";;;AASA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,uEAAuE;AACvE,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoD;IAC3E,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAS;IAExB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE;IAWrC,OAAO,CAAC,IAAI;CAuBb;AAeD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAoBpF;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,SAAS,GAAG,mBAAmB,GAAG,OAAO,CAAC;IACjD,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,oBAAoB,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,mBAAmB,GAAG,eAAe,CAAC;IAC9J,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,2EAA2E;AAC3E,wBAAsB,sBAAsB,CAAC,EAC3C,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GACxD,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,YAAY,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;CACjE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuFhB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runLiveViewH264Capture = exports.liveViewRtspInput = exports.H264AccessUnits = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const RTSPCameraProvider_1 = require("./RTSPCameraProvider");
|
|
6
|
+
const startCode = Buffer.of(0, 0, 1);
|
|
7
|
+
const maxUnitBytes = 256 * 1024;
|
|
8
|
+
const maxInputBlock = 64 * 1024;
|
|
9
|
+
const cameraTimeoutMs = 4000;
|
|
10
|
+
const firstUnitTimeoutMs = 10000;
|
|
11
|
+
/** FFmpeg inserts AUD delimiters. Hold at most one incomplete unit. */
|
|
12
|
+
class H264AccessUnits {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.buffer = Buffer.allocUnsafe(maxUnitBytes + maxInputBlock);
|
|
15
|
+
this.length = 0;
|
|
16
|
+
this.scanned = 0;
|
|
17
|
+
this.started = false;
|
|
18
|
+
}
|
|
19
|
+
push(chunk) {
|
|
20
|
+
const units = [];
|
|
21
|
+
for (let offset = 0; offset < chunk.length; offset += maxInputBlock) {
|
|
22
|
+
const block = chunk.subarray(offset, offset + maxInputBlock);
|
|
23
|
+
block.copy(this.buffer, this.length);
|
|
24
|
+
this.length += block.length;
|
|
25
|
+
this.scan(units);
|
|
26
|
+
}
|
|
27
|
+
return units;
|
|
28
|
+
}
|
|
29
|
+
scan(units) {
|
|
30
|
+
const data = this.buffer.subarray(0, this.length);
|
|
31
|
+
let first = 0;
|
|
32
|
+
let scan = this.scanned;
|
|
33
|
+
for (;;) {
|
|
34
|
+
const prefix = data.indexOf(startCode, scan);
|
|
35
|
+
if (prefix < 0 || prefix + 3 >= data.length)
|
|
36
|
+
break;
|
|
37
|
+
scan = prefix + 4;
|
|
38
|
+
if ((data[prefix + 3] & 31) !== 9)
|
|
39
|
+
continue;
|
|
40
|
+
const at = prefix > 0 && data[prefix - 1] === 0 ? prefix - 1 : prefix;
|
|
41
|
+
if (this.started) {
|
|
42
|
+
const bytes = data.subarray(first, at);
|
|
43
|
+
if (bytes.length > maxUnitBytes)
|
|
44
|
+
throw new Error('H.264 access unit exceeded its limit.');
|
|
45
|
+
units.push({ bytes: Buffer.from(bytes), randomAccess: independentlyDecodable(bytes) });
|
|
46
|
+
first = at;
|
|
47
|
+
}
|
|
48
|
+
this.started = true;
|
|
49
|
+
}
|
|
50
|
+
this.length -= first;
|
|
51
|
+
if (this.length > maxUnitBytes)
|
|
52
|
+
throw new Error('H.264 access unit exceeded its limit.');
|
|
53
|
+
this.scanned = Math.max(scan, data.length - 3) - first;
|
|
54
|
+
if (first)
|
|
55
|
+
this.buffer.copyWithin(0, first, data.length);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.H264AccessUnits = H264AccessUnits;
|
|
59
|
+
function independentlyDecodable(bytes) {
|
|
60
|
+
let mask = 0;
|
|
61
|
+
let from = 0;
|
|
62
|
+
for (;;) {
|
|
63
|
+
const index = bytes.indexOf(startCode, from);
|
|
64
|
+
if (index < 0 || index + 3 >= bytes.length)
|
|
65
|
+
break;
|
|
66
|
+
mask |= 1 << (bytes[index + 3] & 31);
|
|
67
|
+
from = index + 4;
|
|
68
|
+
}
|
|
69
|
+
const required = (1 << 5) | (1 << 7) | (1 << 8);
|
|
70
|
+
return (mask & required) === required;
|
|
71
|
+
}
|
|
72
|
+
function liveViewRtspInput(rtspUrl) {
|
|
73
|
+
if (!/^rtsps?:\/\//i.test(rtspUrl) || /[\x00-\x20\x7f]/.test(rtspUrl) || rtspUrl.length > 4096) {
|
|
74
|
+
throw new Error('Invalid live-view RTSP feed.');
|
|
75
|
+
}
|
|
76
|
+
const url = new URL(rtspUrl);
|
|
77
|
+
if (!url.hostname || url.hash)
|
|
78
|
+
throw new Error('Invalid live-view RTSP feed.');
|
|
79
|
+
return {
|
|
80
|
+
args: [
|
|
81
|
+
'-hide_banner', '-nostdin', '-loglevel', 'error', '-protocol_whitelist', 'pipe,crypto,tcp,tls,rtp,rtsp,udp',
|
|
82
|
+
'-safe', '0', '-f', 'concat', '-i', 'pipe:0', '-map', '0:v:0', '-c:v', 'copy',
|
|
83
|
+
// RTSP cameras can advertise SPS/PPS out of band in the SDP. Attach
|
|
84
|
+
// that extradata to keyframes before inserting the framing delimiter.
|
|
85
|
+
'-an', '-sn', '-dn', '-bsf:v', 'h264_mp4toannexb,dump_extra=freq=keyframe,h264_metadata=aud=insert',
|
|
86
|
+
'-f', 'h264', 'pipe:1',
|
|
87
|
+
],
|
|
88
|
+
input: [
|
|
89
|
+
'ffconcat version 1.0', "file '" + (0, RTSPCameraProvider_1.escapeFfconcatValue)(url.href) + "'",
|
|
90
|
+
'option rtsp_transport tcp', 'option timeout ' + cameraTimeoutMs * 1000, '',
|
|
91
|
+
].join('\n'),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
exports.liveViewRtspInput = liveViewRtspInput;
|
|
95
|
+
/** Run in the owned media worker, inside its kill-on-close Windows job. */
|
|
96
|
+
async function runLiveViewH264Capture({ ffmpegPath, rtspUrl, signal, onAccessUnit, onDiagnostic, }) {
|
|
97
|
+
if (signal.aborted)
|
|
98
|
+
return;
|
|
99
|
+
const { args, input } = liveViewRtspInput(rtspUrl);
|
|
100
|
+
const parser = new H264AccessUnits();
|
|
101
|
+
const startedAt = performance.now();
|
|
102
|
+
let reason = 'none';
|
|
103
|
+
let inputBytes = 0, parsedUnits = 0, submittedUnits = 0;
|
|
104
|
+
let rtspStatus = null;
|
|
105
|
+
let stderrTail = '';
|
|
106
|
+
const proc = (0, node_child_process_1.spawn)(ffmpegPath, args, { stdio: ['pipe', 'pipe', 'pipe'], windowsHide: true });
|
|
107
|
+
const diagnostic = (stage) => {
|
|
108
|
+
// Closed, bounded fields only: never include URLs, stderr or exception text.
|
|
109
|
+
try {
|
|
110
|
+
onDiagnostic?.(Object.freeze({ stage, reason, elapsedMs: Math.max(0, Math.floor(performance.now() - startedAt)),
|
|
111
|
+
inputBytes, parsedUnits, submittedUnits, exitCode: Number.isInteger(proc.exitCode) ? proc.exitCode : null, rtspStatus }));
|
|
112
|
+
}
|
|
113
|
+
catch { /* A full disk or broken observer cannot interfere with cleanup. */ }
|
|
114
|
+
};
|
|
115
|
+
const closed = new Promise(resolve => proc.once('close', () => resolve()));
|
|
116
|
+
let finishStop = () => undefined;
|
|
117
|
+
const stopped = new Promise(resolve => { finishStop = resolve; });
|
|
118
|
+
let stopping = false;
|
|
119
|
+
let timer;
|
|
120
|
+
let qualified = false;
|
|
121
|
+
let timestamp = 0;
|
|
122
|
+
const stop = () => {
|
|
123
|
+
if (stopping)
|
|
124
|
+
return;
|
|
125
|
+
stopping = true;
|
|
126
|
+
clearTimeout(timer);
|
|
127
|
+
finishStop();
|
|
128
|
+
if (proc.exitCode === null && proc.signalCode === null)
|
|
129
|
+
proc.kill();
|
|
130
|
+
};
|
|
131
|
+
const fail = (next) => { if (reason === 'none')
|
|
132
|
+
reason = next; stop(); };
|
|
133
|
+
const abort = () => { fail('aborted'); };
|
|
134
|
+
const watch = () => {
|
|
135
|
+
clearTimeout(timer);
|
|
136
|
+
timer = setTimeout(() => fail(qualified ? 'frame_stall' : 'first_unit_timeout'), qualified ? cameraTimeoutMs : firstUnitTimeoutMs);
|
|
137
|
+
timer.unref?.();
|
|
138
|
+
};
|
|
139
|
+
const stderr = (chunk) => {
|
|
140
|
+
// Retain at most a tiny in-memory tail to handle status lines split across chunks.
|
|
141
|
+
stderrTail = (stderrTail + chunk.toString('utf8')).slice(-512);
|
|
142
|
+
const status = /(?:method [A-Z_]+ failed:|Server returned|returned)\s*(401|403|404|453|454)\b/i.exec(stderrTail);
|
|
143
|
+
if (status)
|
|
144
|
+
rtspStatus = Number(status[1]);
|
|
145
|
+
};
|
|
146
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
147
|
+
proc.on('error', () => fail('spawn_failed'));
|
|
148
|
+
proc.stdin.on('error', () => fail('input_failed'));
|
|
149
|
+
proc.stderr.on('data', stderr);
|
|
150
|
+
proc.stderr.on('error', () => { });
|
|
151
|
+
diagnostic('started');
|
|
152
|
+
try {
|
|
153
|
+
if (signal.aborted)
|
|
154
|
+
abort();
|
|
155
|
+
else {
|
|
156
|
+
watch();
|
|
157
|
+
proc.stdin.end(input);
|
|
158
|
+
for await (const chunk of proc.stdout) {
|
|
159
|
+
if (stopping || signal.aborted)
|
|
160
|
+
break;
|
|
161
|
+
inputBytes = Math.min(Number.MAX_SAFE_INTEGER, inputBytes + chunk.length);
|
|
162
|
+
for (const unit of parser.push(chunk)) {
|
|
163
|
+
if (stopping || signal.aborted)
|
|
164
|
+
break;
|
|
165
|
+
parsedUnits = Math.min(Number.MAX_SAFE_INTEGER, parsedUnits + 1);
|
|
166
|
+
if (!qualified && !unit.randomAccess)
|
|
167
|
+
continue;
|
|
168
|
+
if (!qualified) {
|
|
169
|
+
qualified = true;
|
|
170
|
+
diagnostic('first_access_unit');
|
|
171
|
+
}
|
|
172
|
+
watch();
|
|
173
|
+
timestamp = Math.max(timestamp + 1, Math.floor(performance.now() * 90));
|
|
174
|
+
try {
|
|
175
|
+
// Count only resolved submissions; a watchdog/abort winning the race is not a send.
|
|
176
|
+
const sent = await Promise.race([Promise.resolve(onAccessUnit(unit.bytes, timestamp >>> 0)).then(() => true), stopped.then(() => false)]);
|
|
177
|
+
if (sent)
|
|
178
|
+
submittedUnits = Math.min(Number.MAX_SAFE_INTEGER, submittedUnits + 1);
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
if (reason === 'none')
|
|
182
|
+
reason = 'submission_failed';
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (!signal.aborted) {
|
|
189
|
+
if (reason === 'none')
|
|
190
|
+
reason = 'process_ended';
|
|
191
|
+
throw new Error('Capture ended unexpectedly.');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
if (!signal.aborted) {
|
|
196
|
+
if (reason === 'none')
|
|
197
|
+
reason = 'stream_failed';
|
|
198
|
+
throw new Error('Live-view H.264 capture failed.');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
finally {
|
|
202
|
+
stop();
|
|
203
|
+
signal.removeEventListener('abort', abort);
|
|
204
|
+
await closed;
|
|
205
|
+
proc.stderr.removeListener('data', stderr);
|
|
206
|
+
stderrTail = '';
|
|
207
|
+
diagnostic('ended');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.runLiveViewH264Capture = runLiveViewH264Capture;
|
|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