@revizly/node-av 5.2.2-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/BUILD_LINUX.md +61 -0
- package/LICENSE.md +22 -0
- package/README.md +662 -0
- package/build_mac_local.sh +69 -0
- package/dist/api/audio-frame-buffer.d.ts +205 -0
- package/dist/api/audio-frame-buffer.js +287 -0
- package/dist/api/audio-frame-buffer.js.map +1 -0
- package/dist/api/bitstream-filter.d.ts +820 -0
- package/dist/api/bitstream-filter.js +1242 -0
- package/dist/api/bitstream-filter.js.map +1 -0
- package/dist/api/constants.d.ts +44 -0
- package/dist/api/constants.js +45 -0
- package/dist/api/constants.js.map +1 -0
- package/dist/api/data/test_av1.ivf +0 -0
- package/dist/api/data/test_h264.h264 +0 -0
- package/dist/api/data/test_hevc.h265 +0 -0
- package/dist/api/data/test_mjpeg.mjpeg +0 -0
- package/dist/api/data/test_vp8.ivf +0 -0
- package/dist/api/data/test_vp9.ivf +0 -0
- package/dist/api/decoder.d.ts +1088 -0
- package/dist/api/decoder.js +1775 -0
- package/dist/api/decoder.js.map +1 -0
- package/dist/api/demuxer.d.ts +1219 -0
- package/dist/api/demuxer.js +2081 -0
- package/dist/api/demuxer.js.map +1 -0
- package/dist/api/device.d.ts +586 -0
- package/dist/api/device.js +961 -0
- package/dist/api/device.js.map +1 -0
- package/dist/api/encoder.d.ts +1132 -0
- package/dist/api/encoder.js +1988 -0
- package/dist/api/encoder.js.map +1 -0
- package/dist/api/filter-complex.d.ts +821 -0
- package/dist/api/filter-complex.js +1604 -0
- package/dist/api/filter-complex.js.map +1 -0
- package/dist/api/filter-presets.d.ts +1286 -0
- package/dist/api/filter-presets.js +2152 -0
- package/dist/api/filter-presets.js.map +1 -0
- package/dist/api/filter.d.ts +1234 -0
- package/dist/api/filter.js +1976 -0
- package/dist/api/filter.js.map +1 -0
- package/dist/api/fmp4-stream.d.ts +426 -0
- package/dist/api/fmp4-stream.js +739 -0
- package/dist/api/fmp4-stream.js.map +1 -0
- package/dist/api/hardware.d.ts +651 -0
- package/dist/api/hardware.js +1260 -0
- package/dist/api/hardware.js.map +1 -0
- package/dist/api/index.d.ts +17 -0
- package/dist/api/index.js +32 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/io-stream.d.ts +307 -0
- package/dist/api/io-stream.js +282 -0
- package/dist/api/io-stream.js.map +1 -0
- package/dist/api/muxer.d.ts +957 -0
- package/dist/api/muxer.js +2002 -0
- package/dist/api/muxer.js.map +1 -0
- package/dist/api/pipeline.d.ts +607 -0
- package/dist/api/pipeline.js +1145 -0
- package/dist/api/pipeline.js.map +1 -0
- package/dist/api/utilities/async-queue.d.ts +120 -0
- package/dist/api/utilities/async-queue.js +211 -0
- package/dist/api/utilities/async-queue.js.map +1 -0
- package/dist/api/utilities/audio-sample.d.ts +117 -0
- package/dist/api/utilities/audio-sample.js +112 -0
- package/dist/api/utilities/audio-sample.js.map +1 -0
- package/dist/api/utilities/channel-layout.d.ts +76 -0
- package/dist/api/utilities/channel-layout.js +80 -0
- package/dist/api/utilities/channel-layout.js.map +1 -0
- package/dist/api/utilities/electron-shared-texture.d.ts +328 -0
- package/dist/api/utilities/electron-shared-texture.js +503 -0
- package/dist/api/utilities/electron-shared-texture.js.map +1 -0
- package/dist/api/utilities/image.d.ts +207 -0
- package/dist/api/utilities/image.js +213 -0
- package/dist/api/utilities/image.js.map +1 -0
- package/dist/api/utilities/index.d.ts +12 -0
- package/dist/api/utilities/index.js +25 -0
- package/dist/api/utilities/index.js.map +1 -0
- package/dist/api/utilities/media-type.d.ts +49 -0
- package/dist/api/utilities/media-type.js +53 -0
- package/dist/api/utilities/media-type.js.map +1 -0
- package/dist/api/utilities/pixel-format.d.ts +89 -0
- package/dist/api/utilities/pixel-format.js +97 -0
- package/dist/api/utilities/pixel-format.js.map +1 -0
- package/dist/api/utilities/sample-format.d.ts +129 -0
- package/dist/api/utilities/sample-format.js +141 -0
- package/dist/api/utilities/sample-format.js.map +1 -0
- package/dist/api/utilities/scheduler.d.ts +138 -0
- package/dist/api/utilities/scheduler.js +98 -0
- package/dist/api/utilities/scheduler.js.map +1 -0
- package/dist/api/utilities/streaming.d.ts +186 -0
- package/dist/api/utilities/streaming.js +309 -0
- package/dist/api/utilities/streaming.js.map +1 -0
- package/dist/api/utilities/timestamp.d.ts +193 -0
- package/dist/api/utilities/timestamp.js +206 -0
- package/dist/api/utilities/timestamp.js.map +1 -0
- package/dist/api/utilities/whisper-model.d.ts +310 -0
- package/dist/api/utilities/whisper-model.js +528 -0
- package/dist/api/utilities/whisper-model.js.map +1 -0
- package/dist/api/utils.d.ts +19 -0
- package/dist/api/utils.js +39 -0
- package/dist/api/utils.js.map +1 -0
- package/dist/api/whisper.d.ts +324 -0
- package/dist/api/whisper.js +362 -0
- package/dist/api/whisper.js.map +1 -0
- package/dist/constants/channel-layouts.d.ts +53 -0
- package/dist/constants/channel-layouts.js +57 -0
- package/dist/constants/channel-layouts.js.map +1 -0
- package/dist/constants/constants.d.ts +2325 -0
- package/dist/constants/constants.js +1887 -0
- package/dist/constants/constants.js.map +1 -0
- package/dist/constants/decoders.d.ts +633 -0
- package/dist/constants/decoders.js +641 -0
- package/dist/constants/decoders.js.map +1 -0
- package/dist/constants/encoders.d.ts +295 -0
- package/dist/constants/encoders.js +308 -0
- package/dist/constants/encoders.js.map +1 -0
- package/dist/constants/hardware.d.ts +26 -0
- package/dist/constants/hardware.js +27 -0
- package/dist/constants/hardware.js.map +1 -0
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.js +6 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/ffmpeg/index.d.ts +99 -0
- package/dist/ffmpeg/index.js +115 -0
- package/dist/ffmpeg/index.js.map +1 -0
- package/dist/ffmpeg/utils.d.ts +31 -0
- package/dist/ffmpeg/utils.js +68 -0
- package/dist/ffmpeg/utils.js.map +1 -0
- package/dist/ffmpeg/version.d.ts +6 -0
- package/dist/ffmpeg/version.js +7 -0
- package/dist/ffmpeg/version.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audio-fifo.d.ts +399 -0
- package/dist/lib/audio-fifo.js +431 -0
- package/dist/lib/audio-fifo.js.map +1 -0
- package/dist/lib/binding.d.ts +228 -0
- package/dist/lib/binding.js +60 -0
- package/dist/lib/binding.js.map +1 -0
- package/dist/lib/bitstream-filter-context.d.ts +379 -0
- package/dist/lib/bitstream-filter-context.js +441 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -0
- package/dist/lib/bitstream-filter.d.ts +140 -0
- package/dist/lib/bitstream-filter.js +154 -0
- package/dist/lib/bitstream-filter.js.map +1 -0
- package/dist/lib/codec-context.d.ts +1071 -0
- package/dist/lib/codec-context.js +1354 -0
- package/dist/lib/codec-context.js.map +1 -0
- package/dist/lib/codec-parameters.d.ts +616 -0
- package/dist/lib/codec-parameters.js +761 -0
- package/dist/lib/codec-parameters.js.map +1 -0
- package/dist/lib/codec-parser.d.ts +201 -0
- package/dist/lib/codec-parser.js +213 -0
- package/dist/lib/codec-parser.js.map +1 -0
- package/dist/lib/codec.d.ts +586 -0
- package/dist/lib/codec.js +713 -0
- package/dist/lib/codec.js.map +1 -0
- package/dist/lib/device.d.ts +291 -0
- package/dist/lib/device.js +324 -0
- package/dist/lib/device.js.map +1 -0
- package/dist/lib/dictionary.d.ts +333 -0
- package/dist/lib/dictionary.js +372 -0
- package/dist/lib/dictionary.js.map +1 -0
- package/dist/lib/error.d.ts +242 -0
- package/dist/lib/error.js +303 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/fifo.d.ts +416 -0
- package/dist/lib/fifo.js +453 -0
- package/dist/lib/fifo.js.map +1 -0
- package/dist/lib/filter-context.d.ts +712 -0
- package/dist/lib/filter-context.js +789 -0
- package/dist/lib/filter-context.js.map +1 -0
- package/dist/lib/filter-graph-segment.d.ts +160 -0
- package/dist/lib/filter-graph-segment.js +171 -0
- package/dist/lib/filter-graph-segment.js.map +1 -0
- package/dist/lib/filter-graph.d.ts +641 -0
- package/dist/lib/filter-graph.js +704 -0
- package/dist/lib/filter-graph.js.map +1 -0
- package/dist/lib/filter-inout.d.ts +198 -0
- package/dist/lib/filter-inout.js +257 -0
- package/dist/lib/filter-inout.js.map +1 -0
- package/dist/lib/filter.d.ts +243 -0
- package/dist/lib/filter.js +272 -0
- package/dist/lib/filter.js.map +1 -0
- package/dist/lib/format-context.d.ts +1254 -0
- package/dist/lib/format-context.js +1379 -0
- package/dist/lib/format-context.js.map +1 -0
- package/dist/lib/frame-utils.d.ts +116 -0
- package/dist/lib/frame-utils.js +98 -0
- package/dist/lib/frame-utils.js.map +1 -0
- package/dist/lib/frame.d.ts +1222 -0
- package/dist/lib/frame.js +1435 -0
- package/dist/lib/frame.js.map +1 -0
- package/dist/lib/hardware-device-context.d.ts +362 -0
- package/dist/lib/hardware-device-context.js +383 -0
- package/dist/lib/hardware-device-context.js.map +1 -0
- package/dist/lib/hardware-frames-context.d.ts +419 -0
- package/dist/lib/hardware-frames-context.js +477 -0
- package/dist/lib/hardware-frames-context.js.map +1 -0
- package/dist/lib/index.d.ts +35 -0
- package/dist/lib/index.js +60 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/input-format.d.ts +249 -0
- package/dist/lib/input-format.js +306 -0
- package/dist/lib/input-format.js.map +1 -0
- package/dist/lib/io-context.d.ts +696 -0
- package/dist/lib/io-context.js +769 -0
- package/dist/lib/io-context.js.map +1 -0
- package/dist/lib/log.d.ts +174 -0
- package/dist/lib/log.js +184 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/native-types.d.ts +946 -0
- package/dist/lib/native-types.js +2 -0
- package/dist/lib/native-types.js.map +1 -0
- package/dist/lib/option.d.ts +927 -0
- package/dist/lib/option.js +1583 -0
- package/dist/lib/option.js.map +1 -0
- package/dist/lib/output-format.d.ts +180 -0
- package/dist/lib/output-format.js +213 -0
- package/dist/lib/output-format.js.map +1 -0
- package/dist/lib/packet.d.ts +501 -0
- package/dist/lib/packet.js +590 -0
- package/dist/lib/packet.js.map +1 -0
- package/dist/lib/rational.d.ts +251 -0
- package/dist/lib/rational.js +278 -0
- package/dist/lib/rational.js.map +1 -0
- package/dist/lib/software-resample-context.d.ts +552 -0
- package/dist/lib/software-resample-context.js +592 -0
- package/dist/lib/software-resample-context.js.map +1 -0
- package/dist/lib/software-scale-context.d.ts +344 -0
- package/dist/lib/software-scale-context.js +366 -0
- package/dist/lib/software-scale-context.js.map +1 -0
- package/dist/lib/stream.d.ts +379 -0
- package/dist/lib/stream.js +526 -0
- package/dist/lib/stream.js.map +1 -0
- package/dist/lib/sync-queue.d.ts +179 -0
- package/dist/lib/sync-queue.js +197 -0
- package/dist/lib/sync-queue.js.map +1 -0
- package/dist/lib/types.d.ts +34 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utilities.d.ts +1127 -0
- package/dist/lib/utilities.js +1225 -0
- package/dist/lib/utilities.js.map +1 -0
- package/dist/utils/electron.d.ts +49 -0
- package/dist/utils/electron.js +63 -0
- package/dist/utils/electron.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/install/check.js +121 -0
- package/install/ffmpeg.js +66 -0
- package/jellyfin-ffmpeg.patch +181 -0
- package/package.json +129 -0
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
import type { Frame } from '../lib/frame.js';
|
|
2
|
+
import type { Packet } from '../lib/packet.js';
|
|
3
|
+
import type { BitStreamFilterAPI } from './bitstream-filter.js';
|
|
4
|
+
import type { Decoder } from './decoder.js';
|
|
5
|
+
import type { Demuxer } from './demuxer.js';
|
|
6
|
+
import type { Encoder } from './encoder.js';
|
|
7
|
+
import type { FilterAPI } from './filter.js';
|
|
8
|
+
import type { Muxer } from './muxer.js';
|
|
9
|
+
export type StreamName = 'video' | 'audio';
|
|
10
|
+
export type NamedInputs<K extends StreamName = StreamName> = Pick<Record<StreamName, Demuxer>, K>;
|
|
11
|
+
export type NamedStages<K extends StreamName = StreamName> = Pick<Record<StreamName, (Decoder | FilterAPI | FilterAPI[] | Encoder | BitStreamFilterAPI | BitStreamFilterAPI[] | undefined)[] | 'passthrough'>, K>;
|
|
12
|
+
export type NamedOutputs<K extends StreamName = StreamName> = Pick<Record<StreamName, Muxer>, K>;
|
|
13
|
+
/**
|
|
14
|
+
* Pipeline control interface for managing pipeline execution.
|
|
15
|
+
* Allows graceful stopping and completion tracking of running pipelines.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const control = pipeline(input, decoder, encoder, output);
|
|
20
|
+
*
|
|
21
|
+
* // Stop after 10 seconds
|
|
22
|
+
* setTimeout(() => control.stop(), 10000);
|
|
23
|
+
*
|
|
24
|
+
* // Wait for completion
|
|
25
|
+
* await control.completion;
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export interface PipelineControl {
|
|
29
|
+
/**
|
|
30
|
+
* Stop the pipeline gracefully.
|
|
31
|
+
* The pipeline will stop processing after the current operation completes.
|
|
32
|
+
*/
|
|
33
|
+
stop(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Check if the pipeline has been stopped.
|
|
36
|
+
*
|
|
37
|
+
* @returns True if stop() has been called
|
|
38
|
+
*/
|
|
39
|
+
isStopped(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Promise that resolves when the pipeline completes.
|
|
42
|
+
* Resolves when all processing is finished or the pipeline is stopped.
|
|
43
|
+
*/
|
|
44
|
+
readonly completion: Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for pipeline execution.
|
|
48
|
+
*/
|
|
49
|
+
export interface PipelineOptions {
|
|
50
|
+
/**
|
|
51
|
+
* AbortSignal for cancellation.
|
|
52
|
+
*
|
|
53
|
+
* When aborted, the pipeline stops processing gracefully.
|
|
54
|
+
* Equivalent to calling `control.stop()`.
|
|
55
|
+
*/
|
|
56
|
+
signal?: AbortSignal;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Full transcoding pipeline: input → decoder → encoder → output.
|
|
60
|
+
*
|
|
61
|
+
* @param source - Media input source
|
|
62
|
+
*
|
|
63
|
+
* @param decoder - Decoder for decoding packets to frames
|
|
64
|
+
*
|
|
65
|
+
* @param encoder - Encoder for encoding frames to packets
|
|
66
|
+
*
|
|
67
|
+
* @param output - Media output destination
|
|
68
|
+
*
|
|
69
|
+
* @param options - Pipeline options for cancellation support
|
|
70
|
+
*
|
|
71
|
+
* @returns Pipeline control for managing execution
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const control = pipeline(input, decoder, encoder, output);
|
|
76
|
+
* await control.completion;
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, encoder: Encoder, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
80
|
+
/**
|
|
81
|
+
* Full transcoding pipeline with filter: input → decoder → filter → encoder → output.
|
|
82
|
+
*
|
|
83
|
+
* @param source - Media input source
|
|
84
|
+
*
|
|
85
|
+
* @param decoder - Decoder for decoding packets to frames
|
|
86
|
+
*
|
|
87
|
+
* @param filter - Filter or filter chain for processing frames
|
|
88
|
+
*
|
|
89
|
+
* @param encoder - Encoder for encoding frames to packets
|
|
90
|
+
*
|
|
91
|
+
* @param output - Media output destination
|
|
92
|
+
*
|
|
93
|
+
* @param options - Pipeline options for cancellation support
|
|
94
|
+
*
|
|
95
|
+
* @returns Pipeline control for managing execution
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```typescript
|
|
99
|
+
* const control = pipeline(input, decoder, scaleFilter, encoder, output);
|
|
100
|
+
* await control.completion;
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, filter: FilterAPI | FilterAPI[], encoder: Encoder, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
104
|
+
/**
|
|
105
|
+
* Transcoding with bitstream filter: input → decoder → encoder → bsf → output.
|
|
106
|
+
*
|
|
107
|
+
* @param source - Media input source
|
|
108
|
+
*
|
|
109
|
+
* @param decoder - Decoder for decoding packets
|
|
110
|
+
*
|
|
111
|
+
* @param encoder - Encoder for encoding frames
|
|
112
|
+
*
|
|
113
|
+
* @param bsf - Bitstream filter for packet processing
|
|
114
|
+
*
|
|
115
|
+
* @param output - Media output destination
|
|
116
|
+
*
|
|
117
|
+
* @param options - Pipeline options for cancellation support
|
|
118
|
+
*
|
|
119
|
+
* @returns Pipeline control for managing execution
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* const decoder = await Decoder.create(input.video());
|
|
124
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
125
|
+
* const bsf = await BitStreamFilterAPI.create('h264_mp4toannexb');
|
|
126
|
+
* const control = pipeline(input, decoder, encoder, bsf, output);
|
|
127
|
+
* await control.completion;
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, encoder: Encoder, bsf: BitStreamFilterAPI | BitStreamFilterAPI[], output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
131
|
+
/**
|
|
132
|
+
* Full pipeline with filter and bsf: input → decoder → filter → encoder → bsf → output.
|
|
133
|
+
*
|
|
134
|
+
* @param source - Media input source
|
|
135
|
+
*
|
|
136
|
+
* @param decoder - Decoder for decoding packets
|
|
137
|
+
*
|
|
138
|
+
* @param filter - Filter or filter chain
|
|
139
|
+
*
|
|
140
|
+
* @param encoder - Encoder for encoding frames
|
|
141
|
+
*
|
|
142
|
+
* @param bsf - Bitstream filter
|
|
143
|
+
*
|
|
144
|
+
* @param output - Media output destination
|
|
145
|
+
*
|
|
146
|
+
* @param options - Pipeline options for cancellation support
|
|
147
|
+
*
|
|
148
|
+
* @returns Pipeline control for managing execution
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const decoder = await Decoder.create(input.video());
|
|
153
|
+
* const filter = FilterAPI.create('scale=640:480', { ... });
|
|
154
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
155
|
+
* const bsf = await BitStreamFilterAPI.create('h264_mp4toannexb');
|
|
156
|
+
* const control = pipeline(input, decoder, filter, encoder, bsf, output);
|
|
157
|
+
* await control.completion;
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, filter: FilterAPI | FilterAPI[], encoder: Encoder, bsf: BitStreamFilterAPI | BitStreamFilterAPI[], output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
161
|
+
/**
|
|
162
|
+
* Decode + multiple filters + encode: input → decoder → filter1 → filter2 → encoder → output.
|
|
163
|
+
*
|
|
164
|
+
* @param source - Media input source
|
|
165
|
+
*
|
|
166
|
+
* @param decoder - Decoder for decoding packets
|
|
167
|
+
*
|
|
168
|
+
* @param filter1 - First filter
|
|
169
|
+
*
|
|
170
|
+
* @param filter2 - Second filter
|
|
171
|
+
*
|
|
172
|
+
* @param encoder - Encoder for encoding frames
|
|
173
|
+
*
|
|
174
|
+
* @param output - Media output destination
|
|
175
|
+
*
|
|
176
|
+
* @param options - Pipeline options for cancellation support
|
|
177
|
+
*
|
|
178
|
+
* @returns Pipeline control for managing execution
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* const decoder = await Decoder.create(input.video());
|
|
183
|
+
* const scaleFilter = FilterAPI.create('scale=640:480', { ... });
|
|
184
|
+
* const cropFilter = FilterAPI.create('crop=640:360', { ... });
|
|
185
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
186
|
+
* const control = pipeline(input, decoder, scaleFilter, cropFilter, encoder, output);
|
|
187
|
+
* await control.completion;
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, filter1: FilterAPI, filter2: FilterAPI, encoder: Encoder, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
191
|
+
/**
|
|
192
|
+
* Stream copy pipeline: input → output (copies all streams).
|
|
193
|
+
*
|
|
194
|
+
* @param source - Media input source
|
|
195
|
+
*
|
|
196
|
+
* @param output - Media output destination
|
|
197
|
+
*
|
|
198
|
+
* @param options - Pipeline options for cancellation support
|
|
199
|
+
*
|
|
200
|
+
* @returns Pipeline control for managing execution
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* // Copy all streams without re-encoding
|
|
205
|
+
* const control = pipeline(input, output);
|
|
206
|
+
* await control.completion;
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
export declare function pipeline(source: Demuxer, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
210
|
+
/**
|
|
211
|
+
* Stream copy with bitstream filter: input → bsf → output.
|
|
212
|
+
*
|
|
213
|
+
* @param source - Media input source
|
|
214
|
+
*
|
|
215
|
+
* @param bsf - Bitstream filter for packet processing
|
|
216
|
+
*
|
|
217
|
+
* @param output - Media output destination
|
|
218
|
+
*
|
|
219
|
+
* @param options - Pipeline options for cancellation support
|
|
220
|
+
*
|
|
221
|
+
* @returns Pipeline control for managing execution
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* // Convert H.264 stream format while copying
|
|
226
|
+
* const bsf = await BitStreamFilterAPI.create('h264_mp4toannexb');
|
|
227
|
+
* const control = pipeline(input, bsf, output);
|
|
228
|
+
* await control.completion;
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export declare function pipeline(source: Demuxer, bsf: BitStreamFilterAPI | BitStreamFilterAPI[], output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
232
|
+
/**
|
|
233
|
+
* Filter + encode + output: frames → filter → encoder → output.
|
|
234
|
+
*
|
|
235
|
+
* @param source - Frame source (async iterable)
|
|
236
|
+
*
|
|
237
|
+
* @param filter - Filter or filter chain
|
|
238
|
+
*
|
|
239
|
+
* @param encoder - Encoder for encoding frames
|
|
240
|
+
*
|
|
241
|
+
* @param output - Media output destination
|
|
242
|
+
*
|
|
243
|
+
* @param options - Pipeline options for cancellation support
|
|
244
|
+
*
|
|
245
|
+
* @returns Pipeline control for managing execution
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* // Process frames from custom source
|
|
250
|
+
* const frameSource = generateFrames(); // Your async frame generator
|
|
251
|
+
* const filter = FilterAPI.create('scale=1920:1080', { ... });
|
|
252
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
253
|
+
* const control = pipeline(frameSource, filter, encoder, output);
|
|
254
|
+
* await control.completion;
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
export declare function pipeline(source: AsyncIterable<Frame | null>, filter: FilterAPI | FilterAPI[], encoder: Encoder, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
258
|
+
/**
|
|
259
|
+
* Encode + output: frames → encoder → output.
|
|
260
|
+
*
|
|
261
|
+
* @param source - Frame source (async iterable)
|
|
262
|
+
*
|
|
263
|
+
* @param encoder - Encoder for encoding frames
|
|
264
|
+
*
|
|
265
|
+
* @param output - Media output destination
|
|
266
|
+
*
|
|
267
|
+
* @param options - Pipeline options for cancellation support
|
|
268
|
+
*
|
|
269
|
+
* @returns Pipeline control for managing execution
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```typescript
|
|
273
|
+
* // Encode raw frames directly
|
|
274
|
+
* const frameSource = generateFrames(); // Your async frame generator
|
|
275
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
276
|
+
* const control = pipeline(frameSource, encoder, output);
|
|
277
|
+
* await control.completion;
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
export declare function pipeline(source: AsyncIterable<Frame | null>, encoder: Encoder, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
281
|
+
/**
|
|
282
|
+
* Partial pipeline: input → decoder (returns frames).
|
|
283
|
+
*
|
|
284
|
+
* @param source - Media input source
|
|
285
|
+
*
|
|
286
|
+
* @param decoder - Decoder for decoding packets
|
|
287
|
+
*
|
|
288
|
+
* @param options - Pipeline options for cancellation support
|
|
289
|
+
*
|
|
290
|
+
* @returns Async generator of frames
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* ```typescript
|
|
294
|
+
* // Get decoded frames for custom processing
|
|
295
|
+
* const decoder = await Decoder.create(input.video());
|
|
296
|
+
* const frames = pipeline(input, decoder);
|
|
297
|
+
* for await (const frame of frames) {
|
|
298
|
+
* // Process frame
|
|
299
|
+
* frame.free();
|
|
300
|
+
* }
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
303
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, options?: PipelineOptions): AsyncGenerator<Frame | null>;
|
|
304
|
+
/**
|
|
305
|
+
* Partial pipeline: input → decoder → filter (returns frames).
|
|
306
|
+
*
|
|
307
|
+
* @param source - Media input source
|
|
308
|
+
*
|
|
309
|
+
* @param decoder - Decoder for decoding packets
|
|
310
|
+
*
|
|
311
|
+
* @param filter - Filter or filter chain
|
|
312
|
+
*
|
|
313
|
+
* @param options - Pipeline options for cancellation support
|
|
314
|
+
*
|
|
315
|
+
* @returns Async generator of frames
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* // Get filtered frames for custom processing
|
|
320
|
+
* const decoder = await Decoder.create(input.video());
|
|
321
|
+
* const filter = FilterAPI.create('scale=640:480', { ... });
|
|
322
|
+
* const frames = pipeline(input, decoder, filter);
|
|
323
|
+
* for await (const frame of frames) {
|
|
324
|
+
* // Process filtered frame
|
|
325
|
+
* frame.free();
|
|
326
|
+
* }
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, filter: FilterAPI | FilterAPI[], options?: PipelineOptions): AsyncGenerator<Frame | null>;
|
|
330
|
+
/**
|
|
331
|
+
* Partial pipeline: input → decoder → filter → encoder (returns packets).
|
|
332
|
+
*
|
|
333
|
+
* @param source - Media input source
|
|
334
|
+
*
|
|
335
|
+
* @param decoder - Decoder for decoding packets
|
|
336
|
+
*
|
|
337
|
+
* @param filter - Filter or filter chain
|
|
338
|
+
*
|
|
339
|
+
* @param encoder - Encoder for encoding frames
|
|
340
|
+
*
|
|
341
|
+
* @param options - Pipeline options for cancellation support
|
|
342
|
+
*
|
|
343
|
+
* @returns Async generator of packets
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```typescript
|
|
347
|
+
* // Get encoded packets for custom output handling
|
|
348
|
+
* const decoder = await Decoder.create(input.video());
|
|
349
|
+
* const filter = FilterAPI.create('scale=640:480', { ... });
|
|
350
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
351
|
+
* const packets = pipeline(input, decoder, filter, encoder);
|
|
352
|
+
* for await (const packet of packets) {
|
|
353
|
+
* // Handle encoded packet
|
|
354
|
+
* packet.free();
|
|
355
|
+
* }
|
|
356
|
+
* ```
|
|
357
|
+
*/
|
|
358
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, filter: FilterAPI | FilterAPI[], encoder: Encoder, options?: PipelineOptions): AsyncGenerator<Packet | null>;
|
|
359
|
+
/**
|
|
360
|
+
* Partial pipeline: input → decoder → encoder (returns packets).
|
|
361
|
+
*
|
|
362
|
+
* @param source - Media input source
|
|
363
|
+
*
|
|
364
|
+
* @param decoder - Decoder for decoding packets
|
|
365
|
+
*
|
|
366
|
+
* @param encoder - Encoder for encoding frames
|
|
367
|
+
*
|
|
368
|
+
* @param options - Pipeline options for cancellation support
|
|
369
|
+
*
|
|
370
|
+
* @returns Async generator of packets
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```typescript
|
|
374
|
+
* // Transcode to packets for custom output
|
|
375
|
+
* const decoder = await Decoder.create(input.video());
|
|
376
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
377
|
+
* const packets = pipeline(input, decoder, encoder);
|
|
378
|
+
* for await (const packet of packets) {
|
|
379
|
+
* // Handle transcoded packet
|
|
380
|
+
* packet.free();
|
|
381
|
+
* }
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
export declare function pipeline(source: Demuxer, decoder: Decoder, encoder: Encoder, options?: PipelineOptions): AsyncGenerator<Packet | null>;
|
|
385
|
+
/**
|
|
386
|
+
* Partial pipeline: frames → filter (returns frames).
|
|
387
|
+
*
|
|
388
|
+
* @param source - Frame source (async iterable)
|
|
389
|
+
*
|
|
390
|
+
* @param filter - Filter or filter chain
|
|
391
|
+
*
|
|
392
|
+
* @param options - Pipeline options for cancellation support
|
|
393
|
+
*
|
|
394
|
+
* @returns Async generator of filtered frames
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```typescript
|
|
398
|
+
* // Filter frames from custom source
|
|
399
|
+
* const frameSource = generateFrames();
|
|
400
|
+
* const filter = FilterAPI.create('scale=640:480', { ... });
|
|
401
|
+
* const filteredFrames = pipeline(frameSource, filter);
|
|
402
|
+
* for await (const frame of filteredFrames) {
|
|
403
|
+
* // Process filtered frame
|
|
404
|
+
* frame.free();
|
|
405
|
+
* }
|
|
406
|
+
* ```
|
|
407
|
+
*/
|
|
408
|
+
export declare function pipeline(source: AsyncIterable<Frame | null>, filter: FilterAPI | FilterAPI[], options?: PipelineOptions): AsyncGenerator<Frame | null>;
|
|
409
|
+
/**
|
|
410
|
+
* Partial pipeline: frames → encoder (returns packets).
|
|
411
|
+
*
|
|
412
|
+
* @param source - Frame source (async iterable)
|
|
413
|
+
*
|
|
414
|
+
* @param encoder - Encoder for encoding frames
|
|
415
|
+
*
|
|
416
|
+
* @param options - Pipeline options for cancellation support
|
|
417
|
+
*
|
|
418
|
+
* @returns Async generator of packets
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* ```typescript
|
|
422
|
+
* // Encode frames to packets
|
|
423
|
+
* const frameSource = generateFrames();
|
|
424
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
425
|
+
* const packets = pipeline(frameSource, encoder);
|
|
426
|
+
* for await (const packet of packets) {
|
|
427
|
+
* // Handle encoded packet
|
|
428
|
+
* packet.free();
|
|
429
|
+
* }
|
|
430
|
+
* ```
|
|
431
|
+
*/
|
|
432
|
+
export declare function pipeline(source: AsyncIterable<Frame | null>, encoder: Encoder, options?: PipelineOptions): AsyncGenerator<Packet | null>;
|
|
433
|
+
/**
|
|
434
|
+
* Partial pipeline: frames → filter → encoder (returns packets).
|
|
435
|
+
*
|
|
436
|
+
* @param source - Frame source (async iterable)
|
|
437
|
+
*
|
|
438
|
+
* @param filter - Filter or filter chain
|
|
439
|
+
*
|
|
440
|
+
* @param encoder - Encoder for encoding frames
|
|
441
|
+
*
|
|
442
|
+
* @param options - Pipeline options for cancellation support
|
|
443
|
+
*
|
|
444
|
+
* @returns Async generator of packets
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
* ```typescript
|
|
448
|
+
* // Process frames with filter and encode to packets
|
|
449
|
+
* const frameSource = generateFrames();
|
|
450
|
+
* const filter = FilterAPI.create('scale=640:480', { ... });
|
|
451
|
+
* const encoder = await Encoder.create(FF_ENCODER_LIBX264, { ... });
|
|
452
|
+
* const packets = pipeline(frameSource, filter, encoder);
|
|
453
|
+
* for await (const packet of packets) {
|
|
454
|
+
* // Handle encoded packet
|
|
455
|
+
* packet.free();
|
|
456
|
+
* }
|
|
457
|
+
* ```
|
|
458
|
+
*/
|
|
459
|
+
export declare function pipeline(source: AsyncIterable<Frame | null>, filter: FilterAPI | FilterAPI[], encoder: Encoder, options?: PipelineOptions): AsyncGenerator<Packet | null>;
|
|
460
|
+
/**
|
|
461
|
+
* Named pipeline with shared input and single output.
|
|
462
|
+
*
|
|
463
|
+
* @param input - Shared input source (used for all streams)
|
|
464
|
+
*
|
|
465
|
+
* @param stages - Named processing stages for each stream
|
|
466
|
+
*
|
|
467
|
+
* @param output - Single output destination for all streams
|
|
468
|
+
*
|
|
469
|
+
* @param options - Pipeline options for cancellation support
|
|
470
|
+
*
|
|
471
|
+
* @returns Pipeline control for managing execution
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* ```typescript
|
|
475
|
+
* // Named pipeline with shared input
|
|
476
|
+
* const control = pipeline(
|
|
477
|
+
* input, // Automatically used for both video and audio
|
|
478
|
+
* {
|
|
479
|
+
* video: [videoDecoder, scaleFilter, videoEncoder],
|
|
480
|
+
* audio: [audioDecoder, volumeFilter, audioEncoder]
|
|
481
|
+
* },
|
|
482
|
+
* output
|
|
483
|
+
* );
|
|
484
|
+
* await control.completion;
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
487
|
+
export declare function pipeline<K extends StreamName>(input: Demuxer, stages: NamedStages<K>, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
488
|
+
/**
|
|
489
|
+
* Named pipeline with single output - all streams go to the same output.
|
|
490
|
+
*
|
|
491
|
+
* @param inputs - Named input sources (video/audio)
|
|
492
|
+
*
|
|
493
|
+
* @param stages - Named processing stages for each stream
|
|
494
|
+
*
|
|
495
|
+
* @param output - Single output destination for all streams
|
|
496
|
+
*
|
|
497
|
+
* @param options - Pipeline options for cancellation support
|
|
498
|
+
*
|
|
499
|
+
* @returns Pipeline control for managing execution
|
|
500
|
+
*
|
|
501
|
+
* @example
|
|
502
|
+
* ```typescript
|
|
503
|
+
* // Named pipeline for muxing
|
|
504
|
+
* const control = pipeline(
|
|
505
|
+
* { video: videoInput, audio: audioInput },
|
|
506
|
+
* {
|
|
507
|
+
* video: [videoDecoder, scaleFilter, videoEncoder],
|
|
508
|
+
* audio: [audioDecoder, volumeFilter, audioEncoder]
|
|
509
|
+
* },
|
|
510
|
+
* output
|
|
511
|
+
* );
|
|
512
|
+
* await control.completion;
|
|
513
|
+
* ```
|
|
514
|
+
*/
|
|
515
|
+
export declare function pipeline<K extends StreamName>(inputs: NamedInputs<K>, stages: NamedStages<K>, output: Muxer, options?: PipelineOptions): PipelineControl;
|
|
516
|
+
/**
|
|
517
|
+
* Named pipeline with shared input and multiple outputs.
|
|
518
|
+
*
|
|
519
|
+
* @param input - Shared input source (used for all streams)
|
|
520
|
+
*
|
|
521
|
+
* @param stages - Named processing stages for each stream
|
|
522
|
+
*
|
|
523
|
+
* @param outputs - Named output destinations
|
|
524
|
+
*
|
|
525
|
+
* @param options - Pipeline options for cancellation support
|
|
526
|
+
*
|
|
527
|
+
* @returns Pipeline control for managing execution
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```typescript
|
|
531
|
+
* // Named pipeline with shared input and separate outputs
|
|
532
|
+
* const control = pipeline(
|
|
533
|
+
* input, // Automatically used for both video and audio
|
|
534
|
+
* {
|
|
535
|
+
* video: [videoDecoder, scaleFilter, videoEncoder],
|
|
536
|
+
* audio: [audioDecoder, volumeFilter, audioEncoder]
|
|
537
|
+
* },
|
|
538
|
+
* { video: videoOutput, audio: audioOutput }
|
|
539
|
+
* );
|
|
540
|
+
* await control.completion;
|
|
541
|
+
* ```
|
|
542
|
+
*/
|
|
543
|
+
export declare function pipeline<K extends StreamName>(input: Demuxer, stages: NamedStages<K>, outputs: NamedOutputs<K>, options?: PipelineOptions): PipelineControl;
|
|
544
|
+
/**
|
|
545
|
+
* Named pipeline with multiple outputs - each stream has its own output.
|
|
546
|
+
*
|
|
547
|
+
* @param inputs - Named input sources (video/audio)
|
|
548
|
+
*
|
|
549
|
+
* @param stages - Named processing stages for each stream
|
|
550
|
+
*
|
|
551
|
+
* @param outputs - Named output destinations
|
|
552
|
+
*
|
|
553
|
+
* @param options - Pipeline options for cancellation support
|
|
554
|
+
*
|
|
555
|
+
* @returns Pipeline control for managing execution
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* ```typescript
|
|
559
|
+
* // Named pipeline for audio/video processing
|
|
560
|
+
* const control = pipeline(
|
|
561
|
+
* { video: videoInput, audio: audioInput },
|
|
562
|
+
* {
|
|
563
|
+
* video: [videoDecoder, scaleFilter, videoEncoder],
|
|
564
|
+
* audio: [audioDecoder, volumeFilter, audioEncoder]
|
|
565
|
+
* },
|
|
566
|
+
* { video: videoOutput, audio: audioOutput }
|
|
567
|
+
* );
|
|
568
|
+
* await control.completion;
|
|
569
|
+
* ```
|
|
570
|
+
*/
|
|
571
|
+
export declare function pipeline<K extends StreamName>(inputs: NamedInputs<K>, stages: NamedStages<K>, outputs: NamedOutputs<K>, options?: PipelineOptions): PipelineControl;
|
|
572
|
+
/**
|
|
573
|
+
* Partial named pipeline (returns generators for further processing).
|
|
574
|
+
*
|
|
575
|
+
* @param inputs - Named input sources
|
|
576
|
+
*
|
|
577
|
+
* @param stages - Named processing stages
|
|
578
|
+
*
|
|
579
|
+
* @param options - Pipeline options for cancellation support
|
|
580
|
+
*
|
|
581
|
+
* @returns Record of async generators for each stream
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```typescript
|
|
585
|
+
* // Partial named pipeline
|
|
586
|
+
* const generators = pipeline(
|
|
587
|
+
* { video: videoInput, audio: audioInput },
|
|
588
|
+
* {
|
|
589
|
+
* video: [videoDecoder, scaleFilter, videoEncoder],
|
|
590
|
+
* audio: [audioDecoder, volumeFilter, audioEncoder]
|
|
591
|
+
* }
|
|
592
|
+
* );
|
|
593
|
+
*
|
|
594
|
+
* // Access individual generators
|
|
595
|
+
* const videoGenerator = generators.video;
|
|
596
|
+
* const audioGenerator = generators.audio;
|
|
597
|
+
*
|
|
598
|
+
* // Use the generators
|
|
599
|
+
* for await (const packet of videoGenerator) {
|
|
600
|
+
* // Process video packet
|
|
601
|
+
* }
|
|
602
|
+
* for await (const packet of audioGenerator) {
|
|
603
|
+
* // Process audio packet
|
|
604
|
+
* }
|
|
605
|
+
* ```
|
|
606
|
+
*/
|
|
607
|
+
export declare function pipeline<K extends StreamName, T extends Packet | Frame | null = Packet | Frame | null>(inputs: NamedInputs<K>, stages: NamedStages<K>, options?: PipelineOptions): Record<K, AsyncGenerator<T>>;
|