node-av 0.0.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.
Files changed (175) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE.md +22 -0
  3. package/README.md +377 -0
  4. package/binding.gyp +78 -0
  5. package/dist/api/bitstream-filter.d.ts +246 -0
  6. package/dist/api/bitstream-filter.js +369 -0
  7. package/dist/api/bitstream-filter.js.map +1 -0
  8. package/dist/api/decoder.d.ts +257 -0
  9. package/dist/api/decoder.js +424 -0
  10. package/dist/api/decoder.js.map +1 -0
  11. package/dist/api/encoder.d.ts +298 -0
  12. package/dist/api/encoder.js +574 -0
  13. package/dist/api/encoder.js.map +1 -0
  14. package/dist/api/filter.d.ts +457 -0
  15. package/dist/api/filter.js +876 -0
  16. package/dist/api/filter.js.map +1 -0
  17. package/dist/api/hardware.d.ts +318 -0
  18. package/dist/api/hardware.js +558 -0
  19. package/dist/api/hardware.js.map +1 -0
  20. package/dist/api/index.d.ts +12 -0
  21. package/dist/api/index.js +20 -0
  22. package/dist/api/index.js.map +1 -0
  23. package/dist/api/io-stream.d.ts +109 -0
  24. package/dist/api/io-stream.js +124 -0
  25. package/dist/api/io-stream.js.map +1 -0
  26. package/dist/api/media-input.d.ts +295 -0
  27. package/dist/api/media-input.js +456 -0
  28. package/dist/api/media-input.js.map +1 -0
  29. package/dist/api/media-output.d.ts +274 -0
  30. package/dist/api/media-output.js +486 -0
  31. package/dist/api/media-output.js.map +1 -0
  32. package/dist/api/pipeline.d.ts +117 -0
  33. package/dist/api/pipeline.js +836 -0
  34. package/dist/api/pipeline.js.map +1 -0
  35. package/dist/api/types.d.ts +440 -0
  36. package/dist/api/types.js +2 -0
  37. package/dist/api/types.js.map +1 -0
  38. package/dist/api/utilities/audio-sample.d.ts +115 -0
  39. package/dist/api/utilities/audio-sample.js +110 -0
  40. package/dist/api/utilities/audio-sample.js.map +1 -0
  41. package/dist/api/utilities/channel-layout.d.ts +83 -0
  42. package/dist/api/utilities/channel-layout.js +87 -0
  43. package/dist/api/utilities/channel-layout.js.map +1 -0
  44. package/dist/api/utilities/image.d.ts +177 -0
  45. package/dist/api/utilities/image.js +183 -0
  46. package/dist/api/utilities/image.js.map +1 -0
  47. package/dist/api/utilities/index.d.ts +8 -0
  48. package/dist/api/utilities/index.js +17 -0
  49. package/dist/api/utilities/index.js.map +1 -0
  50. package/dist/api/utilities/media-type.d.ts +56 -0
  51. package/dist/api/utilities/media-type.js +60 -0
  52. package/dist/api/utilities/media-type.js.map +1 -0
  53. package/dist/api/utilities/pixel-format.d.ts +94 -0
  54. package/dist/api/utilities/pixel-format.js +102 -0
  55. package/dist/api/utilities/pixel-format.js.map +1 -0
  56. package/dist/api/utilities/sample-format.d.ts +132 -0
  57. package/dist/api/utilities/sample-format.js +144 -0
  58. package/dist/api/utilities/sample-format.js.map +1 -0
  59. package/dist/api/utilities/streaming.d.ts +104 -0
  60. package/dist/api/utilities/streaming.js +137 -0
  61. package/dist/api/utilities/streaming.js.map +1 -0
  62. package/dist/api/utilities/timestamp.d.ts +187 -0
  63. package/dist/api/utilities/timestamp.js +200 -0
  64. package/dist/api/utilities/timestamp.js.map +1 -0
  65. package/dist/api/utils.d.ts +61 -0
  66. package/dist/api/utils.js +330 -0
  67. package/dist/api/utils.js.map +1 -0
  68. package/dist/index.d.ts +2 -0
  69. package/dist/index.js +5 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/lib/audio-fifo.d.ts +339 -0
  72. package/dist/lib/audio-fifo.js +365 -0
  73. package/dist/lib/audio-fifo.js.map +1 -0
  74. package/dist/lib/binding.d.ts +192 -0
  75. package/dist/lib/binding.js +70 -0
  76. package/dist/lib/binding.js.map +1 -0
  77. package/dist/lib/bitstream-filter-context.d.ts +345 -0
  78. package/dist/lib/bitstream-filter-context.js +407 -0
  79. package/dist/lib/bitstream-filter-context.js.map +1 -0
  80. package/dist/lib/bitstream-filter.d.ts +124 -0
  81. package/dist/lib/bitstream-filter.js +138 -0
  82. package/dist/lib/bitstream-filter.js.map +1 -0
  83. package/dist/lib/channel-layouts.d.ts +51 -0
  84. package/dist/lib/channel-layouts.js +55 -0
  85. package/dist/lib/channel-layouts.js.map +1 -0
  86. package/dist/lib/codec-context.d.ts +763 -0
  87. package/dist/lib/codec-context.js +974 -0
  88. package/dist/lib/codec-context.js.map +1 -0
  89. package/dist/lib/codec-parameters.d.ts +362 -0
  90. package/dist/lib/codec-parameters.js +460 -0
  91. package/dist/lib/codec-parameters.js.map +1 -0
  92. package/dist/lib/codec-parser.d.ts +185 -0
  93. package/dist/lib/codec-parser.js +193 -0
  94. package/dist/lib/codec-parser.js.map +1 -0
  95. package/dist/lib/codec.d.ts +432 -0
  96. package/dist/lib/codec.js +492 -0
  97. package/dist/lib/codec.js.map +1 -0
  98. package/dist/lib/constants.d.ts +2037 -0
  99. package/dist/lib/constants.js +1659 -0
  100. package/dist/lib/constants.js.map +1 -0
  101. package/dist/lib/dictionary.d.ts +371 -0
  102. package/dist/lib/dictionary.js +406 -0
  103. package/dist/lib/dictionary.js.map +1 -0
  104. package/dist/lib/error.d.ts +216 -0
  105. package/dist/lib/error.js +254 -0
  106. package/dist/lib/error.js.map +1 -0
  107. package/dist/lib/filter-context.d.ts +445 -0
  108. package/dist/lib/filter-context.js +505 -0
  109. package/dist/lib/filter-context.js.map +1 -0
  110. package/dist/lib/filter-graph.d.ts +556 -0
  111. package/dist/lib/filter-graph.js +608 -0
  112. package/dist/lib/filter-graph.js.map +1 -0
  113. package/dist/lib/filter-inout.d.ts +205 -0
  114. package/dist/lib/filter-inout.js +264 -0
  115. package/dist/lib/filter-inout.js.map +1 -0
  116. package/dist/lib/filter.d.ts +231 -0
  117. package/dist/lib/filter.js +260 -0
  118. package/dist/lib/filter.js.map +1 -0
  119. package/dist/lib/format-context.d.ts +798 -0
  120. package/dist/lib/format-context.js +845 -0
  121. package/dist/lib/format-context.js.map +1 -0
  122. package/dist/lib/frame.d.ts +784 -0
  123. package/dist/lib/frame.js +933 -0
  124. package/dist/lib/frame.js.map +1 -0
  125. package/dist/lib/hardware-device-context.d.ts +407 -0
  126. package/dist/lib/hardware-device-context.js +429 -0
  127. package/dist/lib/hardware-device-context.js.map +1 -0
  128. package/dist/lib/hardware-frames-context.d.ts +374 -0
  129. package/dist/lib/hardware-frames-context.js +430 -0
  130. package/dist/lib/hardware-frames-context.js.map +1 -0
  131. package/dist/lib/index.d.ts +31 -0
  132. package/dist/lib/index.js +54 -0
  133. package/dist/lib/index.js.map +1 -0
  134. package/dist/lib/input-format.d.ts +216 -0
  135. package/dist/lib/input-format.js +246 -0
  136. package/dist/lib/input-format.js.map +1 -0
  137. package/dist/lib/io-context.d.ts +495 -0
  138. package/dist/lib/io-context.js +550 -0
  139. package/dist/lib/io-context.js.map +1 -0
  140. package/dist/lib/log.d.ts +201 -0
  141. package/dist/lib/log.js +219 -0
  142. package/dist/lib/log.js.map +1 -0
  143. package/dist/lib/native-types.d.ts +719 -0
  144. package/dist/lib/native-types.js +2 -0
  145. package/dist/lib/native-types.js.map +1 -0
  146. package/dist/lib/option.d.ts +589 -0
  147. package/dist/lib/option.js +853 -0
  148. package/dist/lib/option.js.map +1 -0
  149. package/dist/lib/output-format.d.ts +179 -0
  150. package/dist/lib/output-format.js +205 -0
  151. package/dist/lib/output-format.js.map +1 -0
  152. package/dist/lib/packet.d.ts +487 -0
  153. package/dist/lib/packet.js +558 -0
  154. package/dist/lib/packet.js.map +1 -0
  155. package/dist/lib/rational.d.ts +210 -0
  156. package/dist/lib/rational.js +233 -0
  157. package/dist/lib/rational.js.map +1 -0
  158. package/dist/lib/software-resample-context.d.ts +572 -0
  159. package/dist/lib/software-resample-context.js +610 -0
  160. package/dist/lib/software-resample-context.js.map +1 -0
  161. package/dist/lib/software-scale-context.d.ts +290 -0
  162. package/dist/lib/software-scale-context.js +308 -0
  163. package/dist/lib/software-scale-context.js.map +1 -0
  164. package/dist/lib/stream.d.ts +322 -0
  165. package/dist/lib/stream.js +408 -0
  166. package/dist/lib/stream.js.map +1 -0
  167. package/dist/lib/types.d.ts +59 -0
  168. package/dist/lib/types.js +8 -0
  169. package/dist/lib/types.js.map +1 -0
  170. package/dist/lib/utilities.d.ts +346 -0
  171. package/dist/lib/utilities.js +424 -0
  172. package/dist/lib/utilities.js.map +1 -0
  173. package/install/check.js +113 -0
  174. package/install/ffmpeg.js +163 -0
  175. package/package.json +107 -0
