node-av 5.2.4 → 6.0.0-beta.10

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.
Files changed (106) hide show
  1. package/README.md +15 -1
  2. package/dist/api/bitstream-filter.d.ts +110 -87
  3. package/dist/api/bitstream-filter.js +162 -102
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +87 -8
  6. package/dist/api/decoder.js +179 -4
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/demuxer.d.ts +30 -24
  9. package/dist/api/demuxer.js +4 -5
  10. package/dist/api/demuxer.js.map +1 -1
  11. package/dist/api/device.js.map +1 -1
  12. package/dist/api/encoder-pool.d.ts +220 -0
  13. package/dist/api/encoder-pool.js +285 -0
  14. package/dist/api/encoder-pool.js.map +1 -0
  15. package/dist/api/encoder.d.ts +133 -7
  16. package/dist/api/encoder.js +392 -68
  17. package/dist/api/encoder.js.map +1 -1
  18. package/dist/api/filter-complex.d.ts +2 -1
  19. package/dist/api/filter-complex.js +11 -7
  20. package/dist/api/filter-complex.js.map +1 -1
  21. package/dist/api/filter-presets.d.ts +130 -654
  22. package/dist/api/filter-presets.js +180 -858
  23. package/dist/api/filter-presets.js.map +1 -1
  24. package/dist/api/filter.js +13 -8
  25. package/dist/api/filter.js.map +1 -1
  26. package/dist/api/fmp4-stream.js +1 -1
  27. package/dist/api/fmp4-stream.js.map +1 -1
  28. package/dist/api/index.d.ts +6 -6
  29. package/dist/api/index.js +8 -8
  30. package/dist/api/index.js.map +1 -1
  31. package/dist/api/muxer.d.ts +43 -15
  32. package/dist/api/muxer.js +79 -27
  33. package/dist/api/muxer.js.map +1 -1
  34. package/dist/api/pipeline.d.ts +50 -0
  35. package/dist/api/pipeline.js +138 -22
  36. package/dist/api/pipeline.js.map +1 -1
  37. package/dist/api/probe.d.ts +128 -0
  38. package/dist/api/probe.js +227 -0
  39. package/dist/api/probe.js.map +1 -0
  40. package/dist/api/rtp-stream.js +1 -1
  41. package/dist/api/rtp-stream.js.map +1 -1
  42. package/dist/api/scaler.d.ts +431 -0
  43. package/dist/api/scaler.js +620 -0
  44. package/dist/api/scaler.js.map +1 -0
  45. package/dist/api/utilities/async-queue.d.ts +27 -1
  46. package/dist/api/utilities/async-queue.js +38 -1
  47. package/dist/api/utilities/async-queue.js.map +1 -1
  48. package/dist/api/utilities/electron-shared-texture.d.ts +41 -1
  49. package/dist/api/utilities/electron-shared-texture.js +41 -4
  50. package/dist/api/utilities/electron-shared-texture.js.map +1 -1
  51. package/dist/api/utilities/index.d.ts +1 -1
  52. package/dist/api/utilities/index.js.map +1 -1
  53. package/dist/api/webrtc-stream.d.ts +0 -1
  54. package/dist/api/webrtc-stream.js +0 -1
  55. package/dist/api/webrtc-stream.js.map +1 -1
  56. package/dist/constants/bsf-options.d.ts +333 -0
  57. package/dist/constants/bsf-options.js +7 -0
  58. package/dist/constants/bsf-options.js.map +1 -0
  59. package/dist/constants/constants.d.ts +109 -0
  60. package/dist/constants/constants.js +110 -0
  61. package/dist/constants/constants.js.map +1 -1
  62. package/dist/constants/decoders.d.ts +636 -618
  63. package/dist/constants/decoders.js +1 -3
  64. package/dist/constants/decoders.js.map +1 -1
  65. package/dist/constants/encoders.d.ts +300 -282
  66. package/dist/constants/encoders.js +0 -2
  67. package/dist/constants/encoders.js.map +1 -1
  68. package/dist/constants/filter-options.d.ts +10915 -0
  69. package/dist/constants/filter-options.js +7 -0
  70. package/dist/constants/filter-options.js.map +1 -0
  71. package/dist/constants/format-options.d.ts +3056 -0
  72. package/dist/constants/format-options.js +7 -0
  73. package/dist/constants/format-options.js.map +1 -0
  74. package/dist/constants/formats.d.ts +18 -0
  75. package/dist/constants/formats.js +7 -0
  76. package/dist/constants/formats.js.map +1 -0
  77. package/dist/constants/index.d.ts +5 -0
  78. package/dist/constants/options.d.ts +4073 -0
  79. package/dist/constants/options.js +7 -0
  80. package/dist/constants/options.js.map +1 -0
  81. package/dist/lib/binding.d.ts +4 -1
  82. package/dist/lib/binding.js.map +1 -1
  83. package/dist/lib/codec.d.ts +36 -5
  84. package/dist/lib/codec.js +37 -4
  85. package/dist/lib/codec.js.map +1 -1
  86. package/dist/lib/dictionary.d.ts +1 -1
  87. package/dist/lib/dictionary.js.map +1 -1
  88. package/dist/lib/error.d.ts +69 -0
  89. package/dist/lib/error.js +92 -0
  90. package/dist/lib/error.js.map +1 -1
  91. package/dist/lib/frame.d.ts +46 -3
  92. package/dist/lib/frame.js +50 -3
  93. package/dist/lib/frame.js.map +1 -1
  94. package/dist/lib/index.d.ts +1 -1
  95. package/dist/lib/index.js.map +1 -1
  96. package/dist/lib/native-types.d.ts +68 -0
  97. package/dist/lib/packet.d.ts +17 -3
  98. package/dist/lib/packet.js +19 -3
  99. package/dist/lib/packet.js.map +1 -1
  100. package/dist/lib/utilities.d.ts +21 -0
  101. package/dist/lib/utilities.js +23 -0
  102. package/dist/lib/utilities.js.map +1 -1
  103. package/dist/webrtc/index.d.ts +3 -0
  104. package/dist/webrtc/index.js +7 -0
  105. package/dist/webrtc/index.js.map +1 -0
  106. package/package.json +32 -21
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![FFmpeg](https://img.shields.io/badge/FFmpeg-8.1-green.svg)](https://ffmpeg.org)
12
12
  [![Platform](https://img.shields.io/badge/platform-Windows%20(MSVC%20%7C%20MinGW)%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/seydx/node-av)
13
13
 
14
- Native Node.js bindings for FFmpeg with full TypeScript support. Provides direct access to FFmpeg's C APIs through N-API. Includes both raw FFmpeg bindings for full control and higher-level abstractions. Automatic resource management via Disposable pattern, hardware acceleration support and prebuilt binaries for Windows, Linux, and macOS.
14
+ Native Node.js bindings for FFmpeg with full TypeScript support - including type-safe options (autocomplete + validation) for every codec, format, filter, and bitstream filter, generated from FFmpeg's own metadata. Provides direct access to FFmpeg's C APIs through N-API. Includes both raw FFmpeg bindings for full control and higher-level abstractions. Automatic resource management via Disposable pattern, hardware acceleration support and prebuilt binaries for Windows, Linux, and macOS.
15
15
 
16
16
  📚 **[Documentation](https://seydx.github.io/node-av)**
17
17
 
@@ -446,6 +446,9 @@ import * as ffmpeg from 'node-av';
446
446
 
447
447
  Beyond basic transcoding, NodeAV provides advanced media processing capabilities:
448
448
 
449
+ **Fully Typed FFmpeg Options**
450
+ Every FFmpeg option is typed - across codecs, formats, ~580 filters, and bitstream filters. Keys autocomplete, enum values are validated, and typos become compile-time errors, all generated directly from FFmpeg's `AVOption` metadata (including each option's description and a link to the FFmpeg docs as JSDoc). No more grepping the FFmpeg docs for flag names.
451
+
449
452
  **Speech Recognition with Whisper**
450
453
  Integrate automatic speech-to-text transcription using OpenAI's Whisper model through the whisper.cpp implementation. The library handles automatic model downloading from HuggingFace, supports multiple model sizes (tiny, base, small, medium, large) for different accuracy/performance tradeoffs, and provides hardware-accelerated inference through Metal (macOS), Vulkan (cross-platform), or OpenCL backends. Transcription results include precise timestamps and can be processed in real-time from any audio source.
451
454
 
@@ -458,6 +461,9 @@ Stream any media source directly to web browsers through fragmented MP4 (fMP4) o
458
461
  **RTSP Backchannel / Talkback**
459
462
  Implements bidirectional RTSP communication for IP camera integration. The library provides native support for RTSP backchannel streams, enabling audio transmission to camera devices. Transport is handled automatically with support for both TCP (interleaved mode) and UDP protocols, with proper RTP packet formatting and stream synchronization.
460
463
 
464
+ **Image Scaling & Snapshots**
465
+ The `Scaler` turns decoded frames into raw pixel buffers (`rgb`/`rgba`/`gray`/`nv12`/`yuv420p`) or JPEG/PNG images for detection, thumbnail, and snapshot workloads. One reusable instance pools its swscale contexts, GPU filter graphs, and encoders for zero per-frame allocation; hardware frames are cropped/scaled on the GPU with only the small result downloaded. Recurring resolutions can also be served directly by `EncoderPool`.
466
+
461
467
  See the [Examples](#examples) section for complete implementations.
462
468
 
463
469
  ## Performance
@@ -522,11 +528,14 @@ If you encounter module resolution errors like `Cannot find module 'lib/binary-s
522
528
  | `electron-builder` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/electron/builder) |
523
529
  | `electron-forge` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/electron/forge) |
524
530
  | `api-abort-signal` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-abort-signal.ts) |
531
+ | `api-bitstream-filter` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-bitstream-filter.ts) |
525
532
  | `api-dash` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-dash.ts) |
533
+ | `api-decoder-resample` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-decoder-resample.ts) |
526
534
  | `api-device-capture` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-device-capture.ts) |
527
535
  | `api-encode-decode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-encode-decode.ts) |
528
536
  | `api-filter-complex` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-filter-complex.ts) |
529
537
  | `api-filter-complex-grid` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-filter-complex-grid.ts) |
538
+ | `api-filter-complex-typed` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-filter-complex-typed.ts) |
530
539
  | `api-fmp4` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-fmp4.ts) |
