node-av 3.1.2 → 4.0.0

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 (157) hide show
  1. package/README.md +65 -52
  2. package/binding.gyp +4 -0
  3. package/dist/api/audio-frame-buffer.d.ts +201 -0
  4. package/dist/api/audio-frame-buffer.js +275 -0
  5. package/dist/api/audio-frame-buffer.js.map +1 -0
  6. package/dist/api/bitstream-filter.d.ts +319 -78
  7. package/dist/api/bitstream-filter.js +680 -151
  8. package/dist/api/bitstream-filter.js.map +1 -1
  9. package/dist/api/constants.d.ts +44 -0
  10. package/dist/api/constants.js +45 -0
  11. package/dist/api/constants.js.map +1 -0
  12. package/dist/api/data/test_av1.ivf +0 -0
  13. package/dist/api/data/test_mjpeg.mjpeg +0 -0
  14. package/dist/api/data/test_vp8.ivf +0 -0
  15. package/dist/api/data/test_vp9.ivf +0 -0
  16. package/dist/api/decoder.d.ts +279 -17
  17. package/dist/api/decoder.js +998 -209
  18. package/dist/api/decoder.js.map +1 -1
  19. package/dist/api/{media-input.d.ts → demuxer.d.ts} +294 -44
  20. package/dist/api/demuxer.js +1968 -0
  21. package/dist/api/demuxer.js.map +1 -0
  22. package/dist/api/encoder.d.ts +308 -50
  23. package/dist/api/encoder.js +1133 -111
  24. package/dist/api/encoder.js.map +1 -1
  25. package/dist/api/filter-presets.d.ts +12 -5
  26. package/dist/api/filter-presets.js +21 -7
  27. package/dist/api/filter-presets.js.map +1 -1
  28. package/dist/api/filter.d.ts +406 -40
  29. package/dist/api/filter.js +966 -139
  30. package/dist/api/filter.js.map +1 -1
  31. package/dist/api/{fmp4.d.ts → fmp4-stream.d.ts} +141 -140
  32. package/dist/api/fmp4-stream.js +539 -0
  33. package/dist/api/fmp4-stream.js.map +1 -0
  34. package/dist/api/hardware.d.ts +58 -6
  35. package/dist/api/hardware.js +127 -11
  36. package/dist/api/hardware.js.map +1 -1
  37. package/dist/api/index.d.ts +6 -4
  38. package/dist/api/index.js +14 -8
  39. package/dist/api/index.js.map +1 -1
  40. package/dist/api/io-stream.d.ts +3 -3
  41. package/dist/api/io-stream.js +5 -4
  42. package/dist/api/io-stream.js.map +1 -1
  43. package/dist/api/{media-output.d.ts → muxer.d.ts} +274 -60
  44. package/dist/api/muxer.js +1934 -0
  45. package/dist/api/muxer.js.map +1 -0
  46. package/dist/api/pipeline.d.ts +77 -29
  47. package/dist/api/pipeline.js +435 -425
  48. package/dist/api/pipeline.js.map +1 -1
  49. package/dist/api/rtp-stream.d.ts +312 -0
  50. package/dist/api/rtp-stream.js +630 -0
  51. package/dist/api/rtp-stream.js.map +1 -0
  52. package/dist/api/types.d.ts +476 -55
  53. package/dist/api/utilities/async-queue.d.ts +91 -0
  54. package/dist/api/utilities/async-queue.js +162 -0
  55. package/dist/api/utilities/async-queue.js.map +1 -0
  56. package/dist/api/utilities/audio-sample.d.ts +1 -1
  57. package/dist/api/utilities/image.d.ts +1 -1
  58. package/dist/api/utilities/index.d.ts +2 -0
  59. package/dist/api/utilities/index.js +4 -0
  60. package/dist/api/utilities/index.js.map +1 -1
  61. package/dist/api/utilities/media-type.d.ts +1 -1
  62. package/dist/api/utilities/pixel-format.d.ts +1 -1
  63. package/dist/api/utilities/sample-format.d.ts +1 -1
  64. package/dist/api/utilities/scheduler.d.ts +169 -0
  65. package/dist/api/utilities/scheduler.js +136 -0
  66. package/dist/api/utilities/scheduler.js.map +1 -0
  67. package/dist/api/utilities/streaming.d.ts +74 -15
  68. package/dist/api/utilities/streaming.js +170 -12
  69. package/dist/api/utilities/streaming.js.map +1 -1
  70. package/dist/api/utilities/timestamp.d.ts +1 -1
  71. package/dist/api/webrtc-stream.d.ts +288 -0
  72. package/dist/api/webrtc-stream.js +440 -0
  73. package/dist/api/webrtc-stream.js.map +1 -0
  74. package/dist/constants/constants.d.ts +51 -1
  75. package/dist/constants/constants.js +47 -1
  76. package/dist/constants/constants.js.map +1 -1
  77. package/dist/constants/encoders.d.ts +2 -1
  78. package/dist/constants/encoders.js +4 -3
  79. package/dist/constants/encoders.js.map +1 -1
  80. package/dist/constants/hardware.d.ts +26 -0
  81. package/dist/constants/hardware.js +27 -0
  82. package/dist/constants/hardware.js.map +1 -0
  83. package/dist/constants/index.d.ts +1 -0
  84. package/dist/constants/index.js +1 -0
  85. package/dist/constants/index.js.map +1 -1
  86. package/dist/lib/binding.d.ts +19 -8
  87. package/dist/lib/binding.js.map +1 -1
  88. package/dist/lib/codec-context.d.ts +87 -0
  89. package/dist/lib/codec-context.js +125 -4
  90. package/dist/lib/codec-context.js.map +1 -1
  91. package/dist/lib/codec-parameters.d.ts +183 -1
  92. package/dist/lib/codec-parameters.js +209 -0
  93. package/dist/lib/codec-parameters.js.map +1 -1
  94. package/dist/lib/codec-parser.d.ts +23 -0
  95. package/dist/lib/codec-parser.js +25 -0
  96. package/dist/lib/codec-parser.js.map +1 -1
  97. package/dist/lib/codec.d.ts +26 -4
  98. package/dist/lib/codec.js +35 -0
  99. package/dist/lib/codec.js.map +1 -1
  100. package/dist/lib/dictionary.js +1 -0
  101. package/dist/lib/dictionary.js.map +1 -1
  102. package/dist/lib/error.js +1 -1
  103. package/dist/lib/error.js.map +1 -1
  104. package/dist/lib/filter-context.d.ts +52 -11
  105. package/dist/lib/filter-context.js +56 -12
  106. package/dist/lib/filter-context.js.map +1 -1
  107. package/dist/lib/filter-graph.d.ts +9 -0
  108. package/dist/lib/filter-graph.js +13 -0
  109. package/dist/lib/filter-graph.js.map +1 -1
  110. package/dist/lib/filter.d.ts +21 -0
  111. package/dist/lib/filter.js +28 -0
  112. package/dist/lib/filter.js.map +1 -1
  113. package/dist/lib/format-context.d.ts +48 -14
  114. package/dist/lib/format-context.js +76 -7
  115. package/dist/lib/format-context.js.map +1 -1
  116. package/dist/lib/frame.d.ts +168 -0
  117. package/dist/lib/frame.js +212 -0
  118. package/dist/lib/frame.js.map +1 -1
  119. package/dist/lib/hardware-device-context.d.ts +3 -2
  120. package/dist/lib/hardware-device-context.js.map +1 -1
  121. package/dist/lib/index.d.ts +1 -0
  122. package/dist/lib/index.js +2 -0
  123. package/dist/lib/index.js.map +1 -1
  124. package/dist/lib/input-format.d.ts +21 -0
  125. package/dist/lib/input-format.js +42 -2
  126. package/dist/lib/input-format.js.map +1 -1
  127. package/dist/lib/native-types.d.ts +48 -26
  128. package/dist/lib/option.d.ts +25 -13
  129. package/dist/lib/option.js +28 -0
  130. package/dist/lib/option.js.map +1 -1
  131. package/dist/lib/output-format.d.ts +22 -1
  132. package/dist/lib/output-format.js +28 -0
  133. package/dist/lib/output-format.js.map +1 -1
  134. package/dist/lib/packet.d.ts +35 -0
  135. package/dist/lib/packet.js +52 -2
  136. package/dist/lib/packet.js.map +1 -1
  137. package/dist/lib/stream.d.ts +126 -0
  138. package/dist/lib/stream.js +188 -5
  139. package/dist/lib/stream.js.map +1 -1
  140. package/dist/lib/sync-queue.d.ts +179 -0
  141. package/dist/lib/sync-queue.js +197 -0
  142. package/dist/lib/sync-queue.js.map +1 -0
  143. package/dist/lib/types.d.ts +27 -1
  144. package/dist/lib/utilities.d.ts +281 -53
  145. package/dist/lib/utilities.js +298 -55
  146. package/dist/lib/utilities.js.map +1 -1
  147. package/install/check.js +18 -7
  148. package/package.json +20 -19
  149. package/dist/api/fmp4.js +0 -710
  150. package/dist/api/fmp4.js.map +0 -1
  151. package/dist/api/media-input.js +0 -1075
  152. package/dist/api/media-input.js.map +0 -1
  153. package/dist/api/media-output.js +0 -1040
  154. package/dist/api/media-output.js.map +0 -1
  155. package/dist/api/webrtc.d.ts +0 -664
  156. package/dist/api/webrtc.js +0 -1132
  157. package/dist/api/webrtc.js.map +0 -1