@@ -0,0 +1,346 @@
1
+ /**
2
+ * FFmpeg utility functions collection.
3
+ *
4
+ * Provides direct mappings to various FFmpeg utility functions from libavutil.
5
+ * These functions handle common operations like timestamp conversion, image buffer
6
+ * allocation, sample format queries, and more.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { avImageAlloc, avTs2TimeStr, avRescaleQ, FFmpegError } from 'node-av';
11
+ * import { AV_PIX_FMT_YUV420P, IRational } from 'node-av';
12
+ *
13
+ * // Allocate image buffer
14
+ * const image = avImageAlloc(1920, 1080, AV_PIX_FMT_YUV420P, 32);
15
+ * console.log(`Allocated ${image.size} bytes`);
16
+ *
17
+ * // Convert timestamp to readable time
18
+ * const timebase: IRational = { num: 1, den: 90000 };
19
+ * const pts = 450000n;
20
+ * console.log(avTs2TimeStr(pts, timebase)); // "5.000000"
21
+ * ```
22
+ */
23
+ import type { AVMediaType, AVPixelFormat, AVSampleFormat } from './constants.js';
24
+ import type { FormatContext } from './format-context.js';
25
+ import type { ChannelLayout, IRational } from './types.js';
26
+ /**
27
+ * Get bytes per sample for a sample format.
28
+ *
29
+ * Returns the number of bytes required to store one sample in the given format.
30
+ *
31
+ * Direct mapping to av_get_bytes_per_sample()
32
+ *
33
+ * @param sampleFmt - Audio sample format
34
+ *
35
+ * @returns Number of bytes per sample, or 0 for invalid format
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * import { avGetBytesPerSample, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT } from 'node-av';
40
+ *
41
+ * console.log(avGetBytesPerSample(AV_SAMPLE_FMT_S16)); // 2
42
+ * console.log(avGetBytesPerSample(AV_SAMPLE_FMT_FLT)); // 4
43
+ * ```
44
+ */
45
+ export declare function avGetBytesPerSample(sampleFmt: AVSampleFormat): number;
46
+ /**
47
+ * Get the name of a sample format.
48
+ *
49
+ * Returns a string describing the sample format.
50
+ *
51
+ * Direct mapping to av_get_sample_fmt_name()
52
+ *
53
+ * @param sampleFmt - Audio sample format
54
+ *
55
+ * @returns Format name string, or null for invalid format
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * import { avGetSampleFmtName, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP } from 'node-av';
60
+ *
61
+ * console.log(avGetSampleFmtName(AV_SAMPLE_FMT_S16)); // "s16"
62
+ * console.log(avGetSampleFmtName(AV_SAMPLE_FMT_FLTP)); // "fltp"
63
+ * ```
64
+ */
65
+ export declare function avGetSampleFmtName(sampleFmt: AVSampleFormat): string | null;
66
+ /**
67
+ * Get packed sample format
68
+ * Direct mapping to av_get_packed_sample_fmt()
69
+ */
70
+ export declare function avGetPackedSampleFmt(sampleFmt: AVSampleFormat): AVSampleFormat;
71
+ /**
72
+ * Get planar sample format
73
+ * Direct mapping to av_get_planar_sample_fmt()
74
+ */
75
+ export declare function avGetPlanarSampleFmt(sampleFmt: AVSampleFormat): AVSampleFormat;
76
+ /**
77
+ * Check if sample format is planar
78
+ * Direct mapping to av_sample_fmt_is_planar()
79
+ */
80
+ export declare function avSampleFmtIsPlanar(sampleFmt: AVSampleFormat): boolean;
81
+ /**
82
+ * Get pixel format name
83
+ * Direct mapping to av_get_pix_fmt_name()
84
+ */
85
+ export declare function avGetPixFmtName(pixFmt: AVPixelFormat): string | null;
86
+ /**
87
+ * Get pixel format from name
88
+ * Direct mapping to av_get_pix_fmt()
89
+ */
90
+ export declare function avGetPixFmtFromName(name: string): AVPixelFormat;
91
+ /**
92
+ * Check if a pixel format is hardware-accelerated
93
+ * Direct mapping using av_pix_fmt_desc_get() and AV_PIX_FMT_FLAG_HWACCEL
94
+ */
95
+ export declare function avIsHardwarePixelFormat(pixFmt: AVPixelFormat): boolean;
96
+ /**
97
+ * Get media type string
98
+ * Direct mapping to av_get_media_type_string()
99
+ */
100
+ export declare function avGetMediaTypeString(mediaType: AVMediaType): string | null;
101
+ /**
102
+ * Allocate an image with size, pixel format and alignment.
103
+ *
104
+ * Allocates a buffer large enough to hold an image with the given parameters.
105
+ * The allocated buffer is properly aligned for optimal performance.
106
+ *
107
+ * Direct mapping to av_image_alloc()
108
+ *
109
+ * @param width - Image width in pixels
110
+ * @param height - Image height in pixels
111
+ * @param pixFmt - Pixel format
112
+ * @param align - Buffer alignment (1 for no alignment, 32 for SIMD)
113
+ *
114
+ * @returns Object containing:
115
+ * - buffer: Allocated image buffer
116
+ * - size: Total size in bytes
117
+ * - linesizes: Array of line sizes for each plane
118
+ *
119
+ * @throws {Error} If allocation fails
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * import { avImageAlloc, AV_PIX_FMT_YUV420P, FFmpegError } from 'node-av';
124
+ *
125
+ * try {
126
+ * const result = avImageAlloc(1920, 1080, AV_PIX_FMT_YUV420P, 32);
127
+ * console.log(`Allocated ${result.size} bytes`);
128
+ * console.log(`Y linesize: ${result.linesizes[0]}`);
129
+ * // Use result.buffer for image data
130
+ * } catch (error) {
131
+ * console.error('Failed to allocate image buffer');
132
+ * }
133
+ * ```
134
+ *
135
+ * @see {@link avImageGetBufferSize} To calculate required size without allocating
136
+ */
137
+ export declare function avImageAlloc(width: number, height: number, pixFmt: AVPixelFormat, align: number): {
138
+ buffer: Buffer;
139
+ size: number;
140
+ linesizes: number[];
141
+ };
142
+ /**
143
+ * Copy image data from src to dst
144
+ * Direct mapping to av_image_copy2()
145
+ *
146
+ * @param dstData - Destination data buffers (one per plane)
147
+ * @param dstLinesizes - Destination line sizes
148
+ * @param srcData - Source data buffers (one per plane)
149
+ * @param srcLinesizes - Source line sizes
150
+ * @param pixFmt - Pixel format
151
+ * @param width - Image width
152
+ * @param height - Image height
153
+ */
154
+ export declare function avImageCopy2(dstData: Buffer[], dstLinesizes: number[], srcData: Buffer[], srcLinesizes: number[], pixFmt: AVPixelFormat, width: number, height: number): void;
155
+ /**
156
+ * Get the required buffer size for an image
157
+ * Direct mapping to av_image_get_buffer_size()
158
+ *
159
+ * @returns The required buffer size in bytes, or negative on error
160
+ */
161
+ export declare function avImageGetBufferSize(pixFmt: AVPixelFormat, width: number, height: number, align: number): number;
162
+ /**
163
+ * Copy image data to a single buffer.
164
+ *
165
+ * Copies image data from separate planes into a single continuous buffer.
166
+ * Useful for serialization or when a single buffer is required.
167
+ *
168
+ * Direct mapping to av_image_copy_to_buffer()
169
+ *
170
+ * @param dst - Destination buffer
171
+ * @param dstSize - Size of destination buffer in bytes
172
+ * @param srcData - Array of source data planes
173
+ * @param srcLinesize - Array of source linesizes
174
+ * @param pixFmt - Pixel format
175
+ * @param width - Image width in pixels
176
+ * @param height - Image height in pixels
177
+ * @param align - Buffer alignment
178
+ *
179
+ * @returns Number of bytes written to dst, or negative AVERROR on error:
180
+ * - >0: Number of bytes written
181
+ * - AVERROR(EINVAL): Invalid parameters
182
+ * - AVERROR(ENOMEM): Destination buffer too small
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * import { avImageCopyToBuffer, avImageGetBufferSize, FFmpegError } from 'node-av';
187
+ * import { AV_PIX_FMT_RGB24 } from 'node-av';
188
+ *
189
+ * const width = 640, height = 480;
190
+ * const pixFmt = AV_PIX_FMT_RGB24;
191
+ *
192
+ * // Calculate required buffer size
193
+ * const dstSize = avImageGetBufferSize(pixFmt, width, height, 1);
194
+ * const dst = Buffer.alloc(dstSize);
195
+ *
196
+ * const ret = avImageCopyToBuffer(
197
+ * dst, dstSize,
198
+ * srcData, srcLinesize,
199
+ * pixFmt, width, height, 1
200
+ * );
201
+ *
202
+ * FFmpegError.throwIfError(ret, 'avImageCopyToBuffer');
203
+ * console.log(`Copied ${ret} bytes to buffer`);
204
+ * ```
205
+ */
206
+ export declare function avImageCopyToBuffer(dst: Buffer, dstSize: number, srcData: Buffer[] | null, srcLinesize: number[] | null, pixFmt: AVPixelFormat, width: number, height: number, align: number): number;
207
+ /**
208
+ * Convert timestamp to string
209
+ * Direct mapping to av_ts2str()
210
+ */
211
+ export declare function avTs2Str(ts: bigint | number | null): string;
212
+ /**
213
+ * Convert timestamp to time string
214
+ * Direct mapping to av_ts2timestr()
215
+ */
216
+ export declare function avTs2TimeStr(ts: bigint | number | null, timeBase: IRational | null): string;
217
+ /**
218
+ * Helper to separate image allocation result into separate arrays
219
+ * This is useful when you need separate data and linesize arrays
220
+ */
221
+ export declare function avImageAllocArrays(width: number, height: number, pixFmt: AVPixelFormat, align: number): {
222
+ data: Buffer[];
223
+ linesizes: number[];
224
+ size: number;
225
+ };
226
+ /**
227
+ * Compare two timestamps
228
+ * Direct mapping to av_compare_ts()
229
+ *
230
+ * @returns -1 if tsA < tsB, 0 if tsA == tsB, 1 if tsA > tsB
231
+ */
232
+ export declare function avCompareTs(tsA: bigint | number | null, tbA: IRational, tsB: bigint | number | null, tbB: IRational): number;
233
+ /**
234
+ * Rescale a timestamp from one timebase to another
235
+ * Direct mapping to av_rescale_q()
236
+ */
237
+ export declare function avRescaleQ(a: bigint | number | null, bq: IRational, cq: IRational): bigint;
238
+ /**
239
+ * Sleep for a specified number of microseconds.
240
+ *
241
+ * Provides a cross-platform microsecond sleep function.
242
+ * Useful for timing operations or frame pacing.
243
+ *
244
+ * Direct mapping to av_usleep()
245
+ *
246
+ * @param usec - Number of microseconds to sleep
247
+ *
248
+ * @example
249
+ * ```typescript
250
+ * import { avUsleep } from 'node-av';
251
+ *
252
+ * // Sleep for 100ms (100,000 microseconds)
253
+ * avUsleep(100000);
254
+ *
255
+ * // Sleep for 1 second
256
+ * avUsleep(1000000);
257
+ *
258
+ * // Frame pacing for 30fps (33.33ms per frame)
259
+ * const frameTime = 1000000 / 30;
260
+ * avUsleep(frameTime);
261
+ * ```
262
+ */
263
+ export declare function avUsleep(usec: number): void;
264
+ /**
265
+ * Rescale a timestamp with rounding
266
+ * Direct mapping to av_rescale_rnd()
267
+ *
268
+ * @param a - Value to rescale
269
+ * @param b - Numerator of scale factor
270
+ * @param c - Denominator of scale factor
271
+ * @param rnd - Rounding mode (AVRounding enum)
272
+ * @returns Rescaled value
273
+ */
274
+ export declare function avRescaleRnd(a: bigint | number, b: bigint | number, c: bigint | number, rnd: number): bigint;
275
+ /**
276
+ * Allocate audio sample buffers
277
+ * Direct mapping to av_samples_alloc()
278
+ *
279
+ * @param nbChannels - Number of channels
280
+ * @param nbSamples - Number of samples per channel
281
+ * @param sampleFmt - Sample format
282
+ * @param align - Buffer alignment (0 for default)
283
+ * @returns Object with allocated data buffers, linesize and total size, or error code
284
+ */
285
+ export declare function avSamplesAlloc(nbChannels: number, nbSamples: number, sampleFmt: AVSampleFormat, align: number): {
286
+ data: Buffer[];
287
+ linesize: number;
288
+ size: number;
289
+ };
290
+ /**
291
+ * Get the required buffer size for audio samples
292
+ * Direct mapping to av_samples_get_buffer_size()
293
+ *
294
+ * @param nbChannels - Number of channels
295
+ * @param nbSamples - Number of samples per channel
296
+ * @param sampleFmt - Sample format
297
+ * @param align - Buffer alignment (0 for default)
298
+ * @returns Object with size and linesize, or error code
299
+ */
300
+ export declare function avSamplesGetBufferSize(nbChannels: number, nbSamples: number, sampleFmt: AVSampleFormat, align: number): {
301
+ size: number;
302
+ linesize: number;
303
+ };
304
+ /**
305
+ * Get a string description of a channel layout.
306
+ * Direct mapping to av_channel_layout_describe()
307
+ *
308
+ * @param channelLayout - The channel layout object with order, nbChannels, and mask
309
+ * @returns String description of the channel layout, or null if invalid
310
+ */
311
+ export declare function avChannelLayoutDescribe(channelLayout: Partial<ChannelLayout>): string | null;
312
+ /**
313
+ * Create an SDP (Session Description Protocol) string for RTP/RTSP streaming.
314
+ *
315
+ * Generates an SDP description from one or more FormatContext objects.
316
+ * Useful for RTP/RTSP streaming scenarios where you need to describe
317
+ * the media streams to clients.
318
+ *
319
+ * Direct mapping to av_sdp_create()
320
+ *
321
+ * @param contexts - Array of FormatContext objects to describe
322
+ * @returns SDP string on success, or null on failure
323
+ *
324
+ * @throws {FFmpegError} On invalid parameters or SDP creation failure
325
+ *
326
+ * @example
327
+ * ```typescript
328
+ * import { avSdpCreate, FormatContext, FFmpegError } from 'node-av';
329
+ *
330
+ * // Create format contexts for RTP output
331
+ * const contexts: FormatContext[] = [];
332
+ *
333
+ * const ctx = new FormatContext();
334
+ * // ... configure context for RTP output ...
335
+ * contexts.push(ctx);
336
+ *
337
+ * // Generate SDP
338
+ * const sdp = avSdpCreate(contexts);
339
+ * if (sdp) {
340
+ * console.log('SDP:', result);
341
+ * }
342
+ *
343
+ * // Use the SDP string for RTSP server or save to .sdp file
344
+ * ```
345
+ */
346
+ export declare function avSdpCreate(contexts: FormatContext[]): string | null;