531
540
  | `api-frame-extract` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-frame-extract.ts) |
532
541
  | `api-hw-codecs` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-codecs.ts) |
@@ -539,10 +548,15 @@ If you encounter module resolution errors like `Cannot find module 'lib/binary-s
539
548
  | `api-hw-filter-sync` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-hw-filter-sync.ts) |
540
549
  | `api-muxing` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-muxing.ts) |
541
550
  | `api-pipeline-hw-rtsp` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-pipeline-hw-rtsp.ts) |
551
+ | `api-pipeline-progress` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-pipeline-progress.ts) |
542
552
  | `api-pipeline-raw-muxing` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-pipeline-raw-muxing.ts) |
553
+ | `api-probe` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-probe.ts) |
543
554
  | `api-rtp` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-rtp.ts) |
555
+ | `api-rtsp-backchannel` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-rtsp-backchannel.ts) |
556
+ | `api-scaler` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-scaler.ts) |
544
557
  | `api-sdp-custom` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sdp-custom.ts) |
545
558
  | `api-sdp-input` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sdp-input.ts) |
559
+ | `api-snapshot` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-snapshot.ts) |
546
560
  | `api-stream-input` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-stream-input.ts) |
547
561
  | `api-sw-decode-hw-encode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sw-decode-hw-encode.ts) |
