node-av 6.1.1 → 6.2.0-beta.1
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/api/filter-complex.d.ts +16 -10
- package/dist/api/filter-complex.js +129 -81
- package/dist/api/filter-complex.js.map +1 -1
- package/dist/api/filter-presets.d.ts +15 -1
- package/dist/api/filter-presets.js +23 -5
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/fmp4-stream.d.ts +45 -1
- package/dist/api/fmp4-stream.js +155 -6
- package/dist/api/fmp4-stream.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/pipeline.d.ts +120 -0
- package/dist/api/pipeline.js +2 -2
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/rtp-stream.d.ts +101 -1
- package/dist/api/rtp-stream.js +339 -75
- package/dist/api/rtp-stream.js.map +1 -1
- package/dist/api/types.d.ts +17 -0
- package/dist/api/types.js +2 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/webrtc-stream.d.ts +15 -10
- package/dist/api/webrtc-stream.js +75 -16
- package/dist/api/webrtc-stream.js.map +1 -1
- package/dist/webrtc/index.d.ts +1 -0
- package/dist/webrtc/index.js.map +1 -1
- package/package.json +9 -9
|
@@ -2,6 +2,7 @@ import { RTCRtpCodecParameters } from 'werift';
|
|
|
2
2
|
import type { AVCodecID } from '../constants/index.js';
|
|
3
3
|
import type { Demuxer } from './demuxer.js';
|
|
4
4
|
import type { RTPStreamOptions } from './rtp-stream.js';
|
|
5
|
+
import type { MediaFrameSource } from './types.js';
|
|
5
6
|
/**
|
|
6
7
|
* Codec information for WebRTC streaming.
|
|
7
8
|
*
|
|
@@ -112,6 +113,8 @@ export declare class WebRTCStream {
|
|
|
112
113
|
private audioTrack;
|
|
113
114
|
private options;
|
|
114
115
|
private pendingIceCandidates;
|
|
116
|
+
private frameSource?;
|
|
117
|
+
private stopping;
|
|
115
118
|
/**
|
|
116
119
|
* @param options - Session configuration options
|
|
117
120
|
*
|
|
@@ -151,29 +154,31 @@ export declare class WebRTCStream {
|
|
|
151
154
|
* });
|
|
152
155
|
* ```
|
|
153
156
|
*/
|
|
154
|
-
static create(input: string | Demuxer, options?: WebRTCStreamOptions): WebRTCStream;
|
|
157
|
+
static create(input: string | Demuxer | MediaFrameSource, options?: WebRTCStreamOptions): WebRTCStream;
|
|
155
158
|
/**
|
|
156
|
-
* Start streaming media to WebRTC peer connection.
|
|
159
|
+
* Start streaming media to the WebRTC peer connection.
|
|
157
160
|
*
|
|
158
161
|
* Begins the media processing pipeline, reading packets from input,
|
|
159
|
-
* transcoding if necessary, and sending RTP packets to media tracks.
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
162
|
+
* transcoding if necessary, and sending RTP packets to the media tracks.
|
|
163
|
+
* {@link setOffer} calls this automatically after negotiating, so calling it
|
|
164
|
+
* explicitly is optional. It is idempotent - a useful pattern for demuxer
|
|
165
|
+
* inputs is calling `start()` *before* `setOffer()` so the input is open and
|
|
166
|
+
* its actual codecs are advertised in the answer.
|
|
163
167
|
*
|
|
164
|
-
* @returns Promise that resolves
|
|
168
|
+
* @returns Promise that resolves once streaming has started (runs in the background)
|
|
165
169
|
*
|
|
166
170
|
* @throws {FFmpegError} If transcoding or muxing fails
|
|
167
171
|
*
|
|
168
172
|
* @example
|
|
169
173
|
* ```typescript
|
|
170
|
-
* const session =
|
|
171
|
-
* session.onIceCandidate = (c) => sendToRemote(c);
|
|
174
|
+
* const session = WebRTCStream.create('rtsp://camera.local/stream');
|
|
172
175
|
*
|
|
176
|
+
* await session.start(); // open input so getCodecs() sees the real codecs
|
|
173
177
|
* const answer = await session.setOffer(remoteOffer);
|
|
174
178
|
* sendToRemote(answer);
|
|
175
|
-
* // Stream is already started by setOffer
|
|
176
179
|
* ```
|
|
180
|
+
*
|
|
181
|
+
* @see {@link setOffer} Which starts the stream automatically after negotiation
|
|
177
182
|
*/
|
|
178
183
|
start(): Promise<void>;
|
|
179
184
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MediaStreamTrack, RTCIceCandidate, RTCPeerConnection, RTCRtpCodecParameters, RTCSessionDescription } from 'werift';
|
|
2
2
|
import { AV_CODEC_ID_AV1, AV_CODEC_ID_H264, AV_CODEC_ID_HEVC, AV_CODEC_ID_OPUS, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_VP8, AV_CODEC_ID_VP9, } from '../constants/constants.js';
|
|
3
|
-
import { RTPStream } from './rtp-stream.js';
|
|
3
|
+
import { isMediaFrameSource, RTPStream } from './rtp-stream.js';
|
|
4
4
|
/**
|
|
5
5
|
* Complete WebRTC session management with werift integration.
|
|
6
6
|
*
|
|
@@ -69,6 +69,8 @@ export class WebRTCStream {
|
|
|
69
69
|
audioTrack = null;
|
|
70
70
|
options;
|
|
71
71
|
pendingIceCandidates = [];
|
|
72
|
+
frameSource;
|
|
73
|
+
stopping = false;
|
|
72
74
|
/**
|
|
73
75
|
* @param options - Session configuration options
|
|
74
76
|
*
|
|
@@ -117,6 +119,11 @@ export class WebRTCStream {
|
|
|
117
119
|
*/
|
|
118
120
|
static create(input, options = {}) {
|
|
119
121
|
const session = new WebRTCStream(options);
|
|
122
|
+
// Remember a frame source so negotiation can advertise the encoder's target
|
|
123
|
+
// codecs (there's no input stream to read a codec from).
|
|
124
|
+
if (isMediaFrameSource(input)) {
|
|
125
|
+
session.frameSource = input;
|
|
126
|
+
}
|
|
120
127
|
// Create stream with WebRTC-specific codec support
|
|
121
128
|
session.stream = RTPStream.create(input, {
|
|
122
129
|
video: options.video,
|
|
@@ -138,27 +145,29 @@ export class WebRTCStream {
|
|
|
138
145
|
return session;
|
|
139
146
|
}
|
|
140
147
|
/**
|
|
141
|
-
* Start streaming media to WebRTC peer connection.
|
|
148
|
+
* Start streaming media to the WebRTC peer connection.
|
|
142
149
|
*
|
|
143
150
|
* Begins the media processing pipeline, reading packets from input,
|
|
144
|
-
* transcoding if necessary, and sending RTP packets to media tracks.
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
151
|
+
* transcoding if necessary, and sending RTP packets to the media tracks.
|
|
152
|
+
* {@link setOffer} calls this automatically after negotiating, so calling it
|
|
153
|
+
* explicitly is optional. It is idempotent - a useful pattern for demuxer
|
|
154
|
+
* inputs is calling `start()` *before* `setOffer()` so the input is open and
|
|
155
|
+
* its actual codecs are advertised in the answer.
|
|
148
156
|
*
|
|
149
|
-
* @returns Promise that resolves
|
|
157
|
+
* @returns Promise that resolves once streaming has started (runs in the background)
|
|
150
158
|
*
|
|
151
159
|
* @throws {FFmpegError} If transcoding or muxing fails
|
|
152
160
|
*
|
|
153
161
|
* @example
|
|
154
162
|
* ```typescript
|
|
155
|
-
* const session =
|
|
156
|
-
* session.onIceCandidate = (c) => sendToRemote(c);
|
|
163
|
+
* const session = WebRTCStream.create('rtsp://camera.local/stream');
|
|
157
164
|
*
|
|
165
|
+
* await session.start(); // open input so getCodecs() sees the real codecs
|
|
158
166
|
* const answer = await session.setOffer(remoteOffer);
|
|
159
167
|
* sendToRemote(answer);
|
|
160
|
-
* // Stream is already started by setOffer
|
|
161
168
|
* ```
|
|
169
|
+
*
|
|
170
|
+
* @see {@link setOffer} Which starts the stream automatically after negotiation
|
|
162
171
|
*/
|
|
163
172
|
async start() {
|
|
164
173
|
await this.stream.start();
|
|
@@ -180,12 +189,21 @@ export class WebRTCStream {
|
|
|
180
189
|
* ```
|
|
181
190
|
*/
|
|
182
191
|
async stop() {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
if (this.stopping) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
this.stopping = true;
|
|
196
|
+
try {
|
|
197
|
+
await this.stream.stop();
|
|
198
|
+
this.pc?.close();
|
|
199
|
+
this.videoTrack = null;
|
|
200
|
+
this.audioTrack = null;
|
|
201
|
+
this.pc = null;
|
|
202
|
+
this.pendingIceCandidates = [];
|
|
203
|
+
}
|
|
204
|
+
finally {
|
|
205
|
+
this.stopping = false;
|
|
206
|
+
}
|
|
189
207
|
}
|
|
190
208
|
/**
|
|
191
209
|
* Get detected codec information.
|
|
@@ -207,6 +225,15 @@ export class WebRTCStream {
|
|
|
207
225
|
* ```
|
|
208
226
|
*/
|
|
209
227
|
getCodecs() {
|
|
228
|
+
// Frame source: no input stream - advertise the encoder's target codecs
|
|
229
|
+
// (RTPStream's frame path encodes video to H264 and audio to OPUS), gated on
|
|
230
|
+
// which frame streams are present.
|
|
231
|
+
if (this.frameSource) {
|
|
232
|
+
return {
|
|
233
|
+
video: this.frameSource.video ? this.getVideoCodecConfig(AV_CODEC_ID_H264) : undefined,
|
|
234
|
+
audio: this.frameSource.audio ? this.getAudioCodecConfig(AV_CODEC_ID_OPUS) : undefined,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
210
237
|
const input = this.stream.getInput();
|
|
211
238
|
if (!input) {
|
|
212
239
|
return {
|
|
@@ -293,6 +320,14 @@ export class WebRTCStream {
|
|
|
293
320
|
codecs: codecParams,
|
|
294
321
|
iceServers: this.options.iceServers,
|
|
295
322
|
});
|
|
323
|
+
// Tear down when the peer goes away. werift verifies ICE consent (RFC 7675)
|
|
324
|
+
// and reports 'failed' once the browser disconnects (tab closed/reloaded) -
|
|
325
|
+
// without this, the pipeline would keep encoding into the void forever.
|
|
326
|
+
this.pc.connectionStateChange.subscribe((state) => {
|
|
327
|
+
if ((state === 'failed' || state === 'closed') && !this.stopping) {
|
|
328
|
+
void this.stop();
|
|
329
|
+
}
|
|
330
|
+
});
|
|
296
331
|
// Setup ICE candidate handling
|
|
297
332
|
this.pc.onIceCandidate.subscribe((candidate) => {
|
|
298
333
|
if (candidate?.candidate && this.options.onIceCandidate) {
|
|
@@ -305,6 +340,12 @@ export class WebRTCStream {
|
|
|
305
340
|
this.videoTrack = new MediaStreamTrack({ kind: 'video' });
|
|
306
341
|
transceiver.sender.replaceTrack(this.videoTrack);
|
|
307
342
|
transceiver.setDirection('sendonly');
|
|
343
|
+
// Answer PLI feedback with a fresh keyframe - a receiver that connected
|
|
344
|
+
// after the stream started (or lost packets) can't decode until the next
|
|
345
|
+
// IDR, and it asks for one via RTCP PLI.
|
|
346
|
+
transceiver.sender.onPictureLossIndication.subscribe(() => {
|
|
347
|
+
this.stream.requestVideoKeyframe();
|
|
348
|
+
});
|
|
308
349
|
}
|
|
309
350
|
else if (transceiver.kind === 'audio' && this.audioTrack === null) {
|
|
310
351
|
this.audioTrack = new MediaStreamTrack({ kind: 'audio' });
|
|
@@ -332,6 +373,20 @@ export class WebRTCStream {
|
|
|
332
373
|
});
|
|
333
374
|
// Set remote description and create answer
|
|
334
375
|
await this.pc.setRemoteDescription(new RTCSessionDescription(offerSdp, 'offer'));
|
|
376
|
+
// The sender transmits with the FIRST negotiated codec, and browsers offer
|
|
377
|
+
// several H264 variants (packetization-mode=1 and =0). FFmpeg's RTP payloader
|
|
378
|
+
// fragments large NALs (FU-A), which is invalid under packetization-mode=0 -
|
|
379
|
+
// if that entry happened to be first, the receiver would silently discard
|
|
380
|
+
// every fragmented (key)frame. Prefer a packetization-mode=1 H264 entry.
|
|
381
|
+
for (const transceiver of this.pc.getTransceivers()) {
|
|
382
|
+
if (transceiver.kind !== 'video') {
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
transceiver.codecs = [...transceiver.codecs].sort((a, b) => {
|
|
386
|
+
const score = (codec) => codec.mimeType.toLowerCase() === 'video/h264' && !(codec.parameters ?? '').includes('packetization-mode=1') ? 1 : 0;
|
|
387
|
+
return score(a) - score(b);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
335
390
|
const answer = await this.pc.createAnswer();
|
|
336
391
|
this.pc.setLocalDescription(answer);
|
|
337
392
|
// Apply any buffered ICE candidates now that remote description is set
|
|
@@ -341,6 +396,10 @@ export class WebRTCStream {
|
|
|
341
396
|
}
|
|
342
397
|
this.pendingIceCandidates = [];
|
|
343
398
|
}
|
|
399
|
+
// Start streaming - negotiation is done and the tracks exist, so the caller
|
|
400
|
+
// doesn't have to sequence start() themselves. Idempotent: calling start()
|
|
401
|
+
// before setOffer() (e.g. to have the input open for codec detection) is fine.
|
|
402
|
+
await this.start();
|
|
344
403
|
return this.pc.localDescription?.sdp ?? '';
|
|
345
404
|
}
|
|
346
405
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webrtc-stream.js","sourceRoot":"","sources":["../../src/api/webrtc-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAE5H,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"webrtc-stream.js","sourceRoot":"","sources":["../../src/api/webrtc-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAE5H,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAmDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,OAAO,YAAY;IACf,MAAM,CAAa;IACnB,EAAE,GAA6B,IAAI,CAAC;IAC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;YACR,KAAK,qBAAqB;gBACxB,QAAQ,GAAG,YAAY,CAAC;gBACxB,SAAS,GAAG,IAAI,CAAC;gBACjB,QAAQ,GAAG,CAAC,CAAC;gBACb,WAAW,GAAG,CAAC,CAAC;gBAChB,MAAM;YACR;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;IACjE,CAAC;CACF"}
|
package/dist/webrtc/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { WebRTCStream, type WebRTCCodecInfo, type WebRTCStreamOptions } from '../api/webrtc-stream.js';
|
|
2
2
|
export { RTPStream, type RTPStreamOptions } from '../api/rtp-stream.js';
|
|
3
|
+
export type { MediaFrameSource } from '../api/types.js';
|
|
3
4
|
export { MediaStreamTrack, RTCIceCandidate, RTCPeerConnection, RTCRtpCodecParameters, RTCSessionDescription, RtpPacket, type PeerConfig } from 'werift';
|
package/dist/webrtc/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webrtc/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAkD,MAAM,yBAAyB,CAAC;AAEvG,aAAa;AACb,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webrtc/index.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAkD,MAAM,yBAAyB,CAAC;AAEvG,aAAa;AACb,OAAO,EAAE,SAAS,EAAyB,MAAM,sBAAsB,CAAC;AAGxE,0DAA0D;AAC1D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,SAAS,EAAmB,MAAM,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-av",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0-beta.1",
|
|
4
4
|
"description": "FFmpeg bindings for Node.js",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/node-av)",
|
|
6
6
|
"type": "module",
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
},
|
|
86
86
|
"optionalDependencies": {
|
|
87
87
|
"werift": "^0.23.0",
|
|
88
|
-
"@seydx/node-av-darwin-arm64": "^6.
|
|
89
|
-
"@seydx/node-av-darwin-x64": "^6.
|
|
90
|
-
"@seydx/node-av-linux-arm64": "^6.
|
|
91
|
-
"@seydx/node-av-linux-x64": "^6.
|
|
92
|
-
"@seydx/node-av-win32-arm64-mingw": "^6.
|
|
93
|
-
"@seydx/node-av-win32-arm64-msvc": "^6.
|
|
94
|
-
"@seydx/node-av-win32-x64-mingw": "^6.
|
|
95
|
-
"@seydx/node-av-win32-x64-msvc": "^6.
|
|
88
|
+
"@seydx/node-av-darwin-arm64": "^6.2.0-beta.1",
|
|
89
|
+
"@seydx/node-av-darwin-x64": "^6.2.0-beta.1",
|
|
90
|
+
"@seydx/node-av-linux-arm64": "^6.2.0-beta.1",
|
|
91
|
+
"@seydx/node-av-linux-x64": "^6.2.0-beta.1",
|
|
92
|
+
"@seydx/node-av-win32-arm64-mingw": "^6.2.0-beta.1",
|
|
93
|
+
"@seydx/node-av-win32-arm64-msvc": "^6.2.0-beta.1",
|
|
94
|
+
"@seydx/node-av-win32-x64-mingw": "^6.2.0-beta.1",
|
|
95
|
+
"@seydx/node-av-win32-x64-msvc": "^6.2.0-beta.1"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@stylistic/eslint-plugin": "^5.10.0",
|