node-av-light 0.0.0 → 7.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/LICENSE.md +22 -0
  2. package/README.md +711 -0
  3. package/dist/api/audio-frame-buffer.d.ts +636 -0
  4. package/dist/api/audio-frame-buffer.js +1027 -0
  5. package/dist/api/audio-frame-buffer.js.map +1 -0
  6. package/dist/api/bitstream-filter.d.ts +938 -0
  7. package/dist/api/bitstream-filter.js +1427 -0
  8. package/dist/api/bitstream-filter.js.map +1 -0
  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_h264.h264 +0 -0
  14. package/dist/api/data/test_hevc.h265 +0 -0
  15. package/dist/api/data/test_mjpeg.mjpeg +0 -0
  16. package/dist/api/data/test_vp8.ivf +0 -0
  17. package/dist/api/data/test_vp9.ivf +0 -0
  18. package/dist/api/decoder.d.ts +1413 -0
  19. package/dist/api/decoder.js +2367 -0
  20. package/dist/api/decoder.js.map +1 -0
  21. package/dist/api/demuxer.d.ts +1295 -0
  22. package/dist/api/demuxer.js +2344 -0
  23. package/dist/api/demuxer.js.map +1 -0
  24. package/dist/api/device.d.ts +589 -0
  25. package/dist/api/device.js +964 -0
  26. package/dist/api/device.js.map +1 -0
  27. package/dist/api/encoder-pool.d.ts +262 -0
  28. package/dist/api/encoder-pool.js +397 -0
  29. package/dist/api/encoder-pool.js.map +1 -0
  30. package/dist/api/encoder.d.ts +1509 -0
  31. package/dist/api/encoder.js +2619 -0
  32. package/dist/api/encoder.js.map +1 -0
  33. package/dist/api/filter-complex.d.ts +828 -0
  34. package/dist/api/filter-complex.js +1661 -0
  35. package/dist/api/filter-complex.js.map +1 -0
  36. package/dist/api/filter-presets.d.ts +800 -0
  37. package/dist/api/filter-presets.js +1554 -0
  38. package/dist/api/filter-presets.js.map +1 -0
  39. package/dist/api/filter.d.ts +1339 -0
  40. package/dist/api/filter.js +2075 -0
  41. package/dist/api/filter.js.map +1 -0
  42. package/dist/api/fmp4-stream.d.ts +797 -0
  43. package/dist/api/fmp4-stream.js +1428 -0
  44. package/dist/api/fmp4-stream.js.map +1 -0
  45. package/dist/api/hardware.d.ts +677 -0
  46. package/dist/api/hardware.js +1300 -0
  47. package/dist/api/hardware.js.map +1 -0
  48. package/dist/api/index.d.ts +21 -0
  49. package/dist/api/index.js +38 -0
  50. package/dist/api/index.js.map +1 -0
  51. package/dist/api/io-stream.d.ts +308 -0
  52. package/dist/api/io-stream.js +358 -0
  53. package/dist/api/io-stream.js.map +1 -0
  54. package/dist/api/muxer.d.ts +1311 -0
  55. package/dist/api/muxer.js +2672 -0
  56. package/dist/api/muxer.js.map +1 -0
  57. package/dist/api/pipeline.d.ts +801 -0
  58. package/dist/api/pipeline.js +1344 -0
  59. package/dist/api/pipeline.js.map +1 -0
  60. package/dist/api/probe.d.ts +128 -0
  61. package/dist/api/probe.js +227 -0
  62. package/dist/api/probe.js.map +1 -0
  63. package/dist/api/rtp-stream.d.ts +497 -0
  64. package/dist/api/rtp-stream.js +1131 -0
  65. package/dist/api/rtp-stream.js.map +1 -0
  66. package/dist/api/scaler.d.ts +561 -0
  67. package/dist/api/scaler.js +918 -0
  68. package/dist/api/scaler.js.map +1 -0
  69. package/dist/api/types.d.ts +17 -0
  70. package/dist/api/types.js +2 -0
  71. package/dist/api/types.js.map +1 -0
  72. package/dist/api/utilities/async-queue.d.ts +149 -0
  73. package/dist/api/utilities/async-queue.js +254 -0
  74. package/dist/api/utilities/async-queue.js.map +1 -0
  75. package/dist/api/utilities/audio-sample.d.ts +117 -0
  76. package/dist/api/utilities/audio-sample.js +112 -0
  77. package/dist/api/utilities/audio-sample.js.map +1 -0
  78. package/dist/api/utilities/audio-transcode.d.ts +20 -0
  79. package/dist/api/utilities/audio-transcode.js +27 -0
  80. package/dist/api/utilities/audio-transcode.js.map +1 -0
  81. package/dist/api/utilities/channel-layout.d.ts +76 -0
  82. package/dist/api/utilities/channel-layout.js +80 -0
  83. package/dist/api/utilities/channel-layout.js.map +1 -0
  84. package/dist/api/utilities/codec-format.d.ts +87 -0
  85. package/dist/api/utilities/codec-format.js +117 -0
  86. package/dist/api/utilities/codec-format.js.map +1 -0
  87. package/dist/api/utilities/context-options.d.ts +25 -0
  88. package/dist/api/utilities/context-options.js +23 -0
  89. package/dist/api/utilities/context-options.js.map +1 -0
  90. package/dist/api/utilities/electron-shared-texture.d.ts +368 -0
  91. package/dist/api/utilities/electron-shared-texture.js +540 -0
  92. package/dist/api/utilities/electron-shared-texture.js.map +1 -0
  93. package/dist/api/utilities/image.d.ts +207 -0
  94. package/dist/api/utilities/image.js +213 -0
  95. package/dist/api/utilities/image.js.map +1 -0
  96. package/dist/api/utilities/index.d.ts +14 -0
  97. package/dist/api/utilities/index.js +27 -0
  98. package/dist/api/utilities/index.js.map +1 -0
  99. package/dist/api/utilities/live-decoding.d.ts +15 -0
  100. package/dist/api/utilities/live-decoding.js +32 -0
  101. package/dist/api/utilities/live-decoding.js.map +1 -0
  102. package/dist/api/utilities/media-type.d.ts +49 -0
  103. package/dist/api/utilities/media-type.js +53 -0
  104. package/dist/api/utilities/media-type.js.map +1 -0
  105. package/dist/api/utilities/packet-age-watchdog.d.ts +198 -0
  106. package/dist/api/utilities/packet-age-watchdog.js +594 -0
  107. package/dist/api/utilities/packet-age-watchdog.js.map +1 -0
  108. package/dist/api/utilities/pixel-format.d.ts +89 -0
  109. package/dist/api/utilities/pixel-format.js +97 -0
  110. package/dist/api/utilities/pixel-format.js.map +1 -0
  111. package/dist/api/utilities/sample-format.d.ts +129 -0
  112. package/dist/api/utilities/sample-format.js +141 -0
  113. package/dist/api/utilities/sample-format.js.map +1 -0
  114. package/dist/api/utilities/scale-size.d.ts +51 -0
  115. package/dist/api/utilities/scale-size.js +55 -0
  116. package/dist/api/utilities/scale-size.js.map +1 -0
  117. package/dist/api/utilities/scheduler.d.ts +138 -0
  118. package/dist/api/utilities/scheduler.js +98 -0
  119. package/dist/api/utilities/scheduler.js.map +1 -0
  120. package/dist/api/utilities/streaming.d.ts +186 -0
  121. package/dist/api/utilities/streaming.js +309 -0
  122. package/dist/api/utilities/streaming.js.map +1 -0
  123. package/dist/api/utilities/timestamp.d.ts +193 -0
  124. package/dist/api/utilities/timestamp.js +206 -0
  125. package/dist/api/utilities/timestamp.js.map +1 -0
  126. package/dist/api/utilities/video-transcode.d.ts +218 -0
  127. package/dist/api/utilities/video-transcode.js +624 -0
  128. package/dist/api/utilities/video-transcode.js.map +1 -0
  129. package/dist/api/utilities/whisper-model.d.ts +330 -0
  130. package/dist/api/utilities/whisper-model.js +587 -0
  131. package/dist/api/utilities/whisper-model.js.map +1 -0
  132. package/dist/api/utils.d.ts +19 -0
  133. package/dist/api/utils.js +39 -0
  134. package/dist/api/utils.js.map +1 -0
  135. package/dist/api/webrtc-stream.d.ts +294 -0
  136. package/dist/api/webrtc-stream.js +546 -0
  137. package/dist/api/webrtc-stream.js.map +1 -0
  138. package/dist/api/whisper.d.ts +326 -0
  139. package/dist/api/whisper.js +402 -0
  140. package/dist/api/whisper.js.map +1 -0
  141. package/dist/constants/bsf-options.d.ts +364 -0
  142. package/dist/constants/bsf-options.js +7 -0
  143. package/dist/constants/bsf-options.js.map +1 -0
  144. package/dist/constants/channel-layouts.d.ts +53 -0
  145. package/dist/constants/channel-layouts.js +57 -0
  146. package/dist/constants/channel-layouts.js.map +1 -0
  147. package/dist/constants/constants.d.ts +2435 -0
  148. package/dist/constants/constants.js +1989 -0
  149. package/dist/constants/constants.js.map +1 -0
  150. package/dist/constants/decoders.d.ts +651 -0
  151. package/dist/constants/decoders.js +641 -0
  152. package/dist/constants/decoders.js.map +1 -0
  153. package/dist/constants/encoders.d.ts +314 -0
  154. package/dist/constants/encoders.js +309 -0
  155. package/dist/constants/encoders.js.map +1 -0
  156. package/dist/constants/filter-options.d.ts +12099 -0
  157. package/dist/constants/filter-options.js +7 -0
  158. package/dist/constants/filter-options.js.map +1 -0
  159. package/dist/constants/format-options.d.ts +4319 -0
  160. package/dist/constants/format-options.js +7 -0
  161. package/dist/constants/format-options.js.map +1 -0
  162. package/dist/constants/formats.d.ts +18 -0
  163. package/dist/constants/formats.js +7 -0
  164. package/dist/constants/formats.js.map +1 -0
  165. package/dist/constants/hardware.d.ts +26 -0
  166. package/dist/constants/hardware.js +27 -0
  167. package/dist/constants/hardware.js.map +1 -0
  168. package/dist/constants/index.d.ts +10 -0
  169. package/dist/constants/index.js +6 -0
  170. package/dist/constants/index.js.map +1 -0
  171. package/dist/constants/options.d.ts +6217 -0
  172. package/dist/constants/options.js +7 -0
  173. package/dist/constants/options.js.map +1 -0
  174. package/dist/ffmpeg/index.d.ts +101 -0
  175. package/dist/ffmpeg/index.js +161 -0
  176. package/dist/ffmpeg/index.js.map +1 -0
  177. package/dist/ffmpeg/version.d.ts +6 -0
  178. package/dist/ffmpeg/version.js +7 -0
  179. package/dist/ffmpeg/version.js.map +1 -0
  180. package/dist/index.d.ts +4 -0
  181. package/dist/index.js +9 -0
  182. package/dist/index.js.map +1 -0
  183. package/dist/lib/audio-fifo.d.ts +399 -0
  184. package/dist/lib/audio-fifo.js +431 -0
  185. package/dist/lib/audio-fifo.js.map +1 -0
  186. package/dist/lib/binding.d.ts +242 -0
  187. package/dist/lib/binding.js +102 -0
  188. package/dist/lib/binding.js.map +1 -0
  189. package/dist/lib/bitstream-filter-context.d.ts +381 -0
  190. package/dist/lib/bitstream-filter-context.js +443 -0
  191. package/dist/lib/bitstream-filter-context.js.map +1 -0
  192. package/dist/lib/bitstream-filter.d.ts +140 -0
  193. package/dist/lib/bitstream-filter.js +154 -0
  194. package/dist/lib/bitstream-filter.js.map +1 -0
  195. package/dist/lib/codec-context.d.ts +1069 -0
  196. package/dist/lib/codec-context.js +1336 -0
  197. package/dist/lib/codec-context.js.map +1 -0
  198. package/dist/lib/codec-parameters.d.ts +664 -0
  199. package/dist/lib/codec-parameters.js +813 -0
  200. package/dist/lib/codec-parameters.js.map +1 -0
  201. package/dist/lib/codec-parser.d.ts +201 -0
  202. package/dist/lib/codec-parser.js +213 -0
  203. package/dist/lib/codec-parser.js.map +1 -0
  204. package/dist/lib/codec.d.ts +617 -0
  205. package/dist/lib/codec.js +746 -0
  206. package/dist/lib/codec.js.map +1 -0
  207. package/dist/lib/device.d.ts +294 -0
  208. package/dist/lib/device.js +326 -0
  209. package/dist/lib/device.js.map +1 -0
  210. package/dist/lib/dictionary.d.ts +333 -0
  211. package/dist/lib/dictionary.js +372 -0
  212. package/dist/lib/dictionary.js.map +1 -0
  213. package/dist/lib/error.d.ts +311 -0
  214. package/dist/lib/error.js +395 -0
  215. package/dist/lib/error.js.map +1 -0
  216. package/dist/lib/fifo.d.ts +416 -0
  217. package/dist/lib/fifo.js +453 -0
  218. package/dist/lib/fifo.js.map +1 -0
  219. package/dist/lib/filter-context.d.ts +714 -0
  220. package/dist/lib/filter-context.js +783 -0
  221. package/dist/lib/filter-context.js.map +1 -0
  222. package/dist/lib/filter-graph-segment.d.ts +161 -0
  223. package/dist/lib/filter-graph-segment.js +172 -0
  224. package/dist/lib/filter-graph-segment.js.map +1 -0
  225. package/dist/lib/filter-graph.d.ts +641 -0
  226. package/dist/lib/filter-graph.js +704 -0
  227. package/dist/lib/filter-graph.js.map +1 -0
  228. package/dist/lib/filter-inout.d.ts +202 -0
  229. package/dist/lib/filter-inout.js +261 -0
  230. package/dist/lib/filter-inout.js.map +1 -0
  231. package/dist/lib/filter.d.ts +243 -0
  232. package/dist/lib/filter.js +272 -0
  233. package/dist/lib/filter.js.map +1 -0
  234. package/dist/lib/format-context.d.ts +1335 -0
  235. package/dist/lib/format-context.js +1455 -0
  236. package/dist/lib/format-context.js.map +1 -0
  237. package/dist/lib/frame-utils.d.ts +116 -0
  238. package/dist/lib/frame-utils.js +98 -0
  239. package/dist/lib/frame-utils.js.map +1 -0
  240. package/dist/lib/frame.d.ts +1315 -0
  241. package/dist/lib/frame.js +1535 -0
  242. package/dist/lib/frame.js.map +1 -0
  243. package/dist/lib/hardware-device-context.d.ts +362 -0
  244. package/dist/lib/hardware-device-context.js +383 -0
  245. package/dist/lib/hardware-device-context.js.map +1 -0
  246. package/dist/lib/hardware-frames-context.d.ts +418 -0
  247. package/dist/lib/hardware-frames-context.js +471 -0
  248. package/dist/lib/hardware-frames-context.js.map +1 -0
  249. package/dist/lib/index.d.ts +35 -0
  250. package/dist/lib/index.js +60 -0
  251. package/dist/lib/index.js.map +1 -0
  252. package/dist/lib/input-format.d.ts +249 -0
  253. package/dist/lib/input-format.js +306 -0
  254. package/dist/lib/input-format.js.map +1 -0
  255. package/dist/lib/io-context.d.ts +698 -0
  256. package/dist/lib/io-context.js +771 -0
  257. package/dist/lib/io-context.js.map +1 -0
  258. package/dist/lib/log.d.ts +174 -0
  259. package/dist/lib/log.js +184 -0
  260. package/dist/lib/log.js.map +1 -0
  261. package/dist/lib/native-types.d.ts +1024 -0
  262. package/dist/lib/native-types.js +2 -0
  263. package/dist/lib/native-types.js.map +1 -0
  264. package/dist/lib/option.d.ts +953 -0
  265. package/dist/lib/option.js +1607 -0
  266. package/dist/lib/option.js.map +1 -0
  267. package/dist/lib/output-format.d.ts +222 -0
  268. package/dist/lib/output-format.js +259 -0
  269. package/dist/lib/output-format.js.map +1 -0
  270. package/dist/lib/packet.d.ts +521 -0
  271. package/dist/lib/packet.js +613 -0
  272. package/dist/lib/packet.js.map +1 -0
  273. package/dist/lib/rational.d.ts +251 -0
  274. package/dist/lib/rational.js +278 -0
  275. package/dist/lib/rational.js.map +1 -0
  276. package/dist/lib/software-resample-context.d.ts +552 -0
  277. package/dist/lib/software-resample-context.js +592 -0
  278. package/dist/lib/software-resample-context.js.map +1 -0
  279. package/dist/lib/software-scale-context.d.ts +344 -0
  280. package/dist/lib/software-scale-context.js +366 -0
  281. package/dist/lib/software-scale-context.js.map +1 -0
  282. package/dist/lib/stream.d.ts +383 -0
  283. package/dist/lib/stream.js +524 -0
  284. package/dist/lib/stream.js.map +1 -0
  285. package/dist/lib/sync-queue.d.ts +179 -0
  286. package/dist/lib/sync-queue.js +197 -0
  287. package/dist/lib/sync-queue.js.map +1 -0
  288. package/dist/lib/types.d.ts +34 -0
  289. package/dist/lib/types.js +2 -0
  290. package/dist/lib/types.js.map +1 -0
  291. package/dist/lib/utilities.d.ts +1198 -0
  292. package/dist/lib/utilities.js +1302 -0
  293. package/dist/lib/utilities.js.map +1 -0
  294. package/dist/utils/electron.d.ts +49 -0
  295. package/dist/utils/electron.js +63 -0
  296. package/dist/utils/electron.js.map +1 -0
  297. package/dist/utils/index.d.ts +6 -0
  298. package/dist/utils/index.js +7 -0
  299. package/dist/utils/index.js.map +1 -0
  300. package/dist/utils/libc.d.ts +11 -0
  301. package/dist/utils/libc.js +35 -0
  302. package/dist/utils/libc.js.map +1 -0
  303. package/dist/utils/variant.d.ts +26 -0
  304. package/dist/utils/variant.js +31 -0
  305. package/dist/utils/variant.js.map +1 -0
  306. package/dist/webrtc/index.d.ts +4 -0
  307. package/dist/webrtc/index.js +7 -0
  308. package/dist/webrtc/index.js.map +1 -0
  309. package/install/check.js +124 -0
  310. package/install/ffmpeg.js +66 -0
  311. package/package.json +165 -3