548
562
  | `api-sw-transcode` | | | [✓](https://github.com/seydx/node-av/tree/main/examples/api-sw-transcode.ts) |
@@ -1,19 +1,25 @@
1
1
  import { Packet } from '../lib/packet.js';
2
+ import { Stream } from '../lib/stream.js';
3
+ import { Encoder } from './encoder.js';
2
4
  import { Muxer } from './muxer.js';
3
5
  import { Scheduler, SchedulerControl } from './utilities/scheduler.js';
4
- import type { Stream } from '../lib/stream.js';
6
+ import type { BsfName, BsfOptionsFor } from '../constants/index.js';
5
7
  /**
6
8
  * Options for bitstream filter creation.
9
+ *
10
+ * @template N - The bitstream filter name; when a literal name is given,
11
+ * `options` is strongly typed to that filter's known options.
7
12
  */
8
- export interface BitstreamFilterOptions {
13
+ export interface BitstreamFilterOptions<N extends string = string> {
9
14
  /**
10
15
  * Filter-specific options.
11
16
  *
12
- * Key-value pairs of FFmpeg bitstream filter options.
13
- * These are passed directly to the filter via av_opt_set().
14
- * Available options depend on the specific filter being used.
17
+ * Key-value pairs of FFmpeg bitstream filter options, passed directly to the
18
+ * filter via av_opt_set(). When created from a known filter name, these are
19
+ * strongly typed to that filter's options (autocomplete + validation);
20
+ * otherwise any string/number/boolean values are accepted.
15
21
  */
16
- options?: Record<string, string | number | boolean | bigint | undefined | null>;
22
+ options?: BsfOptionsFor<N>;
17
23
  /**
18
24
  * AbortSignal for cancellation.
19
25
  *
@@ -63,7 +69,8 @@ export interface BitstreamFilterOptions {
63
69
  export declare class BitStreamFilterAPI implements Disposable {
64
70
  private ctx;
65
71
  private bsf;
66
- private stream;
72
+ private source;
73
+ private initialized;
67
74
  private packet;
68
75
  private isClosed;
69
76
  private inputQueue;
@@ -77,63 +84,55 @@ export declare class BitStreamFilterAPI implements Disposable {
77
84
  *
78
85
  * @param ctx - Filter context
79
86
  *
80
- * @param stream - Associated stream
87
+ * @param source - Input source for lazy parameter resolution
81
88
  *
82
89
  * @internal
83
90
  */
84
91
  private constructor();
85
92
  /**
86
- * Create a bitstream filter for a stream.
93
+ * Create a bitstream filter.
94
+ *
95
+ * The input source provides the codec parameters the filter is configured with.
96
+ * Pass a {@link Stream} to filter its packets directly (stream copy), or an
97
+ * {@link Encoder} to filter that encoder's output (transcode) - parameters are
98
+ * derived from the encoder once it is open. Another {@link BitStreamFilterAPI}
99
+ * may be passed to chain filters.
87
100
  *
88
- * Initializes filter with stream codec parameters.
89
- * Configures time base and prepares for packet processing.
101
+ * Initialization is lazy: filter options are validated immediately, but the
102
+ * input parameters are bound and the filter is initialized on the first packet,
103
+ * so an `Encoder` source (opened lazily on its first frame) is ready in time.
90
104
  *
91
105
  * Direct mapping to av_bsf_get_by_name() and av_bsf_alloc().
92
106
  *
93
107
  * @param filterName - Name of the bitstream filter
94
108
  *
95
- * @param stream - Stream to apply filter to
109
+ * @param source - Input source: a `Stream` (copy), `Encoder` (transcode), or upstream filter (chain)
96
110
  *
97
111
  * @param filterOptions - Optional filter-specific options
98
112
  *
99
113
  * @returns Configured bitstream filter
100
114
  *
101
- * @throws {Error} If initialization fails
102
- *
103
- * @throws {FFmpegError} If allocation or initialization fails
115
+ * @throws {FFmpegError} If the filter is not found, allocation fails, or an option is invalid
104
116
  *
105
117
  * @example
106
118
  * ```typescript
107
- * // H.264 MP4 to Annex B conversion
119
+ * // Stream copy: H.264 MP4 to Annex B conversion
108
120
  * const filter = BitStreamFilterAPI.create('h264_mp4toannexb', videoStream);
109
121
  * ```
110
122
  *
111
123
  * @example
112
124
  * ```typescript
113
- * // AAC ADTS to ASC conversion
114
- * const filter = BitStreamFilterAPI.create('aac_adtstoasc', audioStream);
115
- * ```
116
- *
117
- * @example
118
- * ```typescript
119
- * // Remove AUDs from H.264 stream
120
- * const filter = BitStreamFilterAPI.create('h264_metadata', stream, {
121
- * options: { aud: 'remove' }
122
- * });
123
- * ```
124
- *
125
- * @example
126
- * ```typescript
127
- * // Set H.264 level
128
- * const filter = BitStreamFilterAPI.create('h264_metadata', stream, {
129
- * options: { level: 51 }
125
+ * // Transcode: derive parameters from the encoder's output
126
+ * const filter = BitStreamFilterAPI.create('h264_metadata', encoder, {
127
+ * options: { aud: 'remove', level: '4.1' },
130
128
  * });
129
+ * pipeline(input, decoder, encoder, filter, output);
131
130
  * ```
132
131
  *
133
132
  * @see {@link BitStreamFilter.getByName} For filter discovery
134
133
  * @see {@link BitstreamFilterOptions} For available options
135
134
  */
136
- static create(filterName: string, stream: Stream, filterOptions?: BitstreamFilterOptions): BitStreamFilterAPI;
135
+ static create<const N extends BsfName | (string & {}) = BsfName | (string & {})>(filterName: N, source: Stream | Encoder | BitStreamFilterAPI, filterOptions?: BitstreamFilterOptions<N>): BitStreamFilterAPI;
137
136
  /**
138
137
  * Get filter name.
139
138
  *
@@ -179,6 +178,38 @@ export declare class BitStreamFilterAPI implements Disposable {
179
178
  * ```
180
179
  */
181
180
  get isBitstreamFilterOpen(): boolean;
181
+ /**
182
+ * Check if the filter has been initialized.
183
+ *
184
+ * Initialization is lazy and happens on the first processed packet, after
185
+ * which {@link outputCodecParameters} reflect the filter's output.
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * if (filter.isInitialized) {
190
+ * const params = filter.outputCodecParameters;
191
+ * }
192
+ * ```
193
+ */
194
+ get isInitialized(): boolean;
195
+ /**
196
+ * Get associated stream.
197
+ *
198
+ * Returns the stream this filter was created for. Only available when the
199
+ * filter was created from a {@link Stream}; filters created from an `Encoder`
200
+ * derive their parameters from the encoder's output instead.
201
+ *
202
+ * @returns Associated stream
203
+ *
204
+ * @throws {Error} If the filter was not created from a stream
205
+ *
206
+ * @example
207
+ * ```typescript
208
+ * const stream = filter.getStream();
209
+ * console.log(`Filtering stream ${stream.index}`);
210
+ * ```
211
+ */
212
+ getStream(): Stream;
182
213
  /**
183
214
  * Send a packet to the filter.
184
215
  *
@@ -637,6 +668,43 @@ export declare class BitStreamFilterAPI implements Disposable {
637
668
  * @see {@link receive} For async version
638
669
  */
639
670
  receiveSync(): Packet | null;
671
+ /**
672
+ * Pipe output to another bitstream filter.
673
+ *
674
+ * Starts background worker for packet processing.
675
+ * Packets flow through: input → this filter → target filter.
676
+ *
677
+ * @param target - Target bitstream filter
678
+ *
679
+ * @returns Scheduler for continued chaining
680
+ *
681
+ * @example
682
+ * ```typescript
683
+ * const filter1 = BitStreamFilterAPI.create('h264_mp4toannexb', stream);
684
+ * const filter2 = BitStreamFilterAPI.create('dump_extra', stream);
685
+ * filter1.pipeTo(filter2).pipeTo(output, 0);
686
+ * ```
687
+ */
688
+ pipeTo(target: BitStreamFilterAPI): Scheduler<Packet>;
689
+ /**
690
+ * Pipe output to muxer.
691
+ *
692
+ * Terminal stage - writes filtered packets to output file.
693
+ *
694
+ * @param output - Muxer to write to
695
+ *
696
+ * @param streamIndex - Stream index in output
697
+ *
698
+ * @returns Control interface for pipeline
699
+ *
700
+ * @example
701
+ * ```typescript
702
+ * const filter = BitStreamFilterAPI.create('h264_mp4toannexb', stream);
703
+ * const control = filter.pipeTo(output, 0);
704
+ * await control.send(packet);
705
+ * ```
706
+ */
707
+ pipeTo(output: Muxer, streamIndex: number): SchedulerControl<Packet>;
640
708
  /**
641
709
  * Flush all buffered packets as async generator.
642
710
  *
@@ -686,20 +754,6 @@ export declare class BitStreamFilterAPI implements Disposable {
686
754
  * @see {@link flushPackets} For async version
687
755
  */
688
756
  flushPacketsSync(): Generator<Packet>;
689
- /**
690
- * Get associated stream.
691
- *
692
- * Returns the stream this filter was created for.
693
- *
694
- * @returns Associated stream
695
- *
696
- * @example
697
- * ```typescript
698
- * const stream = filter.getStream();
699
- * console.log(`Filtering stream ${stream.index}`);
700
- * ```
701
- */
702
- getStream(): Stream;
703
757
  /**
704
758
  * Reset filter state.
705
759
  *
@@ -748,6 +802,12 @@ export declare class BitStreamFilterAPI implements Disposable {
748
802
  * @see {@link close} For manual cleanup
749
803
  */
750
804
  [Symbol.dispose](): void;
805
+ /**
806
+ * Bind input parameters from the source and initialize the filter.
807
+ *
808
+ * @internal
809
+ */
810
+ private ensureInitialized;
751
811
  /**
752
812
  * Send packet to input queue or flush the pipeline.
753
813
  *
@@ -765,7 +825,7 @@ export declare class BitStreamFilterAPI implements Disposable {
765
825
  *
766
826
  * @internal
767
827
  */
768
- sendToQueue(packet: Packet | null): Promise<void>;
828
+ private sendToQueue;
769
829
  /**
770
830
  * Receive packet from output queue.
771
831
  *
@@ -773,48 +833,11 @@ export declare class BitStreamFilterAPI implements Disposable {
773
833
  *
774
834
  * @internal
775
835
  */
776
- receiveFromQueue(): Promise<Packet | null>;
836
+ private receiveFromQueue;
777
837
  /**
778
838
  * Worker loop for push-based processing.
779
839
  *
780
840
  * @internal
781
841
  */
782
842
  private runWorker;
783
- /**
784
- * Pipe output to another bitstream filter.
785
- *
786
- * Starts background worker for packet processing.
787
- * Packets flow through: input → this filter → target filter.
788
- *
789
- * @param target - Target bitstream filter
790
- *
791
- * @returns Scheduler for continued chaining
792
- *
793
- * @example
794
- * ```typescript
795
- * const filter1 = BitStreamFilterAPI.create('h264_mp4toannexb', stream);
796
- * const filter2 = BitStreamFilterAPI.create('dump_extra', stream);
797
- * filter1.pipeTo(filter2).pipeTo(output, 0);
798
- * ```
799
- */
800
- pipeTo(target: BitStreamFilterAPI): Scheduler<Packet>;
801
- /**
802
- * Pipe output to muxer.
803
- *
804
- * Terminal stage - writes filtered packets to output file.
805
- *
806
- * @param output - Muxer to write to
807
- *
808
- * @param streamIndex - Stream index in output
809
- *
810
- * @returns Control interface for pipeline
811
- *
812
- * @example
813
- * ```typescript
814
- * const filter = BitStreamFilterAPI.create('h264_mp4toannexb', stream);
815
- * const control = filter.pipeTo(output, 0);
816
- * await control.send(packet);
817
- * ```
818
- */
819
- pipeTo(output: Muxer, streamIndex: number): SchedulerControl<Packet>;
820
843
  }