@@ -0,0 +1,179 @@
1
+ import type { NativeSyncQueue, NativeWrapper } from './native-types.js';
2
+ import type { Packet } from './packet.js';
3
+ /**
4
+ * Sync Queue Type
5
+ *
6
+ * Determines the sync queue behavior for different media types.
7
+ */
8
+ export declare enum SyncQueueType {
9
+ /**
10
+ * Buffer packets based on their duration in time base units.
11
+ * Used for audio and video streams.
12
+ */
13
+ PACKETS = 0,
14
+ /**
15
+ * Buffer frames based on their sample count.
16
+ * Used for audio frames where synchronization is sample-based.
17
+ */
18
+ FRAMES = 1
19
+ }
20
+ /**
21
+ * Sync Queue for packet synchronization
22
+ *
23
+ * FFmpeg's native sync_queue from fftools that synchronizes packets from multiple
24
+ * streams before muxing. Prevents streams from getting ahead of each other and
25
+ * ensures proper interleaving for containers with strict timing requirements.
26
+ *
27
+ * This is the same synchronization mechanism used by FFmpeg CLI (fftools).
28
+ *
29
+ * Direct mapping to FFmpeg's SyncQueue from fftools/sync_queue.h.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * import { SyncQueue, SyncQueueType } from 'node-av';
34
+ *
35
+ * // Create sync queue with 1 second buffer
36
+ * const sq = SyncQueue.create(SyncQueueType.PACKETS, 1000000);
37
+ *
38
+ * // Add streams
39
+ * const videoIdx = sq.addStream(1); // 1 = limiting stream
40
+ * const audioIdx = sq.addStream(1);
41
+ *
42
+ * // Send packets to queue
43
+ * sq.send(videoIdx, videoPacket);
44
+ * sq.send(audioIdx, audioPacket);
45
+ *
46
+ * // Receive synchronized packets
47
+ * const result = sq.receive(-1); // -1 = any stream
48
+ * if (result.error === 0) {
49
+ * console.log(`Stream ${result.streamIdx}: ${result.packet}`);
50
+ * // Write packet to muxer...
51
+ * }
52
+ *
53
+ * // Cleanup
54
+ * sq.free();
55
+ * ```
56
+ *
57
+ * @see [sync_queue.h](https://github.com/FFmpeg/FFmpeg/blob/master/fftools/sync_queue.h) - FFmpeg source
58
+ */
59
+ export declare class SyncQueue implements Disposable, NativeWrapper<NativeSyncQueue> {
60
+ /** @internal */
61
+ native: NativeSyncQueue;
62
+ private constructor();
63
+ /**
64
+ * Create a new sync queue.
65
+ *
66
+ * @param type - Queue type (PACKETS or FRAMES)
67
+ *
68
+ * @param bufferSizeUs - Buffer size in microseconds (default: 100ms)
69
+ *
70
+ * @returns New SyncQueue instance
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * // 500ms buffer for RTSP streams
75
+ * const sq = SyncQueue.create(SyncQueueType.PACKETS, 500000);
76
+ * ```
77
+ */
78
+ static create(type?: SyncQueueType, bufferSizeUs?: number): SyncQueue;
79
+ /**
80
+ * Add a stream to the sync queue.
81
+ *
82
+ * @param limiting - Whether this stream should limit other streams (1 = yes, 0 = no).
83
+ * Limiting streams control the head position - other streams cannot get ahead.
84
+ *
85
+ * @returns Stream index in the sync queue
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const videoIdx = sq.addStream(1); // Video limits timing
90
+ * const audioIdx = sq.addStream(1); // Audio limits timing
91
+ * const subtitleIdx = sq.addStream(0); // Subtitles don't limit
92
+ * ```
93
+ */
94
+ addStream(limiting?: number): number;
95
+ /**
96
+ * Send a packet to the sync queue.
97
+ *
98
+ * The packet is cloned internally, so the original can be reused/freed.
99
+ *
100
+ * To signal EOF for a stream, pass null as the packet.
101
+ * This tells the sync queue that no more packets will be sent for this stream.
102
+ *
103
+ * @param streamIdx - Stream index returned from addStream()
104
+ *
105
+ * @param packet - Packet to send, or null to signal EOF
106
+ *
107
+ * @returns 0 on success, AVERROR_EOF if EOF, negative on error
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * // Send normal packet
112
+ * const ret = sq.send(videoIdx, packet);
113
+ * if (ret === AVERROR_EOF) {
114
+ * console.log('Stream finished');
115
+ * }
116
+ *
117
+ * // Signal EOF for stream
118
+ * sq.send(videoIdx, null);
119
+ * ```
120
+ */
121
+ send(streamIdx: number, packet: Packet | null): number;
122
+ /**
123
+ * Receive a packet from the sync queue.
124
+ *
125
+ * This will receive the next packet that should be written to maintain
126
+ * proper synchronization between streams. The packet parameter is filled
127
+ * with the received data.
128
+ *
129
+ * @param streamIdx - Stream index to receive from, or -1 for any stream
130
+ *
131
+ * @param packet - Packet to fill with received data (output parameter)
132
+ *
133
+ * @returns Stream index (>= 0) on success, or negative error code:
134
+ * - >= 0: Stream index that the packet belongs to
135
+ * - AVERROR(EAGAIN): No packets ready yet, more frames needed
136
+ * - AVERROR_EOF: All streams finished
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * import { AVERROR } from 'node-av';
141
+ *
142
+ * // Receive from any stream (FFmpeg mux pattern)
143
+ * const packet = new Packet();
144
+ * while (true) {
145
+ * const ret = sq.receive(-1, packet);
146
+ * if (ret === AVERROR('EAGAIN')) {
147
+ * break; // No packets ready
148
+ * }
149
+ * if (ret === AVERROR_EOF) {
150
+ * break; // All streams finished
151
+ * }
152
+ * if (ret >= 0) {
153
+ * // ret is the stream index
154
+ * await muxer.interleavedWriteFrame(packet);
155
+ * }
156
+ * }
157
+ * ```
158
+ */
159
+ receive(streamIdx: number, packet: Packet): number;
160
+ /**
161
+ * Free the sync queue and all buffered packets.
162
+ * After calling this, the queue cannot be used anymore.
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * sq.free();
167
+ * ```
168
+ */
169
+ free(): void;
170
+ /**
171
+ * Get the underlying native SyncQueue object.
172
+ *
173
+ * @returns The native SyncQueue binding object
174
+ *
175
+ * @internal
176
+ */
177
+ getNative(): NativeSyncQueue;
178
+ [Symbol.dispose](): void;
179
+ }
@@ -0,0 +1,197 @@
1
+ import { bindings } from './binding.js';
2
+ /**
3
+ * Sync Queue Type
4
+ *
5
+ * Determines the sync queue behavior for different media types.
6
+ */
7
+ export var SyncQueueType;
8
+ (function (SyncQueueType) {
9
+ /**
10
+ * Buffer packets based on their duration in time base units.
11
+ * Used for audio and video streams.
12
+ */
13
+ SyncQueueType[SyncQueueType["PACKETS"] = 0] = "PACKETS";
14
+ /**
15
+ * Buffer frames based on their sample count.
16
+ * Used for audio frames where synchronization is sample-based.
17
+ */
18
+ SyncQueueType[SyncQueueType["FRAMES"] = 1] = "FRAMES";
19
+ })(SyncQueueType || (SyncQueueType = {}));
20
+ /**
21
+ * Sync Queue for packet synchronization
22
+ *
23
+ * FFmpeg's native sync_queue from fftools that synchronizes packets from multiple
24
+ * streams before muxing. Prevents streams from getting ahead of each other and
25
+ * ensures proper interleaving for containers with strict timing requirements.
26
+ *
27
+ * This is the same synchronization mechanism used by FFmpeg CLI (fftools).
28
+ *
29
+ * Direct mapping to FFmpeg's SyncQueue from fftools/sync_queue.h.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * import { SyncQueue, SyncQueueType } from 'node-av';
34
+ *
35
+ * // Create sync queue with 1 second buffer
36
+ * const sq = SyncQueue.create(SyncQueueType.PACKETS, 1000000);
37
+ *
38
+ * // Add streams
39
+ * const videoIdx = sq.addStream(1); // 1 = limiting stream
40
+ * const audioIdx = sq.addStream(1);
41
+ *
42
+ * // Send packets to queue
43
+ * sq.send(videoIdx, videoPacket);
44
+ * sq.send(audioIdx, audioPacket);
45
+ *
46
+ * // Receive synchronized packets
47
+ * const result = sq.receive(-1); // -1 = any stream
48
+ * if (result.error === 0) {
49
+ * console.log(`Stream ${result.streamIdx}: ${result.packet}`);
50
+ * // Write packet to muxer...
51
+ * }
52
+ *
53
+ * // Cleanup
54
+ * sq.free();
55
+ * ```
56
+ *
57
+ * @see [sync_queue.h](https://github.com/FFmpeg/FFmpeg/blob/master/fftools/sync_queue.h) - FFmpeg source
58
+ */
59
+ export class SyncQueue {
60
+ /** @internal */
61
+ native;
62
+ constructor(native) {
63
+ this.native = native;
64
+ }
65
+ /**
66
+ * Create a new sync queue.
67
+ *
68
+ * @param type - Queue type (PACKETS or FRAMES)
69
+ *
70
+ * @param bufferSizeUs - Buffer size in microseconds (default: 100ms)
71
+ *
72
+ * @returns New SyncQueue instance
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * // 500ms buffer for RTSP streams
77
+ * const sq = SyncQueue.create(SyncQueueType.PACKETS, 500000);
78
+ * ```
79
+ */
80
+ static create(type = SyncQueueType.PACKETS, bufferSizeUs = 100000) {
81
+ const native = bindings.SyncQueue.create(type, bufferSizeUs);
82
+ return new SyncQueue(native);
83
+ }
84
+ /**
85
+ * Add a stream to the sync queue.
86
+ *
87
+ * @param limiting - Whether this stream should limit other streams (1 = yes, 0 = no).
88
+ * Limiting streams control the head position - other streams cannot get ahead.
89
+ *
90
+ * @returns Stream index in the sync queue
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * const videoIdx = sq.addStream(1); // Video limits timing
95
+ * const audioIdx = sq.addStream(1); // Audio limits timing
96
+ * const subtitleIdx = sq.addStream(0); // Subtitles don't limit
97
+ * ```
98
+ */
99
+ addStream(limiting = 1) {
100
+ return this.native.addStream(limiting);
101
+ }
102
+ /**
103
+ * Send a packet to the sync queue.
104
+ *
105
+ * The packet is cloned internally, so the original can be reused/freed.
106
+ *
107
+ * To signal EOF for a stream, pass null as the packet.
108
+ * This tells the sync queue that no more packets will be sent for this stream.
109
+ *
110
+ * @param streamIdx - Stream index returned from addStream()
111
+ *
112
+ * @param packet - Packet to send, or null to signal EOF
113
+ *
114
+ * @returns 0 on success, AVERROR_EOF if EOF, negative on error
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * // Send normal packet
119
+ * const ret = sq.send(videoIdx, packet);
120
+ * if (ret === AVERROR_EOF) {
121
+ * console.log('Stream finished');
122
+ * }
123
+ *
124
+ * // Signal EOF for stream
125
+ * sq.send(videoIdx, null);
126
+ * ```
127
+ */
128
+ send(streamIdx, packet) {
129
+ return this.native.send(streamIdx, packet?.getNative() ?? null);
130
+ }
131
+ /**
132
+ * Receive a packet from the sync queue.
133
+ *
134
+ * This will receive the next packet that should be written to maintain
135
+ * proper synchronization between streams. The packet parameter is filled
136
+ * with the received data.
137
+ *
138
+ * @param streamIdx - Stream index to receive from, or -1 for any stream
139
+ *
140
+ * @param packet - Packet to fill with received data (output parameter)
141
+ *
142
+ * @returns Stream index (>= 0) on success, or negative error code:
143
+ * - >= 0: Stream index that the packet belongs to
144
+ * - AVERROR(EAGAIN): No packets ready yet, more frames needed
145
+ * - AVERROR_EOF: All streams finished
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * import { AVERROR } from 'node-av';
150
+ *
151
+ * // Receive from any stream (FFmpeg mux pattern)
152
+ * const packet = new Packet();
153
+ * while (true) {
154
+ * const ret = sq.receive(-1, packet);
155
+ * if (ret === AVERROR('EAGAIN')) {
156
+ * break; // No packets ready
157
+ * }
158
+ * if (ret === AVERROR_EOF) {
159
+ * break; // All streams finished
160
+ * }
161
+ * if (ret >= 0) {
162
+ * // ret is the stream index
163
+ * await muxer.interleavedWriteFrame(packet);
164
+ * }
165
+ * }
166
+ * ```
167
+ */
168
+ receive(streamIdx, packet) {
169
+ return this.native.receive(streamIdx, packet.getNative());
170
+ }
171
+ /**
172
+ * Free the sync queue and all buffered packets.
173
+ * After calling this, the queue cannot be used anymore.
174
+ *
175
+ * @example
176
+ * ```typescript
177
+ * sq.free();
178
+ * ```
179
+ */
180
+ free() {
181
+ this.native.free();
182
+ }
183
+ /**
184
+ * Get the underlying native SyncQueue object.
185
+ *
186
+ * @returns The native SyncQueue binding object
187
+ *
188
+ * @internal
189
+ */
190
+ getNative() {
191
+ return this.native;
192
+ }
193
+ [Symbol.dispose]() {
194
+ this.free();
195
+ }
196
+ }
197
+ //# sourceMappingURL=sync-queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-queue.js","sourceRoot":"","sources":["../../src/lib/sync-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAKxC;;;;GAIG;AACH,MAAM,CAAN,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB;;;OAGG;IACH,uDAAW,CAAA;IAEX;;;OAGG;IACH,qDAAU,CAAA;AACZ,CAAC,EAZW,aAAa,KAAb,aAAa,QAYxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,OAAO,SAAS;IACpB,gBAAgB;IACT,MAAM,CAAkB;IAE/B,YAAoB,MAAuB;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,MAAM,CAAC,OAAsB,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM;QAC9E,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC7D,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,QAAQ,GAAG,CAAC;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CAAC,SAAiB,EAAE,MAAqB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,IAAI,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,OAAO,CAAC,SAAiB,EAAE,MAAc;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED;;;;;;OAMG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;CACF"}
@@ -4,7 +4,7 @@
4
4
  * Types that are used across multiple modules but are not
