node-av 6.2.0-beta.9 → 7.0.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/README.md +7 -19
- package/dist/api/audio-frame-buffer.d.ts +378 -19
- package/dist/api/audio-frame-buffer.js +715 -101
- package/dist/api/audio-frame-buffer.js.map +1 -1
- package/dist/api/data/test_av1.ivf +0 -0
- package/dist/api/data/test_hevc.h265 +0 -0
- package/dist/api/data/test_vp9.ivf +0 -0
- package/dist/api/decoder.d.ts +117 -2
- package/dist/api/decoder.js +290 -23
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/demuxer.d.ts +19 -3
- package/dist/api/demuxer.js +95 -29
- package/dist/api/demuxer.js.map +1 -1
- package/dist/api/encoder-pool.js +9 -1
- package/dist/api/encoder-pool.js.map +1 -1
- package/dist/api/encoder.d.ts +100 -6
- package/dist/api/encoder.js +249 -108
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +25 -1
- package/dist/api/filter-presets.js +67 -5
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/filter.d.ts +62 -3
- package/dist/api/filter.js +118 -36
- package/dist/api/filter.js.map +1 -1
- package/dist/api/fmp4-stream.d.ts +179 -15
- package/dist/api/fmp4-stream.js +341 -120
- package/dist/api/fmp4-stream.js.map +1 -1
- package/dist/api/hardware.d.ts +2 -0
- package/dist/api/hardware.js +33 -10
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.d.ts +3 -2
- package/dist/api/io-stream.js +23 -7
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/muxer.d.ts +276 -7
- package/dist/api/muxer.js +649 -116
- package/dist/api/muxer.js.map +1 -1
- package/dist/api/pipeline.d.ts +22 -0
- package/dist/api/pipeline.js +53 -0
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/rtp-stream.d.ts +54 -33
- package/dist/api/rtp-stream.js +232 -153
- package/dist/api/rtp-stream.js.map +1 -1
- package/dist/api/scaler.d.ts +39 -6
- package/dist/api/scaler.js +72 -18
- package/dist/api/scaler.js.map +1 -1
- package/dist/api/utilities/live-decoding.d.ts +15 -0
- package/dist/api/utilities/live-decoding.js +32 -0
- package/dist/api/utilities/live-decoding.js.map +1 -0
- package/dist/api/utilities/packet-age-watchdog.d.ts +198 -0
- package/dist/api/utilities/packet-age-watchdog.js +594 -0
- package/dist/api/utilities/packet-age-watchdog.js.map +1 -0
- package/dist/api/utilities/scale-size.d.ts +51 -0
- package/dist/api/utilities/scale-size.js +55 -0
- package/dist/api/utilities/scale-size.js.map +1 -0
- package/dist/api/utilities/video-transcode.d.ts +218 -0
- package/dist/api/utilities/video-transcode.js +624 -0
- package/dist/api/utilities/video-transcode.js.map +1 -0
- package/dist/constants/bsf-options.d.ts +32 -8
- package/dist/constants/constants.d.ts +36 -114
- package/dist/constants/constants.js +32 -95
- package/dist/constants/constants.js.map +1 -1
- package/dist/constants/decoders.d.ts +74 -74
- package/dist/constants/decoders.js +79 -77
- package/dist/constants/decoders.js.map +1 -1
- package/dist/constants/encoders.d.ts +20 -21
- package/dist/constants/encoders.js +25 -24
- package/dist/constants/encoders.js.map +1 -1
- package/dist/constants/filter-options.d.ts +1378 -194
- package/dist/constants/format-options.d.ts +1342 -83
- package/dist/constants/formats.d.ts +2 -2
- package/dist/constants/options.d.ts +2261 -125
- package/dist/ffmpeg/utils.js +7 -4
- package/dist/ffmpeg/utils.js.map +1 -1
- package/dist/ffmpeg/version.d.ts +1 -1
- package/dist/ffmpeg/version.js +1 -1
- package/dist/ffmpeg/version.js.map +1 -1
- package/dist/lib/binding.d.ts +10 -1
- package/dist/lib/binding.js +25 -16
- package/dist/lib/binding.js.map +1 -1
- package/dist/lib/bitstream-filter-context.d.ts +2 -0
- package/dist/lib/bitstream-filter-context.js +2 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -1
- package/dist/lib/filter-context.d.ts +3 -0
- package/dist/lib/filter-context.js +3 -0
- package/dist/lib/filter-context.js.map +1 -1
- package/dist/lib/filter-graph-segment.d.ts +3 -2
- package/dist/lib/filter-graph-segment.js +3 -2
- package/dist/lib/filter-graph-segment.js.map +1 -1
- package/dist/lib/filter-graph.d.ts +4 -4
- package/dist/lib/filter-graph.js +4 -4
- package/dist/lib/filter-inout.d.ts +4 -0
- package/dist/lib/filter-inout.js +4 -0
- package/dist/lib/filter-inout.js.map +1 -1
- package/dist/lib/format-context.d.ts +27 -3
- package/dist/lib/format-context.js +30 -6
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +6 -2
- package/dist/lib/frame.js +11 -3
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/io-context.d.ts +4 -2
- package/dist/lib/io-context.js +4 -2
- package/dist/lib/io-context.js.map +1 -1
- package/dist/lib/native-types.d.ts +7 -3
- package/dist/lib/output-format.d.ts +42 -0
- package/dist/lib/output-format.js +46 -0
- package/dist/lib/output-format.js.map +1 -1
- package/dist/lib/stream.d.ts +5 -0
- package/dist/lib/stream.js +5 -0
- package/dist/lib/stream.js.map +1 -1
- package/dist/lib/utilities.d.ts +26 -0
- package/dist/lib/utilities.js +28 -0
- package/dist/lib/utilities.js.map +1 -1
- package/install/check.js +14 -16
- package/package.json +28 -44
package/dist/api/rtp-stream.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ export interface RTPStreamOptions {
|
|
|
25
25
|
/**
|
|
26
26
|
* Callback invoked when the stream is closed or encounters an error.
|
|
27
27
|
*
|
|
28
|
+
* Called once per started session. On an error the stream has already been
|
|
29
|
+
* stopped and its resources (including the input connection) released.
|
|
30
|
+
* Exceptions thrown by the callback are logged and do not propagate.
|
|
31
|
+
*
|
|
28
32
|
* @param error - Optional error if stream closed due to an error
|
|
29
33
|
*/
|
|
30
34
|
onClose?: (error?: Error) => void;
|
|
@@ -68,6 +72,9 @@ export interface RTPStreamOptions {
|
|
|
68
72
|
width?: number;
|
|
69
73
|
height?: number;
|
|
70
74
|
bitrate?: number;
|
|
75
|
+
dumpExtra?: boolean;
|
|
76
|
+
/** Transcode even when the source codec is one of `supportedVideoCodecs`. */
|
|
77
|
+
transcode?: boolean;
|
|
71
78
|
encoderOptions?: EncoderOptions['options'];
|
|
72
79
|
};
|
|
73
80
|
/**
|
|
@@ -144,6 +151,7 @@ export declare class RTPStream {
|
|
|
144
151
|
private videoDecoder?;
|
|
145
152
|
private videoFilter?;
|
|
146
153
|
private videoEncoder?;
|
|
154
|
+
private videoBitstreamFilter?;
|
|
147
155
|
private audioDecoder?;
|
|
148
156
|
private audioFilter?;
|
|
149
157
|
private audioEncoder?;
|
|
@@ -152,11 +160,11 @@ export declare class RTPStream {
|
|
|
152
160
|
private signal?;
|
|
153
161
|
private supportedVideoCodecs;
|
|
154
162
|
private supportedAudioCodecs;
|
|
155
|
-
private videoKeyframeRequested;
|
|
156
163
|
private abortHandler?;
|
|
157
164
|
private stopRequested;
|
|
158
165
|
private stopPromise?;
|
|
159
166
|
private startAbort?;
|
|
167
|
+
private stopSignal;
|
|
160
168
|
/**
|
|
161
169
|
* @param input - Media input URL or pre-opened Demuxer
|
|
162
170
|
*
|
|
@@ -211,6 +219,10 @@ export declare class RTPStream {
|
|
|
211
219
|
/**
|
|
212
220
|
* Check if the stream is active.
|
|
213
221
|
*
|
|
222
|
+
* Stays true while a requested stop is still unwinding: the pipeline reports
|
|
223
|
+
* itself stopped as soon as stop() is called, but its packets keep flowing
|
|
224
|
+
* and its native resources stay open until completion settles.
|
|
225
|
+
*
|
|
214
226
|
* @returns True if the stream is active, false otherwise
|
|
215
227
|
*/
|
|
216
228
|
get isStreamActive(): boolean;
|
|
@@ -238,9 +250,9 @@ export declare class RTPStream {
|
|
|
238
250
|
*
|
|
239
251
|
* Used to answer receiver feedback (e.g. a WebRTC PLI) so a receiver that
|
|
240
252
|
* missed the stream start or lost packets can resync without waiting for the
|
|
241
|
-
* next scheduled GOP keyframe.
|
|
242
|
-
*
|
|
243
|
-
*
|
|
253
|
+
* next scheduled GOP keyframe. Effective whenever the video is encoded, from
|
|
254
|
+
* frame sources and from a transcoded URL or {@link Demuxer} input; a stream
|
|
255
|
+
* passed through keeps the source's keyframes.
|
|
244
256
|
*
|
|
245
257
|
* @example
|
|
246
258
|
* ```typescript
|
|
@@ -250,20 +262,6 @@ export declare class RTPStream {
|
|
|
250
262
|
* ```
|
|
251
263
|
*/
|
|
252
264
|
requestVideoKeyframe(): void;
|
|
253
|
-
/**
|
|
254
|
-
* Pass video frames through, forcing a keyframe when one was requested.
|
|
255
|
-
*
|
|
256
|
-
* Sets `pictType = I` on the next frame after {@link requestVideoKeyframe};
|
|
257
|
-
* combined with the encoder's `forced-idr` option this produces an IDR the
|
|
258
|
-
* receiver can resync on.
|
|
259
|
-
*
|
|
260
|
-
* @param src - The user-provided video frame source
|
|
261
|
-
*
|
|
262
|
-
* @yields {Frame | null} The unchanged frames (with pictType forced when requested)
|
|
263
|
-
*
|
|
264
|
-
* @internal
|
|
265
|
-
*/
|
|
266
|
-
private wrapVideoSource;
|
|
267
265
|
/**
|
|
268
266
|
* Start streaming media to RTP packets.
|
|
269
267
|
*
|
|
@@ -311,32 +309,38 @@ export declare class RTPStream {
|
|
|
311
309
|
*/
|
|
312
310
|
private throwIfStopRequested;
|
|
313
311
|
/**
|
|
314
|
-
*
|
|
312
|
+
* Wire the pipeline completion to the onClose/error callbacks.
|
|
315
313
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
* never
|
|
319
|
-
* instead would push a normally-lighter stream UP to fill it, overshooting
|
|
320
|
-
* on bursts.
|
|
314
|
+
* On success invokes `onClose()`; on error stops the stream and invokes
|
|
315
|
+
* `onClose(error)`. Either way `onClose` runs exactly once and the detached
|
|
316
|
+
* chain never rejects. Runs in the background (not awaited).
|
|
321
317
|
*
|
|
322
|
-
* @param
|
|
318
|
+
* @param completion - The pipeline completion promise
|
|
323
319
|
*
|
|
324
|
-
* @
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
private attachCompletion;
|
|
323
|
+
/**
|
|
324
|
+
* Invoke the owner's onClose callback.
|
|
325
|
+
*
|
|
326
|
+
* The completion chain runs detached, so an exception from the callback
|
|
327
|
+
* could only surface as an unhandled rejection - it is logged instead.
|
|
328
|
+
*
|
|
329
|
+
* @param error - Pipeline error, or undefined for a clean end
|
|
325
330
|
*
|
|
326
331
|
* @internal
|
|
327
332
|
*/
|
|
328
|
-
private
|
|
333
|
+
private emitClose;
|
|
329
334
|
/**
|
|
330
|
-
*
|
|
335
|
+
* Whether a pipeline rejection was caused by an intentional shutdown.
|
|
331
336
|
*
|
|
332
|
-
*
|
|
333
|
-
* `onClose(error)`. Runs in the background (not awaited).
|
|
337
|
+
* @param error - The pipeline rejection reason
|
|
334
338
|
*
|
|
335
|
-
* @
|
|
339
|
+
* @returns True when stop() is in flight or the owner's signal aborted
|
|
336
340
|
*
|
|
337
341
|
* @internal
|
|
338
342
|
*/
|
|
339
|
-
private
|
|
343
|
+
private isDeliberateStop;
|
|
340
344
|
/**
|
|
341
345
|
* Set up encoders and RTP outputs for a pre-composited frame source and start
|
|
342
346
|
* encoding. No demuxer or decoder is involved - the provided frames are encoded
|
|
@@ -384,7 +388,8 @@ export declare class RTPStream {
|
|
|
384
388
|
*
|
|
385
389
|
* Stops the pipeline, closes output, and releases all FFmpeg resources.
|
|
386
390
|
* Safe to call multiple times. After stopping, you can call start() again
|
|
387
|
-
* to restart the stream.
|
|
391
|
+
* to restart the stream. Resolves even if the pipeline had failed; that
|
|
392
|
+
* error is reported through `onClose(error)`.
|
|
388
393
|
*
|
|
389
394
|
* @example
|
|
390
395
|
* ```typescript
|
|
@@ -414,6 +419,22 @@ export declare class RTPStream {
|
|
|
414
419
|
* @internal
|
|
415
420
|
*/
|
|
416
421
|
private isAudioCodecSupported;
|
|
422
|
+
/**
|
|
423
|
+
* Find the encoder for a target video codec, on the device when it works there.
|
|
424
|
+
*
|
|
425
|
+
* @param target - Codec ID, or the name of a specific encoder to use as it is
|
|
426
|
+
*
|
|
427
|
+
* @param size - The output size, when known before the first frame
|
|
428
|
+
*
|
|
429
|
+
* @param size.width - Width
|
|
430
|
+
*
|
|
431
|
+
* @param size.height - Height
|
|
432
|
+
*
|
|
433
|
+
* @returns The encoder, or null if none exists
|
|
434
|
+
*
|
|
435
|
+
* @internal
|
|
436
|
+
*/
|
|
437
|
+
private findVideoEncoder;
|
|
417
438
|
/**
|
|
418
439
|
* Check if the given video codec is supported.
|
|
419
440
|
*
|