@@ -0,0 +1,1198 @@
1
+ import type { AVCodecID, AVHWDeviceType, AVMediaType, AVPixelFormat, AVSampleFormat } from '../constants/constants.js';
2
+ import type { FFHWDeviceType } from '../constants/hardware.js';
3
+ import type { FormatContext } from './format-context.js';
4
+ import type { NativeCodecParameters, NativePacket, NativeStream, NativeWrapper } from './native-types.js';
5
+ import type { ChannelLayout, DtsPredictState, IRational } from './types.js';
6
+ /**
7
+ * Get FFmpeg library information.
8
+ *
9
+ * Returns detailed information about the FFmpeg libraries including
10
+ * version numbers and build configuration.
11
+ *
12
+ * @returns FFmpeg information object with version, configuration, and library versions
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { getFFmpegInfo } from 'node-av/lib';
17
+ *
18
+ * const info = getFFmpegInfo();
19
+ * console.log('FFmpeg version:', info.version);
20
+ * console.log('Configuration:', info.configuration);
21
+ * console.log('libavcodec:', info.libraries.avcodec);
22
+ * ```
23
+ */
24
+ export declare function getFFmpegInfo(): {
25
+ version: string;
26
+ configuration: string;
27
+ libraries: {
28
+ avutil: string;
29
+ avcodec: string;
30
+ avformat: string;
31
+ avfilter: string;
32
+ avdevice: string;
33
+ swscale: string;
34
+ swresample: string;
35
+ };
36
+ };
37
+ /**
38
+ * Get bytes per audio sample.
39
+ *
40
+ * Returns the number of bytes required to store a single audio sample
41
+ * in the specified format.
42
+ *
43
+ * Direct mapping to av_get_bytes_per_sample().
44
+ *
45
+ * @param sampleFmt - Audio sample format
46
+ *
47
+ * @returns Number of bytes per sample, or 0 if unknown format
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * import { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP } from 'node-av/constants';
52
+ *
53
+ * const bytesS16 = avGetBytesPerSample(AV_SAMPLE_FMT_S16); // Returns 2
54
+ * const bytesFloat = avGetBytesPerSample(AV_SAMPLE_FMT_FLTP); // Returns 4
55
+ * ```
56
+ *
57
+ * @see [av_get_bytes_per_sample](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga0c3c218e1dd570ad4917c69a35a6c77d) - FFmpeg Doxygen
58
+ */
59
+ export declare function avGetBytesPerSample(sampleFmt: AVSampleFormat): number;
60
+ /**
61
+ * Get sample format name.
62
+ *
63
+ * Returns the name of the audio sample format as a string.
64
+ *
65
+ * Direct mapping to av_get_sample_fmt_name().
66
+ *
67
+ * @param sampleFmt - Audio sample format
68
+ *
69
+ * @returns Format name, or null if unknown
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * import { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLTP } from 'node-av/constants';
74
+ *
75
+ * const name1 = avGetSampleFmtName(AV_SAMPLE_FMT_S16); // Returns "s16"
76
+ * const name2 = avGetSampleFmtName(AV_SAMPLE_FMT_FLTP); // Returns "fltp"
77
+ * ```
78
+ *
79
+ * @see [av_get_sample_fmt_name](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga31b9d149b2de9821a65f4f5612970838) - FFmpeg Doxygen
80
+ */
81
+ export declare function avGetSampleFmtName(sampleFmt: AVSampleFormat): string | null;
82
+ /**
83
+ * Get sample format from name string.
84
+ *
85
+ * Converts a sample format name (like "s16", "fltp", etc.) to the
86
+ * corresponding AVSampleFormat enum value.
87
+ *
88
+ * Direct mapping to av_get_sample_fmt().
89
+ *
90
+ * @param name - Sample format name (e.g., "s16", "fltp", "s32p")
91
+ *
92
+ * @returns Sample format enum, or AV_SAMPLE_FMT_NONE if unknown
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * const fmt1 = avGetSampleFmtFromName("s16"); // Returns AV_SAMPLE_FMT_S16
97
+ * const fmt2 = avGetSampleFmtFromName("fltp"); // Returns AV_SAMPLE_FMT_FLTP
98
+ * const none = avGetSampleFmtFromName("invalid"); // Returns AV_SAMPLE_FMT_NONE
99
+ * ```
100
+ *
101
+ * @see [av_get_sample_fmt](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga5b95d0bf179912e8ff0d23ddfa99c9bc) - FFmpeg Doxygen
102
+ * @see {@link avGetSampleFmtName} For converting format to name string
103
+ */
104
+ export declare function avGetSampleFmtFromName(name: string): AVSampleFormat;
105
+ /**
106
+ * Get packed sample format.
107
+ *
108
+ * Returns the packed (interleaved) version of a planar sample format,
109
+ * or the format itself if already packed.
110
+ *
111
+ * Direct mapping to av_get_packed_sample_fmt().
112
+ *
113
+ * @param sampleFmt - Audio sample format
114
+ *
115
+ * @returns Packed version of the format
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * import { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT } from 'node-av/constants';
120
+ *
121
+ * const packed = avGetPackedSampleFmt(AV_SAMPLE_FMT_FLTP); // Returns AV_SAMPLE_FMT_FLT
122
+ * const same = avGetPackedSampleFmt(AV_SAMPLE_FMT_FLT); // Returns AV_SAMPLE_FMT_FLT
123
+ * ```
124
+ *
125
+ * @see [av_get_packed_sample_fmt](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga7817ec0eff4dc6fc0962f31e6d138bca) - FFmpeg Doxygen
126
+ * @see {@link avGetPlanarSampleFmt} For getting planar version
127
+ */
128
+ export declare function avGetPackedSampleFmt(sampleFmt: AVSampleFormat): AVSampleFormat;
129
+ /**
130
+ * Get planar sample format.
131
+ *
132
+ * Returns the planar (non-interleaved) version of a packed sample format,
133
+ * or the format itself if already planar.
134
+ *
135
+ * Direct mapping to av_get_planar_sample_fmt().
136
+ *
137
+ * @param sampleFmt - Audio sample format
138
+ *
139
+ * @returns Planar version of the format
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * import { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP } from 'node-av/constants';
144
+ *
145
+ * const planar = avGetPlanarSampleFmt(AV_SAMPLE_FMT_FLT); // Returns AV_SAMPLE_FMT_FLTP
146
+ * const same = avGetPlanarSampleFmt(AV_SAMPLE_FMT_FLTP); // Returns AV_SAMPLE_FMT_FLTP
147
+ * ```
148
+ *
149
+ * @see [av_get_planar_sample_fmt](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga82caf838259d95cc6c4fd87633bb0e19) - FFmpeg Doxygen
150
+ * @see {@link avGetPackedSampleFmt} For getting packed version
151
+ */
152
+ export declare function avGetPlanarSampleFmt(sampleFmt: AVSampleFormat): AVSampleFormat;
153
+ /**
154
+ * Check if sample format is planar.
155
+ *
156
+ * Returns whether the audio sample format stores channels in separate planes
157
+ * (planar) rather than interleaved.
158
+ *
159
+ * Direct mapping to av_sample_fmt_is_planar().
160
+ *
161
+ * @param sampleFmt - Audio sample format to check
162
+ *
163
+ * @returns True if planar, false if packed/interleaved
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * import { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P } from 'node-av/constants';
168
+ *
169
+ * const isPacked = avSampleFmtIsPlanar(AV_SAMPLE_FMT_S16); // Returns false
170
+ * const isPlanar = avSampleFmtIsPlanar(AV_SAMPLE_FMT_S16P); // Returns true
171
+ * ```
172
+ *
173
+ * @see [av_sample_fmt_is_planar](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#ga06ba8a64dc4382c422789a5d0b6bf592) - FFmpeg Doxygen
174
+ */
175
+ export declare function avSampleFmtIsPlanar(sampleFmt: AVSampleFormat): boolean;
176
+ /**
177
+ * Get codec name from codec ID.
178
+ *
179
+ * Returns the canonical codec name corresponding to the codec ID.
180
+ *
181
+ * Direct mapping to avcodec_get_name().
182
+ *
183
+ * @param codecId - Codec ID from AVCodecID enum
184
+ *
185
+ * @returns Codec name string or null
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * import { AV_CODEC_ID_H264, AV_CODEC_ID_HEVC } from 'node-av/constants';
190
+ * import { avGetCodecName } from 'node-av/lib';
191
+ *
192
+ * const h264Name = avGetCodecName(AV_CODEC_ID_H264); // Returns "h264"
193
+ * const hevcName = avGetCodecName(AV_CODEC_ID_HEVC); // Returns "hevc"
194
+ * const unknownName = avGetCodecName(99999); // Returns null
195
+ * ```
196
+ *
197
+ * @see [avcodec_get_name](https://ffmpeg.org/doxygen/7.1/group__lavc__core.html#ga2016a52e94f867ebe5113bdf448e182d) - FFmpeg Doxygen
198
+ */
199
+ export declare function avGetCodecName(codecId: AVCodecID): string | null;
200
+ /**
201
+ * Get RFC 6381 codec string from codec parameters.
202
+ *
203
+ * Generates codec strings for MPEG-DASH and HLS manifests following RFC 6381.
204
+ * Uses FFmpeg's centralized ff_make_codec_str() implementation (libavformat/codecstring.c).
205
+ *
206
+ * Supported codecs:
207
+ * - **WebM codecs**: VP8, VP9 (with detailed profile/level), Vorbis, Opus, FLAC
208
+ * - **H.264** (avc1): `avc1.PPCCLL` (profile, constraints, level)
209
+ * - **HEVC** (hvc1): `hvc1.P.PC.TL.C` (profile, profile_compatibility, tier+level, constraints)
210
+ * - **AV1** (av01): `av01.P.LLT.BB...` (profile, level, tier, bitdepth, color info)
211
+ * - **AAC**: `mp4a.40.AOT` (audio object type)
212
+ * - **MP2**: `mp4a.40.33`
213
+ * - **MP3**: `mp4a.40.34`
214
+ * - **AC-3**: `ac-3`
215
+ * - **E-AC-3**: `ec-3`
216
+ * - **MPEG-4 Visual**: `mp4v.20` (profile/level not implemented)
217
+ *
218
+ * @param codecpar - Codec parameters
219
+ *
220
+ * @param frameRate - Optional frame rate for VP9 level calculation (only used for VP9)
221
+ *
222
+ * @returns RFC 6381 codec string, or null if codec not supported
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * import { avGetCodecString } from 'node-av/lib';
227
+ *
228
+ * // Get codec string for DASH/HLS manifest
229
+ * const stream = output.video();
230
+ * const codecString = avGetCodecString(stream.codecpar);
231
+ * console.log(codecString); // "hvc1.1.6.L93.B0" for HEVC, "avc1.42c01e" for H.264
232
+ *
233
+ * // VP9 with frame rate for accurate level
234
+ * const codecStringVP9 = avGetCodecString(stream.codecpar, { num: 30, den: 1 });
235
+ * console.log(codecStringVP9); // "vp09.00.30.08" - detailed VP9 string
236
+ *
237
+ * // Use for DASH/HLS manifest
238
+ * const mimeType = `video/mp4; codecs="${codecString}"`;
239
+ * ```
240
+ *
241
+ * @see [codecstring.c](https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/codecstring.c) - FFmpeg implementation
242
+ */
243
+ export declare function avGetCodecString(codecpar: NativeWrapper<NativeCodecParameters>, frameRate?: IRational): string | null;
244
+ /**
245
+ * Get DASH MIME type for codec parameters.
246
+ *
247
+ * Determines the MIME type for MPEG-DASH segments based on codec.
248
+ * Uses FFmpeg's segment type selection logic:
249
+ * - WebM codecs (VP8, VP9, Vorbis, Opus) → `video/webm` or `audio/webm`
250
+ * - All other codecs → `video/mp4` or `audio/mp4`
251
+ *
252
+ * @param codecpar - Codec parameters
253
+ *
254
+ * @returns MIME type string, or null if invalid media type
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * import { avGetMimeTypeDash } from 'node-av/lib';
259
+ *
260
+ * const stream = input.video();
261
+ * const mimeType = avGetMimeTypeDash(stream.codecpar);
262
+ * console.log(mimeType); // "video/mp4" for H.264
263
+ *
264
+ * // VP9 codec
265
+ * const mimeTypeVP9 = avGetMimeTypeDash(vp9Stream.codecpar);
266
+ * console.log(mimeTypeVP9); // "video/webm"
267
+ * ```
268
+ *
269
+ * @see https://ffmpeg.org/doxygen/trunk/dashenc_8c_source.html#l00285 - FFmpeg dashenc.c segment type selection
270
+ */
271
+ export declare function avGetMimeTypeDash(codecpar: NativeWrapper<NativeCodecParameters>): string | null;
272
+ /**
273
+ * Guess the frame rate of a stream.
274
+ *
275
+ * Picks between the stream's real base frame rate, its average frame rate and
276
+ * the codec frame rate the way FFmpeg CLI does to configure filters and
277
+ * encoders. A stream whose format context was freed returns 0/1.
278
+ *
279
+ * Direct mapping to av_guess_frame_rate().
280
+ *
281
+ * @param stream - Stream to guess the frame rate of
282
+ *
283
+ * @returns Guessed frame rate, or 0/1 if unknown
284
+ *
285
+ * @example
286
+ * ```typescript
287
+ * import { avGuessFrameRate } from 'node-av/lib';
288
+ *
289
+ * const fr = avGuessFrameRate(input.video());
290
+ * if (fr.num > 0) {
291
+ * console.log(`${fr.num / fr.den} fps`);
292
+ * }
293
+ * ```
294
+ *
295
+ * @see [av_guess_frame_rate](https://ffmpeg.org/doxygen/trunk/group__lavf__misc.html) - FFmpeg Doxygen
296
+ */
297
+ export declare function avGuessFrameRate(stream: NativeWrapper<NativeStream>): IRational;
298
+ /**
299
+ * Get pixel format name.
300
+ *
301
+ * Returns the name of the pixel format as a string.
302
+ *
303
+ * Direct mapping to av_get_pix_fmt_name().
304
+ *
305
+ * @param pixFmt - Pixel format
306
+ *
307
+ * @returns Format name, or null if unknown
308
+ *
309
+ * @example
310
+ * ```typescript
311
+ * import { AV_PIX_FMT_YUV420P, AV_PIX_FMT_RGB24 } from 'node-av/constants';
312
+ *
313
+ * const name1 = avGetPixFmtName(AV_PIX_FMT_YUV420P); // Returns "yuv420p"
314
+ * const name2 = avGetPixFmtName(AV_PIX_FMT_RGB24); // Returns "rgb24"
315
+ * ```
316
+ *
317
+ * @see [av_get_pix_fmt_name](https://ffmpeg.org/doxygen/7.1/pixdesc_8c.html#ab92e2a8a9b58c982560c49df9f01e47e) - FFmpeg Doxygen
318
+ */
319
+ export declare function avGetPixFmtName(pixFmt: AVPixelFormat): string | null;
320
+ /**
321
+ * Get pixel format from name.
322
+ *
323
+ * Returns the pixel format enum value from its string name.
324
+ *
325
+ * Direct mapping to av_get_pix_fmt().
326
+ *
327
+ * @param name - Pixel format name
328
+ *
329
+ * @returns Pixel format enum, or AV_PIX_FMT_NONE if unknown
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * const fmt1 = avGetPixFmtFromName("yuv420p"); // Returns AV_PIX_FMT_YUV420P
334
+ * const fmt2 = avGetPixFmtFromName("rgb24"); // Returns AV_PIX_FMT_RGB24
335
+ * const none = avGetPixFmtFromName("invalid"); // Returns AV_PIX_FMT_NONE
336
+ * ```
337
+ *
338
+ * @see [av_get_pix_fmt](https://ffmpeg.org/doxygen/7.1/pixdesc_8h.html#a925ef18d69c24c3be8c53d5a7dc0660e) - FFmpeg Doxygen
339
+ */
340
+ export declare function avGetPixFmtFromName(name: string): AVPixelFormat;
341
+ /**
342
+ * Check if pixel format is hardware accelerated.
343
+ *
344
+ * Returns whether the pixel format represents hardware-accelerated frames
345
+ * (GPU memory) rather than software frames (system memory).
346
+ *
347
+ * Direct mapping to av_pix_fmt_desc_get() with hwaccel check.
348
+ *
349
+ * @param pixFmt - Pixel format to check
350
+ *
351
+ * @returns True if hardware format, false if software format
352
+ *
353
+ * @example
354
+ * ```typescript
355
+ * import { AV_PIX_FMT_YUV420P, AV_PIX_FMT_CUDA } from 'node-av/constants';
356
+ *
357
+ * const isSoftware = avIsHardwarePixelFormat(AV_PIX_FMT_YUV420P); // Returns false
358
+ * const isHardware = avIsHardwarePixelFormat(AV_PIX_FMT_CUDA); // Returns true
359
+ * ```
360
+ *
361
+ * @see [av_pix_fmt_desc_get](https://ffmpeg.org/doxygen/7.1/pixdesc_8c.html#afe0c3e8aef5173de28bbdaea4298f5f0) - FFmpeg Doxygen
362
+ */
363
+ export declare function avIsHardwarePixelFormat(pixFmt: AVPixelFormat): boolean;
364
+ /**
365
+ * Get hardware device type name.
366
+ *
367
+ * Returns the string name for a hardware device type enum value.
368
+ *
369
+ * Direct mapping to av_hwdevice_get_type_name().
370
+ *
371
+ * @param type - Hardware device type enum
372
+ *
373
+ * @returns Device type name (e.g. "videotoolbox", "cuda"), or null if unknown
374
+ *
375
+ * @example
376
+ * ```typescript
377
+ * import { AV_HWDEVICE_TYPE_VIDEOTOOLBOX, AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
378
+ *
379
+ * const name1 = avGetHardwareDeviceTypeName(AV_HWDEVICE_TYPE_VIDEOTOOLBOX); // Returns "videotoolbox"
380
+ * const name2 = avGetHardwareDeviceTypeName(AV_HWDEVICE_TYPE_CUDA); // Returns "cuda"
381
+ * ```
382
+ *
383
+ * @see [av_hwdevice_get_type_name](https://ffmpeg.org/doxygen/7.1/hwcontext_8h.html#afb2b99a15f3fdde25a2fd19353ac5a67) - FFmpeg Doxygen
384
+ */
385
+ export declare function avGetHardwareDeviceTypeName(type: AVHWDeviceType): FFHWDeviceType;
386
+ /**
387
+ * Get hardware device type from name.
388
+ *
389
+ * Looks up the hardware device type enum from its string name.
390
+ * Returns AV_HWDEVICE_TYPE_NONE if the name is not recognized.
391
+ *
392
+ * Direct mapping to av_hwdevice_find_type_by_name().
393
+ *
394
+ * @param name - Hardware device type name (e.g. "videotoolbox", "cuda")
395
+ *
396
+ * @returns Hardware device type enum, or AV_HWDEVICE_TYPE_NONE if not found
397
+ *
398
+ * @example
399
+ * ```typescript
400
+ * import { avGetHardwareDeviceTypeFromName } from 'node-av/lib';
401
+ *
402
+ * const type1 = avGetHardwareDeviceTypeFromName("videotoolbox"); // Returns AV_HWDEVICE_TYPE_VIDEOTOOLBOX
403
+ * const type2 = avGetHardwareDeviceTypeFromName("cuda"); // Returns AV_HWDEVICE_TYPE_CUDA
404
+ * const none = avGetHardwareDeviceTypeFromName("invalid"); // Returns AV_HWDEVICE_TYPE_NONE
405
+ * ```
406
+ *
407
+ * @see [av_hwdevice_find_type_by_name](https://ffmpeg.org/doxygen/7.1/hwcontext_8h.html#a541943ddced791765349645a30adfa4d) - FFmpeg Doxygen
408
+ */
409
+ export declare function avGetHardwareDeviceTypeFromName(name: FFHWDeviceType): AVHWDeviceType;
410
+ /**
411
+ * Get media type string.
412
+ *
413
+ * Returns a human-readable string for the media type.
414
+ *
415
+ * Direct mapping to av_get_media_type_string().
416
+ *
417
+ * @param mediaType - Media type enum
418
+ *
419
+ * @returns Media type name, or null if unknown
420
+ *
421
+ * @example
422
+ * ```typescript
423
+ * import { AVMEDIA_TYPE_VIDEO, AVMEDIA_TYPE_AUDIO } from 'node-av/constants';
424
+ *
425
+ * const video = avGetMediaTypeString(AVMEDIA_TYPE_VIDEO); // Returns "video"
426
+ * const audio = avGetMediaTypeString(AVMEDIA_TYPE_AUDIO); // Returns "audio"
427
+ * ```
428
+ *
429
+ * @see [av_get_media_type_string](https://ffmpeg.org/doxygen/7.1/group__lavu__misc.html#gaf21645cfa855b2caf9699d7dc7b2d08e) - FFmpeg Doxygen
430
+ */
431
+ export declare function avGetMediaTypeString(mediaType: AVMediaType): string | null;
432
+ /**
433
+ * Allocate image buffer.
434
+ *
435
+ * Allocates a buffer large enough to hold an image with the specified dimensions
436
+ * and pixel format. Returns buffer and layout information.
437
+ *
438
+ * Direct mapping to av_image_alloc().
439
+ *
440
+ * @param width - Image width in pixels
441
+ *
442
+ * @param height - Image height in pixels
443
+ *
444
+ * @param pixFmt - Pixel format
445
+ *
446
+ * @param align - Buffer alignment (typically 1 or 32)
447
+ *
448
+ * @returns Object with buffer, size, and line sizes
449
+ *
450
+ * @throws {FFmpegError} If allocation fails
451
+ *
452
+ * @example
453
+ * ```typescript
454
+ * import { AV_PIX_FMT_YUV420P } from 'node-av/constants';
455
+ *
456
+ * const { buffer, size, linesizes } = avImageAlloc(
457
+ * 1920, 1080, AV_PIX_FMT_YUV420P, 32
458
+ * );
459
+ * console.log(`Allocated ${size} bytes`);
460
+ * console.log(`Line sizes: ${linesizes}`);
461
+ * ```
462
+ *
463
+ * @see [av_image_alloc](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga841e0a89a642e24141af1918a2c10448) - FFmpeg Doxygen
464
+ * @see {@link avImageGetBufferSize} To calculate size without allocating
465
+ */
466
+ export declare function avImageAlloc(width: number, height: number, pixFmt: AVPixelFormat, align: number): {
467
+ buffer: Buffer;
468
+ size: number;
469
+ linesizes: number[];
470
+ };
471
+ /**
472
+ * Copy image data.
473
+ *
474
+ * Copies image data from source to destination buffers.
475
+ *
476
+ * Direct mapping to av_image_copy2().
477
+ *
478
+ * @param dstData - Destination data planes
479
+ *
480
+ * @param dstLinesizes - Destination bytes per line
481
+ *
482
+ * @param srcData - Source data planes
483
+ *
484
+ * @param srcLinesizes - Source bytes per line
485
+ *
486
+ * @param pixFmt - Pixel format
487
+ *
488
+ * @param width - Image width
489
+ *
490
+ * @param height - Image height
491
+ *
492
+ * @example
493
+ * ```typescript
494
+ * avImageCopy2(
495
+ * dstPlanes, dstStrides,
496
+ * srcPlanes, srcStrides,
497
+ * AV_PIX_FMT_YUV420P, 1920, 1080
498
+ * );
499
+ * ```
500
+ *
501
+ * @see [av_image_copy2](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga911cb7d723163b88bdbbdacbeeaacf2d) - FFmpeg Doxygen
502
+ */
503
+ export declare function avImageCopy2(dstData: Buffer[], dstLinesizes: number[], srcData: Buffer[], srcLinesizes: number[], pixFmt: AVPixelFormat, width: number, height: number): void;
504
+ /**
505
+ * Get image buffer size.
506
+ *
507
+ * Calculates the required buffer size for an image without allocating.
508
+ *
509
+ * Direct mapping to av_image_get_buffer_size().
510
+ *
511
+ * @param pixFmt - Pixel format
512
+ *
513
+ * @param width - Image width
514
+ *
515
+ * @param height - Image height
516
+ *
517
+ * @param align - Buffer alignment
518
+ *
519
+ * @returns Required buffer size in bytes
520
+ *
521
+ * @example
522
+ * ```typescript
523
+ * import { AV_PIX_FMT_RGB24 } from 'node-av/constants';
524
+ *
525
+ * const size = avImageGetBufferSize(AV_PIX_FMT_RGB24, 1920, 1080, 1);
526
+ * console.log(`Need ${size} bytes for Full HD RGB24`);
527
+ * ```
528
+ *
529
+ * @see [av_image_get_buffer_size](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga24a67963c3ae0054a2a4bab35930e694) - FFmpeg Doxygen
530
+ * @see {@link avImageAlloc} To allocate the buffer
531
+ */
532
+ export declare function avImageGetBufferSize(pixFmt: AVPixelFormat, width: number, height: number, align: number): number;
533
+ /**
534
+ * Copy image to buffer.
535
+ *
536
+ * Copies image data from separate planes to a single contiguous buffer.
537
+ *
538
+ * Direct mapping to av_image_copy_to_buffer().
539
+ *
540
+ * @param dst - Destination buffer
541
+ *
542
+ * @param dstSize - Destination buffer size
543
+ *
544
+ * @param srcData - Source data planes
545
+ *
546
+ * @param srcLinesize - Source bytes per line
547
+ *
548
+ * @param pixFmt - Pixel format
549
+ *
550
+ * @param width - Image width
551
+ *
552
+ * @param height - Image height
553
+ *
554
+ * @param align - Buffer alignment
555
+ *
556
+ * @returns Bytes written, or negative AVERROR
557
+ *
558
+ * @example
559
+ * ```typescript
560
+ * const buffer = Buffer.alloc(bufferSize);
561
+ * const written = avImageCopyToBuffer(
562
+ * buffer, bufferSize,
563
+ * srcPlanes, srcStrides,
564
+ * AV_PIX_FMT_YUV420P, 1920, 1080, 1
565
+ * );
566
+ * ```
567
+ *
568
+ * @see [av_image_copy_to_buffer](https://ffmpeg.org/doxygen/7.1/group__lavu__picture.html#ga6f8576f1ef0c2d9a9f7c5ac7f9a28c52) - FFmpeg Doxygen
569
+ */
570
+ export declare function avImageCopyToBuffer(dst: Buffer, dstSize: number, srcData: Buffer[] | null, srcLinesize: number[] | null, pixFmt: AVPixelFormat, width: number, height: number, align: number): number;
571
+ /**
572
+ * Convert timestamp to string.
573
+ *
574
+ * Converts a timestamp to a string representation.
575
+ *
576
+ * Direct mapping to av_ts2str().
577
+ *
578
+ * @param ts - Timestamp value
579
+ *
580
+ * @returns String representation
581
+ *
582
+ * @example
583
+ * ```typescript
584
+ * const str1 = avTs2Str(1234567n); // Returns "1234567"
585
+ * const str2 = avTs2Str(null); // Returns "NOPTS"
586
+ * ```
587
+ *
588
+ * @see [av_ts2str](https://ffmpeg.org/doxygen/7.1/timestamp_8h.html#a86d797e907fa454ed5fd34bfb0bcd747) - FFmpeg Doxygen
589
+ */
590
+ export declare function avTs2Str(ts: bigint | number | null): string;
591
+ /**
592
+ * Convert timestamp to time string.
593
+ *
594
+ * Converts a timestamp to a time string using the specified time base.
595
+ *
596
+ * Direct mapping to av_ts2timestr().
597
+ *
598
+ * @param ts - Timestamp value
599
+ *
600
+ * @param timeBase - Time base for conversion
601
+ *
602
+ * @returns Time string representation
603
+ *
604
+ * @example
605
+ * ```typescript
606
+ * const timeStr = avTs2TimeStr(90000n, { num: 1, den: 90000 }); // Returns "1.000000"
607
+ * const nopts = avTs2TimeStr(null, { num: 1, den: 1000 }); // Returns "NOPTS"
608
+ * ```
609
+ *
610
+ * @see [av_ts2timestr](https://ffmpeg.org/doxygen/7.1/timestamp_8h.html#ad344b91ede6b86fc0a530611293f42da) - FFmpeg Doxygen
611
+ */
612
+ export declare function avTs2TimeStr(ts: bigint | number | null, timeBase: IRational | null): string;
613
+ /**
614
+ * Allocate image arrays.
615
+ *
616
+ * Allocates image data as separate plane arrays.
617
+ *
618
+ * @param width - Image width
619
+ *
620
+ * @param height - Image height
621
+ *
622
+ * @param pixFmt - Pixel format
623
+ *
624
+ * @param align - Buffer alignment
625
+ *
626
+ * @returns Object with data planes, line sizes, and total size
627
+ *
628
+ * @example
629
+ * ```typescript
630
+ * const { data, linesizes, size } = avImageAllocArrays(
631
+ * 1920, 1080, AV_PIX_FMT_YUV420P, 32
632
+ * );
633
+ * console.log(`Allocated ${data.length} planes, total ${size} bytes`);
634
+ * ```
635
+ */
636
+ export declare function avImageAllocArrays(width: number, height: number, pixFmt: AVPixelFormat, align: number): {
637
+ data: Buffer[];
638
+ linesizes: number[];
639
+ size: number;
640
+ };
641
+ /**
642
+ * Compare timestamps.
643
+ *
644
+ * Compares two timestamps with different time bases.
645
+ *
646
+ * Direct mapping to av_compare_ts().
647
+ *
648
+ * @param tsA - First timestamp
649
+ *
650
+ * @param tbA - First time base
651
+ *
652
+ * @param tsB - Second timestamp
653
+ *
654
+ * @param tbB - Second time base
655
+ *
656
+ * @returns -1 if A < B, 0 if A == B, 1 if A > B
657
+ *
658
+ * @example
659
+ * ```typescript
660
+ * const cmp = avCompareTs(
661
+ * 1000n, { num: 1, den: 1000 }, // 1 second
662
+ * 900n, { num: 1, den: 900 } // 1 second
663
+ * );
664
+ * // Returns 0 (equal)
665
+ * ```
666
+ *
667
+ * @see [av_compare_ts](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html#ga151744358fff630942b926e67e67c415) - FFmpeg Doxygen
668
+ */
669
+ export declare function avCompareTs(tsA: bigint | number | null, tbA: IRational, tsB: bigint | number | null, tbB: IRational): number;
670
+ /**
671
+ * Rescale timestamp.
672
+ *
673
+ * Rescales a timestamp from one time base to another.
674
+ *
675
+ * Direct mapping to av_rescale_q().
676
+ *
677
+ * @param a - Timestamp to rescale
678
+ *
679
+ * @param bq - Source time base
680
+ *
681
+ * @param cq - Destination time base
682
+ *
683
+ * @returns Rescaled timestamp
684
+ *
685
+ * @example
686
+ * ```typescript
687
+ * // Convert 1 second from 1000Hz to 90kHz
688
+ * const rescaled = avRescaleQ(
689
+ * 1000n,
690
+ * { num: 1, den: 1000 }, // 1000 Hz
691
+ * { num: 1, den: 90000 } // 90 kHz
692
+ * );
693
+ * // Returns 90000n
694
+ * ```
695
+ *
696
+ * @see [av_rescale_q](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f) - FFmpeg Doxygen
697
+ */
698
+ export declare function avRescaleQ(a: bigint | number | null, bq: IRational, cq: IRational): bigint;
699
+ /**
700
+ * Sleep for microseconds.
701
+ *
702
+ * Suspends execution for the specified number of microseconds.
703
+ *
704
+ * Direct mapping to av_usleep().
705
+ *
706
+ * @param usec - Microseconds to sleep
707
+ *
708
+ * @example
709
+ * ```typescript
710
+ * avUsleep(1000000); // Sleep for 1 second
711
+ * avUsleep(16667); // Sleep for ~16.67ms (60fps frame time)
712
+ * ```
713
+ *
714
+ * @see [av_usleep](https://ffmpeg.org/doxygen/7.1/time_8c.html#a4eee9c65835652a808973f4bc1641a51) - FFmpeg Doxygen
715
+ */
716
+ export declare function avUsleep(usec: number): void;
717
+ /**
718
+ * Rescale with rounding.
719
+ *
720
+ * Rescales a value with specified rounding behavior.
721
+ *
722
+ * Direct mapping to av_rescale_rnd().
723
+ *
724
+ * @param a - Value to rescale
725
+ *
726
+ * @param b - Multiplier
727
+ *
728
+ * @param c - Divisor
729
+ *
730
+ * @param rnd - Rounding mode (AV_ROUND_*)
731
+ *
732
+ * @returns Rescaled value
733
+ *
734
+ * @example
735
+ * ```typescript
736
+ * import { AV_ROUND_NEAR_INF } from 'node-av/constants';
737
+ *
738
+ * const rescaled = avRescaleRnd(1000n, 90000n, 1000n, AV_ROUND_NEAR_INF);
739
+ * // Returns 90000n
740
+ * ```
741
+ *
742
+ * @see [av_rescale_rnd](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html#ga82d40664213508918093822461cc597e) - FFmpeg Doxygen
743
+ */
744
+ export declare function avRescaleRnd(a: bigint | number, b: bigint | number, c: bigint | number, rnd: number): bigint;
745
+ /**
746
+ * Rescale a timestamp while preserving accuracy with coarse input timebases.
747
+ *
748
+ * Used for audio streamcopy to maintain accuracy when input timebase is coarse.
749
+ * Direct mapping to av_rescale_delta().
750
+ *
751
+ * @param inTb - Input timebase
752
+ *
753
+ * @param inTs - Input timestamp
754
+ *
755
+ * @param fsTb - Duration timebase (e.g., {1, sampleRate})
756
+ *
757
+ * @param duration - Duration in fsTb units
758
+ *
759
+ * @param lastRef - Reference object with `value` property (modified by function)
760
+ *
761
+ * @param lastRef.value - Last output timestamp (bigint)
762
+ *
763
+ * @param outTb - Output timebase
764
+ *
765
+ * @returns Rescaled timestamp
766
+ *
767
+ * @example
768
+ * ```typescript
769
+ * const inTb = { num: 1, den: 48000 };
770
+ * const inTs = 1000000n;
771
+ * const fsTb = { num: 1, den: 44100 };
772
+ * const duration = 1024;
773
+ * const lastRef = { value: 0n };
774
+ * const outTb = { num: 1, den: 96000 };
775
+ *
776
+ * const rescaled = avRescaleDelta(inTb, inTs, fsTb, duration, lastRef, outTb);
777
+ * ```
778
+ *
779
+ * @see [av_rescale_delta](https://ffmpeg.org/doxygen/7.1/group__lavu__math.html) - FFmpeg Doxygen
780
+ */
781
+ export declare function avRescaleDelta(inTb: IRational, inTs: bigint | number, fsTb: IRational, duration: number, lastRef: {
782
+ value: bigint;
783
+ }, outTb: IRational): bigint;
784
+ /**
785
+ * Multiply two rational numbers.
786
+ *
787
+ * Multiplies two rational numbers using FFmpeg's av_mul_q() which normalizes the result.
788
+ * This is more accurate than manual multiplication as it reduces the fraction.
789
+ *
790
+ * Direct mapping to av_mul_q().
791
+ *
792
+ * @param a - First rational number
793
+ *
794
+ * @param b - Second rational number
795
+ *
796
+ * @returns Product of a and b as a normalized rational
797
+ *
798
+ * @example
799
+ * ```typescript
800
+ * // Multiply framerate by 2
801
+ * const framerate = { num: 25, den: 1 };
802
+ * const doubled = avMulQ(framerate, { num: 2, den: 1 });
803
+ * // Returns { num: 50, den: 1 }
804
+ *
805
+ * // Calculate field rate for interlaced video
806
+ * const fieldRate = avMulQ(framerate, { num: 2, den: 1 });
807
+ * ```
808
+ *
809
+ * @see [av_mul_q](https://ffmpeg.org/doxygen/trunk/group__lavu__math__rational.html#ga89c0e84e30e2f90196e11fc254e4fc3f) - FFmpeg Doxygen
810
+ */
811
+ export declare function avMulQ(a: IRational, b: IRational): IRational;
812
+ /**
813
+ * Invert a rational number.
814
+ *
815
+ * Returns the reciprocal of a rational number using FFmpeg's av_inv_q().
816
+ * Swaps numerator and denominator: (a/b) becomes (b/a).
817
+ *
818
+ * Direct mapping to av_inv_q().
819
+ *
820
+ * @param q - Rational number to invert
821
+ *
822
+ * @returns Inverted rational (reciprocal)
823
+ *
824
+ * @example
825
+ * ```typescript
826
+ * // Convert framerate to frame duration
827
+ * const framerate = { num: 25, den: 1 }; // 25 fps
828
+ * const frameDuration = avInvQ(framerate); // 1/25 seconds
829
+ * // Returns { num: 1, den: 25 }
830
+ *
831
+ * // Get timebase from framerate
832
+ * const timebase = avInvQ({ num: 30000, den: 1001 }); // NTSC
833
+ * // Returns { num: 1001, den: 30000 }
834
+ * ```
835
+ *
836
+ * @see [av_inv_q](https://ffmpeg.org/doxygen/trunk/group__lavu__math__rational.html#ga587a784cb48299feea51d7dbbc6cc38c) - FFmpeg Doxygen
837
+ */
838
+ export declare function avInvQ(q: IRational): IRational;
839
+ /**
840
+ * Add two rational numbers.
841
+ *
842
+ * Adds two rational numbers using FFmpeg's av_add_q() which normalizes the result.
843
+ * This is more accurate than manual addition as it reduces the fraction.
844
+ *
845
+ * Direct mapping to av_add_q().
846
+ *
847
+ * @param a - First rational number
848
+ *
849
+ * @param b - Second rational number
850
+ *
851
+ * @returns Sum of a and b as a normalized rational
852
+ *
853
+ * @example
854
+ * ```typescript
855
+ * // Add two fractions
856
+ * const a = { num: 1, den: 2 }; // 1/2
857
+ * const b = { num: 1, den: 4 }; // 1/4
858
+ * const sum = avAddQ(a, b); // 3/4
859
+ * // Returns { num: 3, den: 4 }
860
+ *
861
+ * // Add timestamps with different timebases
862
+ * const ts1 = { num: 1000, den: 30000 };
863
+ * const ts2 = { num: 500, den: 30000 };
864
+ * const total = avAddQ(ts1, ts2);
865
+ * // Returns { num: 1, den: 20 } (normalized from 1500/30000)
866
+ * ```
867
+ *
868
+ * @see [av_add_q](https://ffmpeg.org/doxygen/trunk/group__lavu__math__rational.html#gac4af1feb227bd1095fc2cab42d933f52) - FFmpeg Doxygen
869
+ */
870
+ export declare function avAddQ(a: IRational, b: IRational): IRational;
871
+ /**
872
+ * Calculate greatest common divisor.
873
+ *
874
+ * Computes the GCD of two integers using FFmpeg's av_gcd().
875
+ * Uses the Euclidean algorithm for efficient computation.
876
+ *
877
+ * Direct mapping to av_gcd().
878
+ *
879
+ * @param a - First integer
880
+ *
881
+ * @param b - Second integer
882
+ *
883
+ * @returns Greatest common divisor of a and b
884
+ *
885
+ * @example
886
+ * ```typescript
887
+ * const gcd = avGcd(48000, 44100);
888
+ * console.log(gcd); // 300
889
+ *
890
+ * // Used for calculating LCM
891
+ * const lcm = (a * b) / avGcd(a, b);
892
+ * ```
893
+ *
894
+ * @see [av_gcd](https://ffmpeg.org/doxygen/trunk/group__lavu__math.html#ga0e8419780352de538c1c15098cb1a587) - FFmpeg Doxygen
895
+ */
896
+ export declare function avGcd(a: bigint | number, b: bigint | number): bigint;
897
+ /**
898
+ * Rescale timestamp with specified rounding mode.
899
+ *
900
+ * Rescales a timestamp from one time base to another with specific rounding behavior.
901
+ * More control than avRescaleQ() which uses default rounding.
902
+ *
903
+ * Direct mapping to av_rescale_q_rnd().
904
+ *
905
+ * @param a - Timestamp to rescale
906
+ *
907
+ * @param bq - Source time base
908
+ *
909
+ * @param cq - Destination time base
910
+ *
911
+ * @param rnd - Rounding mode (AV_ROUND_ZERO, AV_ROUND_INF, AV_ROUND_DOWN, AV_ROUND_UP, AV_ROUND_NEAR_INF)
912
+ *
913
+ * @returns Rescaled timestamp
914
+ *
915
+ * @example
916
+ * ```typescript
917
+ * import { AV_ROUND_UP, AV_ROUND_DOWN } from 'node-av/constants';
918
+ *
919
+ * const pts = 1000n;
920
+ * const srcTb = { num: 1, den: 48000 };
921
+ * const dstTb = { num: 1, den: 90000 };
922
+ *
923
+ * // Round up for safer comparisons
924
+ * const ptsUp = avRescaleQRnd(pts, srcTb, dstTb, AV_ROUND_UP);
925
+ *
926
+ * // Round down for conservative timestamps
927
+ * const ptsDown = avRescaleQRnd(pts, srcTb, dstTb, AV_ROUND_DOWN);
928
+ * ```
929
+ *
930
+ * @see [av_rescale_q_rnd](https://ffmpeg.org/doxygen/trunk/group__lavu__math.html#ga60044a302e86b5c2d8b19a81c8179f30) - FFmpeg Doxygen
931
+ */
932
+ export declare function avRescaleQRnd(a: bigint | number | null, bq: IRational, cq: IRational, rnd: number): bigint;
933
+ /**
934
+ * Get the duration of a single audio frame in samples.
935
+ *
936
+ * Returns the number of samples per audio frame for codecs with constant frame size,
937
+ * or calculates it based on frame bytes for variable frame size codecs.
938
+ *
939
+ * Direct mapping to av_get_audio_frame_duration2().
940
+ *
941
+ * @param codecpar - Codec parameters
942
+ *
943
+ * @param frameBytes - Size of the frame in bytes
944
+ *
945
+ * @returns Number of samples in the frame, or 0 if unknown
946
+ *
947
+ * @example
948
+ * ```typescript
949
+ * const frameDuration = avGetAudioFrameDuration2(codecpar, frameBytes);
950
+ * ```
951
+ *
952
+ * @see [av_get_audio_frame_duration2](https://ffmpeg.org/doxygen/7.1/group__lavc__misc.html) - FFmpeg Doxygen
953
+ */
954
+ export declare function avGetAudioFrameDuration2(codecpar: NativeWrapper<NativeCodecParameters>, frameBytes: number): number;
955
+ /**
956
+ * Allocate audio samples buffer.
957
+ *
958
+ * Allocates buffers for audio samples with the specified format.
959
+ *
960
+ * Direct mapping to av_samples_alloc().
961
+ *
962
+ * @param nbChannels - Number of audio channels
963
+ *
964
+ * @param nbSamples - Number of samples per channel
965
+ *
966
+ * @param sampleFmt - Sample format
967
+ *
968
+ * @param align - Buffer alignment
969
+ *
970
+ * @returns Object with data buffers, line size, and total size
971
+ *
972
+ * @throws {FFmpegError} If allocation fails
973
+ *
974
+ * @example
975
+ * ```typescript
976
+ * import { AV_SAMPLE_FMT_FLTP } from 'node-av/constants';
977
+ *
978
+ * const { data, linesize, size } = avSamplesAlloc(
979
+ * 2, 1024, AV_SAMPLE_FMT_FLTP, 0
980
+ * );
981
+ * console.log(`Allocated ${data.length} buffers, ${size} bytes total`);
982
+ * ```
983
+ *
984
+ * @see [av_samples_alloc](https://ffmpeg.org/doxygen/7.1/group__lavu__sampmanip.html#ga4db4c77f928d32c7d8854732f50b8c04) - FFmpeg Doxygen
985
+ * @see {@link avSamplesGetBufferSize} To calculate size without allocating
986
+ */
987
+ export declare function avSamplesAlloc(nbChannels: number, nbSamples: number, sampleFmt: AVSampleFormat, align: number): {
988
+ data: Buffer[];
989
+ linesize: number;
990
+ size: number;
991
+ };
992
+ /**
993
+ * Get audio samples buffer size.
994
+ *
995
+ * Calculates the required buffer size for audio samples.
996
+ *
997
+ * Direct mapping to av_samples_get_buffer_size().
998
+ *
999
+ * @param nbChannels - Number of channels
1000
+ *
1001
+ * @param nbSamples - Number of samples per channel
1002
+ *
1003
+ * @param sampleFmt - Sample format
1004
+ *
1005
+ * @param align - Buffer alignment
1006
+ *
1007
+ * @returns Object with size and line size
1008
+ *
1009
+ * @throws {FFmpegError} If parameters are invalid
1010
+ *
1011
+ * @example
1012
+ * ```typescript
1013
+ * import { AV_SAMPLE_FMT_S16 } from 'node-av/constants';
1014
+ *
1015
+ * const { size, linesize } = avSamplesGetBufferSize(
1016
+ * 2, 1024, AV_SAMPLE_FMT_S16, 0
1017
+ * );
1018
+ * console.log(`Need ${size} bytes, ${linesize} per channel`);
1019
+ * ```
1020
+ *
1021
+ * @see [av_samples_get_buffer_size](https://ffmpeg.org/doxygen/7.1/group__lavu__sampfmts.html#gaa7368bc4e3a366b688e81938ed55eb06) - FFmpeg Doxygen
1022
+ * @see {@link avSamplesAlloc} To allocate the buffer
1023
+ */
1024
+ export declare function avSamplesGetBufferSize(nbChannels: number, nbSamples: number, sampleFmt: AVSampleFormat, align: number): {
1025
+ size: number;
1026
+ linesize: number;
1027
+ };
1028
+ /**
1029
+ * Image crop function.
1030
+ *
1031
+ * Crops an image region from source buffer to destination buffer.
1032
+ *
1033
+ * @param dstBuffer - Destination buffer (must be pre-allocated)
1034
+ *
1035
+ * @param srcBuffer - Source buffer containing the image
1036
+ *
1037
+ * @param pixFmt - Pixel format
1038
+ *
1039
+ * @param srcWidth - Source image width
1040
+ *
1041
+ * @param srcHeight - Source image height
1042
+ *
1043
+ * @param cropX - X coordinate of crop region (left)
1044
+ *
1045
+ * @param cropY - Y coordinate of crop region (top)
1046
+ *
1047
+ * @param cropWidth - Width of crop region
1048
+ *
1049
+ * @param cropHeight - Height of crop region
1050
+ *
1051
+ * @returns Number of bytes copied
1052
+ *
1053
+ * @example
1054
+ * ```typescript
1055
+ * import { AV_PIX_FMT_NV12 } from 'node-av/constants';
1056
+ *
1057
+ * const dstSize = avImageGetBufferSize(AV_PIX_FMT_NV12, 100, 100, 1);
1058
+ * const dstBuffer = Buffer.alloc(dstSize);
1059
+ *
1060
+ * const bytesCopied = avImageCrop(
1061
+ * dstBuffer, srcBuffer,
1062
+ * AV_PIX_FMT_NV12,
1063
+ * 320, 180, // source dimensions
1064
+ * 10, 10, // crop position
1065
+ * 100, 100 // crop size
1066
+ * );
1067
+ * ```
1068
+ */
1069
+ export declare function avImageCrop(dstBuffer: Buffer, srcBuffer: Buffer, pixFmt: AVPixelFormat, srcWidth: number, srcHeight: number, cropX: number, cropY: number, cropWidth: number, cropHeight: number): number;
1070
+ /**
1071
+ * Describe channel layout.
1072
+ *
1073
+ * Returns a human-readable description of a channel layout.
1074
+ *
1075
+ * Direct mapping to av_channel_layout_describe().
1076
+ *
1077
+ * @param channelLayout - Channel layout to describe
1078
+ *
1079
+ * @returns Layout description string, or null
1080
+ *
1081
+ * @example
1082
+ * ```typescript
1083
+ * const stereo = { nbChannels: 2, order: 1, u: { mask: 3n } };
1084
+ * const desc = avChannelLayoutDescribe(stereo); // Returns "stereo"
1085
+ * ```
1086
+ *
1087
+ * @see [av_channel_layout_describe](https://ffmpeg.org/doxygen/7.1/group__lavu__audio__channels.html#gacc7d7d1a280248aafb8f9196c9d4e24f) - FFmpeg Doxygen
1088
+ */
1089
+ export declare function avChannelLayoutDescribe(channelLayout: Partial<ChannelLayout>): string | null;
1090
+ /**
1091
+ * Get the default channel layout for a given number of channels.
1092
+ *
1093
+ * Returns the canonical native layout FFmpeg uses for that channel count
1094
+ * (e.g. 1 → mono, 2 → stereo, 6 → 5.1). Useful to turn an unspecified layout
1095
+ * (order `AV_CHANNEL_ORDER_UNSPEC`, common for PCM) into a concrete one.
1096
+ *
1097
+ * Direct mapping to av_channel_layout_default().
1098
+ *
1099
+ * @param nbChannels - Number of channels
1100
+ *
1101
+ * @returns The default channel layout for that channel count
1102
+ *
1103
+ * @example
1104
+ * ```typescript
1105
+ * const stereo = avChannelLayoutDefault(2); // { order: 1, nbChannels: 2, mask: 3n }
1106
+ * ```
1107
+ *
1108
+ * @see [av_channel_layout_default](https://ffmpeg.org/doxygen/7.1/group__lavu__audio__channels.html) - FFmpeg Doxygen
1109
+ */
1110
+ export declare function avChannelLayoutDefault(nbChannels: number): ChannelLayout;
1111
+ /**
1112
+ * Pick the best-matching pixel format from a list for a given source format.
1113
+ *
1114
+ * Chooses the format from `pixFmtList` that converting `srcPixFmt` to incurs the
1115
+ * least loss (color depth, chroma subsampling, alpha). Useful to select a
1116
+ * codec-supported target pixel format that preserves as much of the source as
1117
+ * possible (e.g. yuv422p over yuv420p when the input is yuv444p).
1118
+ *
1119
+ * Direct mapping to avcodec_find_best_pix_fmt_of_list().
1120
+ *
1121
+ * @param pixFmtList - Candidate pixel formats (e.g. a codec's supported formats)
1122
+ *
1123
+ * @param srcPixFmt - Source pixel format to convert from
1124
+ *
1125
+ * @returns The least-loss pixel format from the list
1126
+ *
1127
+ * @example
1128
+ * ```typescript
1129
+ * const target = avcodecFindBestPixFmtOfList(codec.pixelFormats, frame.format);
1130
+ * ```
1131
+ *
1132
+ * @see [avcodec_find_best_pix_fmt_of_list](https://ffmpeg.org/doxygen/7.1/group__lavc__misc__pixfmt.html) - FFmpeg Doxygen
1133
+ */
1134
+ export declare function avcodecFindBestPixFmtOfList(pixFmtList: AVPixelFormat[], srcPixFmt: AVPixelFormat): AVPixelFormat;
1135
+ /**
1136
+ * Create SDP from format contexts.
1137
+ *
1138
+ * Creates an SDP (Session Description Protocol) string from format contexts.
1139
+ * Used for RTP/RTSP streaming.
1140
+ *
1141
+ * Direct mapping to av_sdp_create().
1142
+ *
1143
+ * @param contexts - Array of format contexts
1144
+ *
1145
+ * @returns SDP string, or null on error
1146
+ *
1147
+ * @example
1148
+ * ```typescript
1149
+ * const sdp = avSdpCreate([outputContext]);
1150
+ * if (sdp) {
1151
+ * console.log('SDP:\n' + sdp);
1152
+ * }
1153
+ * ```
1154
+ *
1155
+ * @see [av_sdp_create](https://ffmpeg.org/doxygen/7.1/group__lavf__misc.html#gaa2a7353a6bb0c8726797abd56b176af0) - FFmpeg Doxygen
1156
+ */
1157
+ export declare function avSdpCreate(contexts: FormatContext[]): string | null;
1158
+ /**
1159
+ * Predict and update DTS timestamps for demuxed packets.
1160
+ *
1161
+ * This is a native implementation of FFmpeg's `ist_dts_update()`.
1162
+ * It predicts the next DTS based on codec type and stream metadata,
1163
+ * handling both audio (sample-based) and video (frame-rate-based) timing.
1164
+ *
1165
+ * @param packet - Native Packet
1166
+ *
1167
+ * @param stream - Native Stream
1168
+ *
1169
+ * @param state - Current DTS prediction state
1170
+ *
1171
+ * @returns Updated state with new DTS values
1172
+ *
1173
+ * @example
1174
+ * ```typescript
1175
+ * const newState = dtsPredict(packet, stream, {
1176
+ * sawFirstTs: false,
1177
+ * dts: AV_NOPTS_VALUE,
1178
+ * nextDts: AV_NOPTS_VALUE,
1179
+ * firstDts: AV_NOPTS_VALUE,
1180
+ * });
1181
+ * ```
1182
+ */
1183
+ export declare function dtsPredict(packet: NativeWrapper<NativePacket>, stream: NativeWrapper<NativeStream>, state: DtsPredictState): DtsPredictState;
1184
+ /**
1185
+ * Convert string to FourCC.
1186
+ *
1187
+ * Converts a 4-character string to a packed FourCC integer.
1188
+ *
1189
+ * @param str - 4-character string
1190
+ *
1191
+ * @returns Packed FourCC as unsigned 32-bit integer
1192
+ *
1193
+ * @example
1194
+ * ```typescript
1195
+ * const fourcc = stringToFourCC("avc1"); // Returns 828601953 / 0x31637661
1196
+ * ```
1197
+ */
1198
+ export declare function stringToFourCC(str: string): number;