5
5
  * directly from FFmpeg constants.
6
6
  */
7
- import type { AVLogLevel, AVMediaType } from '../constants/constants.ts';
7
+ import type { AVCodecID, AVLogLevel, AVMediaType } from '../constants/constants.ts';
8
8
  /**
9
9
  * Rational number (fraction) interface
10
10
  * Maps to AVRational in FFmpeg
@@ -16,6 +16,15 @@ export interface IRational {
16
16
  /** Denominator */
17
17
  den: number;
18
18
  }
19
+ /**
20
+ * Video dimension interface
21
+ */
22
+ export interface IDimension {
23
+ /** Width in pixels */
24
+ width: number;
25
+ /** Height in pixels */
26
+ height: number;
27
+ }
19
28
  /**
20
29
  * Audio channel layout description
21
30
  * Maps to AVChannelLayout in FFmpeg
@@ -91,3 +100,20 @@ export interface ImageOptions {
91
100
  crop?: ImageCrop;
92
101
  resize?: ImageResize;
93
102
  }
103
+ /**
104
+ * RTSP stream information interface
105
+ * Maps to RTSPStreamInfo returned by FormatContext.getRTSPStreamInfo()
106
+ */
107
+ export interface RTSPStreamInfo {
108
+ streamIndex: number;
109
+ controlUrl: string;
110
+ transport: 'tcp' | 'udp' | 'udp_multicast' | 'unknown';
111
+ payloadType: number;
112
+ codecId: AVCodecID;
113
+ mediaType: 'video' | 'audio' | 'data' | 'subtitle' | 'unknown';
114
+ mimeType: string;
115
+ sampleRate?: number;
116
+ channels?: number;
117
+ direction: 'sendonly' | 'recvonly' | 'sendrecv' | 'inactive';
118
+ fmtp?: string;
119
+ }