node-av-lgpl 0.0.0 → 7.1.0-beta.2

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 +384 -0
  283. package/dist/lib/stream.js +525 -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,953 @@
1
+ import { Dictionary } from './dictionary.js';
2
+ import type { AVOptionFlag, AVOptionSearchFlags, AVOptionType, AVOptionTypeBinary, AVOptionTypeBinaryIntArray, AVOptionTypeBool, AVOptionTypeChLayout, AVOptionTypeColor, AVOptionTypeConst, AVOptionTypeDict, AVOptionTypeDouble, AVOptionTypeDuration, AVOptionTypeFlags, AVOptionTypeFloat, AVOptionTypeImageSize, AVOptionTypeInt, AVOptionTypeInt64, AVOptionTypePixelFmt, AVOptionTypeRational, AVOptionTypeSampleFmt, AVOptionTypeString, AVOptionTypeUint, AVOptionTypeUint64, AVOptionTypeVideoRate, AVPixelFormat, AVSampleFormat } from '../constants/index.js';
3
+ import type { OptionCapableObject } from './binding.js';
4
+ import type { NativeOption } from './native-types.js';
5
+ import type { ChannelLayout, IDimension, IRational } from './types.js';
6
+ /**
7
+ * Option information descriptor.
8
+ *
9
+ * Describes a single option available on an FFmpeg object.
10
+ * Contains metadata about the option including name, type, default value,
11
+ * valid range, and documentation. Used to discover and validate options.
12
+ *
13
+ * Direct mapping to FFmpeg's AVOption.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { Option } from 'node-av';
18
+ *
19
+ * // Get option info
20
+ * const optInfo = Option.find(obj, 'bitrate');
21
+ * if (optInfo) {
22
+ * console.log(`Option: ${optInfo.name}`);
23
+ * console.log(`Help: ${optInfo.help}`);
24
+ * console.log(`Type: ${optInfo.type}`);
25
+ * console.log(`Default: ${optInfo.defaultValue}`);
26
+ * console.log(`Range: ${optInfo.min} - ${optInfo.max}`);
27
+ * }
28
+ * ```
29
+ *
30
+ * @see [AVOption](https://ffmpeg.org/doxygen/trunk/structAVOption.html) - FFmpeg Doxygen
31
+ */
32
+ export declare class OptionInfo {
33
+ private native;
34
+ /**
35
+ * @param native - The native option instance
36
+ *
37
+ * @internal
38
+ */
39
+ constructor(native: NativeOption);
40
+ /**
41
+ * Option name.
42
+ *
43
+ * The name used to get/set this option.
44
+ *
45
+ * Direct mapping to AVOption->name.
46
+ */
47
+ get name(): string | null;
48
+ /**
49
+ * Option help text.
50
+ *
51
+ * Human-readable description of the option's purpose.
52
+ *
53
+ * Direct mapping to AVOption->help.
54
+ */
55
+ get help(): string | null;
56
+ /**
57
+ * Option type.
58
+ *
59
+ * Data type of the option value (AV_OPT_TYPE_*).
60
+ *
61
+ * Direct mapping to AVOption->type.
62
+ */
63
+ get type(): AVOptionType;
64
+ /**
65
+ * Default value.
66
+ *
67
+ * The default value for this option.
68
+ * Type depends on the option type.
69
+ *
70
+ * Direct mapping to AVOption->default_val.
71
+ */
72
+ get defaultValue(): unknown;
73
+ /**
74
+ * Minimum value.
75
+ *
76
+ * Minimum valid value for numeric options.
77
+ *
78
+ * Direct mapping to AVOption->min.
79
+ */
80
+ get min(): number;
81
+ /**
82
+ * Maximum value.
83
+ *
84
+ * Maximum valid value for numeric options.
85
+ *
86
+ * Direct mapping to AVOption->max.
87
+ */
88
+ get max(): number;
89
+ /**
90
+ * Option flags.
91
+ *
92
+ * Combination of AV_OPT_FLAG_* indicating option properties.
93
+ *
94
+ * Direct mapping to AVOption->flags.
95
+ */
96
+ get flags(): AVOptionFlag;
97
+ /**
98
+ * Check if option has specific flags.
99
+ *
100
+ * Tests whether all specified flags are set using bitwise AND.
101
+ *
102
+ * @param flags - One or more flag values to check
103
+ *
104
+ * @returns true if all specified flags are set, false otherwise
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * import { AV_OPT_FLAG_ENCODING_PARAM } from 'node-av/constants';
109
+ *
110
+ * if (option.hasFlags(AV_OPT_FLAG_ENCODING_PARAM)) {
111
+ * console.log('This option is used for encoding');
112
+ * }
113
+ * ```
114
+ *
115
+ * @see {@link flags} For direct flags access
116
+ */
117
+ hasFlags(...flags: AVOptionFlag[]): boolean;
118
+ /**
119
+ * Option unit.
120
+ *
121
+ * Unit string for grouping related options.
122
+ *
123
+ * Direct mapping to AVOption->unit.
124
+ */
125
+ get unit(): string | null;
126
+ /**
127
+ * Get the underlying native Option object.
128
+ *
129
+ * @returns The native Option binding object
130
+ *
131
+ * @internal
132
+ */
133
+ getNative(): NativeOption;
134
+ }
135
+ /**
136
+ * FFmpeg option management utilities.
137
+ *
138
+ * Provides static methods for getting, setting, and querying options
139
+ * on FFmpeg objects that support the AVOption API. Handles type conversion
140
+ * and validation for various option types including strings, numbers,
141
+ * rationals, pixel formats, and more.
142
+ *
143
+ * Direct mapping to FFmpeg's AVOption API.
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * import { Option, FFmpegError } from 'node-av';
148
+ * import { AV_OPT_SEARCH_CHILDREN, AV_PIX_FMT_YUV420P } from 'node-av/constants';
149
+ *
150
+ * // Set various option types
151
+ * let ret = Option.set(obj, 'preset', 'fast');
152
+ * FFmpegError.throwIfError(ret, 'set preset');
153
+ *
154
+ * ret = Option.setInt(obj, 'bitrate', 2000000);
155
+ * FFmpegError.throwIfError(ret, 'set bitrate');
156
+ *
157
+ * ret = Option.setRational(obj, 'framerate', { num: 30, den: 1 });
158
+ * FFmpegError.throwIfError(ret, 'set framerate');
159
+ *
160
+ * // Get option values
161
+ * const preset = Option.get(obj, 'preset');
162
+ * const bitrate = Option.getInt(obj, 'bitrate');
163
+ * const framerate = Option.getRational(obj, 'framerate');
164
+ *
165
+ * // List all options
166
+ * let opt = null;
167
+ * while ((opt = Option.next(obj, opt))) {
168
+ * console.log(`${opt.name}: ${opt.help}`);
169
+ * }
170
+ * ```
171
+ *
172
+ * @see [AVOption API](https://ffmpeg.org/doxygen/trunk/group__avoptions.html) - FFmpeg Doxygen
173
+ * @see {@link OptionMember} For inherited option support
174
+ */
175
+ export declare class Option {
176
+ /**
177
+ * Iterate to next option.
178
+ *
179
+ * Iterates through available options on an object.
180
+ *
181
+ * Direct mapping to av_opt_next().
182
+ *
183
+ * @param obj - Object with options
184
+ *
185
+ * @param prev - Previous option (null to get first)
186
+ *
187
+ * @returns Next option, or null if no more
188
+ *
189
+ * @example
190
+ * ```typescript
191
+ * let opt = null;
192
+ * while ((opt = Option.next(obj, opt))) {
193
+ * console.log(`Option: ${opt.name}`);
194
+ * }
195
+ * ```
196
+ */
197
+ static next(obj: OptionCapableObject, prev?: OptionInfo | null): OptionInfo | null;
198
+ /**
199
+ * Find option by name.
200
+ *
201
+ * Searches for an option with the specified name.
202
+ *
203
+ * Direct mapping to av_opt_find().
204
+ *
205
+ * @param obj - Object to search
206
+ *
207
+ * @param name - Option name
208
+ *
209
+ * @param searchFlags - Search flags
210
+ *
211
+ * @returns Option info if found, null otherwise
212
+ *
213
+ * @example
214
+ * ```typescript
215
+ * const opt = Option.find(obj, 'bitrate');
216
+ * if (opt) {
217
+ * console.log(`Found: ${opt.name}, Type: ${opt.type}`);
218
+ * }
219
+ * ```
220
+ */
221
+ static find(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): OptionInfo | null;
222
+ /**
223
+ * Find option with target info.
224
+ *
225
+ * Like find() but also indicates if option was found on different target.
226
+ *
227
+ * Direct mapping to av_opt_find2().
228
+ *
229
+ * @param obj - Object to search
230
+ *
231
+ * @param name - Option name
232
+ *
233
+ * @param searchFlags - Search flags
234
+ *
235
+ * @returns Object with option and target info
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * const result = Option.find2(obj, 'bitrate', AV_OPT_SEARCH_CHILDREN);
240
+ * if (result?.option) {
241
+ * console.log(`Found on ${result.isDifferentTarget ? 'child' : 'object'}`);
242
+ * }
243
+ * ```
244
+ */
245
+ static find2(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): {
246
+ option: OptionInfo | null;
247
+ isDifferentTarget: boolean;
248
+ } | null;
249
+ /**
250
+ * Get string option value.
251
+ *
252
+ * Direct mapping to av_opt_get().
253
+ *
254
+ * @param obj - Object to query
255
+ *
256
+ * @param name - Option name
257
+ *
258
+ * @param searchFlags - Search flags
259
+ *
260
+ * @returns Option value as string, or null
261
+ *
262
+ * @example
263
+ * ```typescript
264
+ * // Get codec preset option
265
+ * const preset = Option.get(codecContext, 'preset', AV_OPT_SEARCH_CHILDREN);
266
+ * console.log('Codec preset:', preset); // 'medium', 'fast', etc.
267
+ * ```
268
+ */
269
+ static get(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): string | null;
270
+ /**
271
+ * Get integer option value.
272
+ *
273
+ * Direct mapping to av_opt_get_int().
274
+ *
275
+ * @param obj - Object to query
276
+ *
277
+ * @param name - Option name
278
+ *
279
+ * @param searchFlags - Search flags
280
+ *
281
+ * @returns Option value as integer, or null
282
+ *
283
+ * @example
284
+ * ```typescript
285
+ * // Get codec GOP size
286
+ * const gopSize = Option.getInt(codecContext, 'g', AV_OPT_SEARCH_CHILDREN);
287
+ * console.log('GOP size:', gopSize); // 60, 120, etc.
288
+ * ```
289
+ */
290
+ static getInt(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): number | null;
291
+ /**
292
+ * Get 64-bit integer option value.
293
+ *
294
+ * Returns a bigint to keep full int64 precision - getInt goes through a
295
+ * double and truncates values above 2^53.
296
+ *
297
+ * Direct mapping to av_opt_get_int().
298
+ *
299
+ * @param obj - Object to query
300
+ *
301
+ * @param name - Option name
302
+ *
303
+ * @param searchFlags - Search flags
304
+ *
305
+ * @returns Option value as bigint, or null
306
+ *
307
+ * @example
308
+ * ```typescript
309
+ * // Get maximum interleave delta
310
+ * const delta = Option.getInt64(formatContext, 'max_interleave_delta', AV_OPT_SEARCH_CHILDREN);
311
+ * console.log('Max interleave delta:', delta); // 10000000n
312
+ * ```
313
+ *
314
+ * @see {@link getInt} For 32-bit safe integer options
315
+ */
316
+ static getInt64(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): bigint | null;
317
+ /**
318
+ * Get double option value.
319
+ *
320
+ * Direct mapping to av_opt_get_double().
321
+ *
322
+ * @param obj - Object to query
323
+ *
324
+ * @param name - Option name
325
+ *
326
+ * @param searchFlags - Search flags
327
+ *
328
+ * @returns Option value as double, or null
329
+ *
330
+ * @example
331
+ * ```typescript
332
+ * // Get codec quality scale
333
+ * const crf = Option.getDouble(codecContext, 'crf', AV_OPT_SEARCH_CHILDREN);
334
+ * console.log('CRF value:', crf); // 23.0, 18.0, etc.
335
+ * ```
336
+ */
337
+ static getDouble(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): number | null;
338
+ /**
339
+ * Get rational option value.
340
+ *
341
+ * Direct mapping to av_opt_get_q().
342
+ *
343
+ * @param obj - Object to query
344
+ *
345
+ * @param name - Option name
346
+ *
347
+ * @param searchFlags - Search flags
348
+ *
349
+ * @returns Option value as rational, or null
350
+ *
351
+ * @example
352
+ * ```typescript
353
+ * // Get codec time base
354
+ * const timeBase = Option.getRational(codecContext, 'time_base', AV_OPT_SEARCH_CHILDREN);
355
+ * console.log('Time base:', timeBase); // { num: 1, den: 30 }
356
+ * ```
357
+ */
358
+ static getRational(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): IRational | null;
359
+ /**
360
+ * Get pixel format option value.
361
+ *
362
+ * Direct mapping to av_opt_get_pixel_fmt().
363
+ *
364
+ * @param obj - Object to query
365
+ *
366
+ * @param name - Option name
367
+ *
368
+ * @param searchFlags - Search flags
369
+ *
370
+ * @returns Pixel format value, or null
371
+ *
372
+ * @example
373
+ * ```typescript
374
+ * // Get filter pixel format
375
+ * const pixFmt = Option.getPixelFormat(filterContext, 'pix_fmt', AV_OPT_SEARCH_CHILDREN);
376
+ * console.log('Pixel format:', pixFmt); // AV_PIX_FMT_YUV420P, etc.
377
+ * ```
378
+ */
379
+ static getPixelFormat(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): AVPixelFormat | null;
380
+ /**
381
+ * Get sample format option value.
382
+ *
383
+ * Direct mapping to av_opt_get_sample_fmt().
384
+ *
385
+ * @param obj - Object to query
386
+ *
387
+ * @param name - Option name
388
+ *
389
+ * @param searchFlags - Search flags
390
+ *
391
+ * @returns Sample format value, or null
392
+ *
393
+ * @example
394
+ * ```typescript
395
+ * // Get audio codec sample format
396
+ * const sampleFmt = Option.getSampleFormat(codecContext, 'sample_fmt', AV_OPT_SEARCH_CHILDREN);
397
+ * console.log('Sample format:', sampleFmt); // AV_SAMPLE_FMT_FLTP, etc.
398
+ * ```
399
+ */
400
+ static getSampleFormat(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): AVSampleFormat | null;
401
+ /**
402
+ * Get image size option value.
403
+ *
404
+ * Direct mapping to av_opt_get_image_size().
405
+ *
406
+ * @param obj - Object to query
407
+ *
408
+ * @param name - Option name
409
+ *
410
+ * @param searchFlags - Search flags
411
+ *
412
+ * @returns Width and height, or null
413
+ *
414
+ * @example
415
+ * ```typescript
416
+ * // Get filter output size
417
+ * const size = Option.getImageSize(filterContext, 'size', AV_OPT_SEARCH_CHILDREN);
418
+ * console.log('Output size:', size); // { width: 1920, height: 1080 }
419
+ * ```
420
+ */
421
+ static getImageSize(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): IDimension | null;
422
+ /**
423
+ * Get channel layout option value.
424
+ *
425
+ * Direct mapping to av_opt_get_chlayout().
426
+ *
427
+ * @param obj - Object to query
428
+ *
429
+ * @param name - Option name
430
+ *
431
+ * @param searchFlags - Search flags
432
+ *
433
+ * @returns Channel layout, or null
434
+ *
435
+ * @example
436
+ * ```typescript
437
+ * // Get audio channel layout
438
+ * const layout = Option.getChannelLayout(codecContext, 'channel_layout', AV_OPT_SEARCH_CHILDREN);
439
+ * console.log('Channel layout:', layout); // stereo, 5.1, etc.
440
+ * ```
441
+ */
442
+ static getChannelLayout(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): ChannelLayout | null;
443
+ /**
444
+ * Get dictionary option value.
445
+ *
446
+ * Direct mapping to av_opt_get_dict_val().
447
+ *
448
+ * @param obj - Object to query
449
+ *
450
+ * @param name - Option name
451
+ *
452
+ * @param searchFlags - Search flags
453
+ *
454
+ * @returns Dictionary value, or null
455
+ *
456
+ * @example
457
+ * ```typescript
458
+ * // Get metadata dictionary
459
+ * const metadata = Option.getDict(formatContext, 'metadata', AV_OPT_SEARCH_CHILDREN);
460
+ * console.log('Metadata:', metadata?.get('title'));
461
+ * ```
462
+ */
463
+ static getDict(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): Dictionary | null;
464
+ /**
465
+ * Set string option value.
466
+ *
467
+ * Direct mapping to av_opt_set().
468
+ *
469
+ * @param obj - Object to modify
470
+ *
471
+ * @param name - Option name
472
+ *
473
+ * @param value - String value
474
+ *
475
+ * @param searchFlags - Search flags
476
+ *
477
+ * @returns 0 on success, negative AVERROR on error
478
+ *
479
+ * @example
480
+ * ```typescript
481
+ * // Set codec preset
482
+ * const ret = Option.set(codecContext, 'preset', 'fast', AV_OPT_SEARCH_CHILDREN);
483
+ * FFmpegError.throwIfError(ret, 'Failed to set preset');
484
+ * ```
485
+ */
486
+ static set(obj: OptionCapableObject, name: string, value: string, searchFlags?: AVOptionSearchFlags): number;
487
+ /**
488
+ * Set integer option value.
489
+ *
490
+ * Direct mapping to av_opt_set_int().
491
+ *
492
+ * @param obj - Object to modify
493
+ *
494
+ * @param name - Option name
495
+ *
496
+ * @param value - Integer value
497
+ *
498
+ * @param searchFlags - Search flags
499
+ *
500
+ * @returns 0 on success, negative AVERROR on error
501
+ *
502
+ * @example
503
+ * ```typescript
504
+ * // Set codec bitrate
505
+ * const ret = Option.setInt(codecContext, 'b', 2000000, AV_OPT_SEARCH_CHILDREN);
506
+ * FFmpegError.throwIfError(ret, 'Failed to set bitrate');
507
+ * ```
508
+ */
509
+ static setInt(obj: OptionCapableObject, name: string, value: number | bigint, searchFlags?: AVOptionSearchFlags): number;
510
+ /**
511
+ * Set double option value.
512
+ *
513
+ * Direct mapping to av_opt_set_double().
514
+ *
515
+ * @param obj - Object to modify
516
+ *
517
+ * @param name - Option name
518
+ *
519
+ * @param value - Double value
520
+ *
521
+ * @param searchFlags - Search flags
522
+ *
523
+ * @returns 0 on success, negative AVERROR on error
524
+ *
525
+ * @example
526
+ * ```typescript
527
+ * // Set codec CRF value
528
+ * const ret = Option.setDouble(codecContext, 'crf', 23.0, AV_OPT_SEARCH_CHILDREN);
529
+ * FFmpegError.throwIfError(ret, 'Failed to set CRF');
530
+ * ```
531
+ */
532
+ static setDouble(obj: OptionCapableObject, name: string, value: number, searchFlags?: AVOptionSearchFlags): number;
533
+ /**
534
+ * Set rational option value.
535
+ *
536
+ * Direct mapping to av_opt_set_q().
537
+ *
538
+ * @param obj - Object to modify
539
+ *
540
+ * @param name - Option name
541
+ *
542
+ * @param value - Rational value
543
+ *
544
+ * @param searchFlags - Search flags
545
+ *
546
+ * @returns 0 on success, negative AVERROR on error
547
+ *
548
+ * @example
549
+ * ```typescript
550
+ * // Set codec frame rate
551
+ * const ret = Option.setRational(codecContext, 'framerate', { num: 30, den: 1 }, AV_OPT_SEARCH_CHILDREN);
552
+ * FFmpegError.throwIfError(ret, 'Failed to set framerate');
553
+ * ```
554
+ */
555
+ static setRational(obj: OptionCapableObject, name: string, value: IRational, searchFlags?: AVOptionSearchFlags): number;
556
+ /**
557
+ * Set pixel format option value.
558
+ *
559
+ * Direct mapping to av_opt_set_pixel_fmt().
560
+ *
561
+ * @param obj - Object to modify
562
+ *
563
+ * @param name - Option name
564
+ *
565
+ * @param value - Pixel format
566
+ *
567
+ * @param searchFlags - Search flags
568
+ *
569
+ * @returns 0 on success, negative AVERROR on error
570
+ *
571
+ * @example
572
+ * ```typescript
573
+ * // Set filter pixel format
574
+ * const ret = Option.setPixelFormat(filterContext, 'pix_fmt', AV_PIX_FMT_YUV420P, AV_OPT_SEARCH_CHILDREN);
575
+ * FFmpegError.throwIfError(ret, 'Failed to set pixel format');
576
+ * ```
577
+ */
578
+ static setPixelFormat(obj: OptionCapableObject, name: string, value: AVPixelFormat, searchFlags?: AVOptionSearchFlags): number;
579
+ /**
580
+ * Set sample format option value.
581
+ *
582
+ * Direct mapping to av_opt_set_sample_fmt().
583
+ *
584
+ * @param obj - Object to modify
585
+ *
586
+ * @param name - Option name
587
+ *
588
+ * @param value - Sample format
589
+ *
590
+ * @param searchFlags - Search flags
591
+ *
592
+ * @returns 0 on success, negative AVERROR on error
593
+ *
594
+ * @example
595
+ * ```typescript
596
+ * // Set audio codec sample format
597
+ * const ret = Option.setSampleFormat(codecContext, 'sample_fmt', AV_SAMPLE_FMT_FLTP, AV_OPT_SEARCH_CHILDREN);
598
+ * FFmpegError.throwIfError(ret, 'Failed to set sample format');
599
+ * ```
600
+ */
601
+ static setSampleFormat(obj: OptionCapableObject, name: string, value: AVSampleFormat, searchFlags?: AVOptionSearchFlags): number;
602
+ /**
603
+ * Set image size option value.
604
+ *
605
+ * Direct mapping to av_opt_set_image_size().
606
+ *
607
+ * @param obj - Object to modify
608
+ *
609
+ * @param name - Option name
610
+ *
611
+ * @param width - Image width
612
+ *
613
+ * @param height - Image height
614
+ *
615
+ * @param searchFlags - Search flags
616
+ *
617
+ * @returns 0 on success, negative AVERROR on error
618
+ *
619
+ * @example
620
+ * ```typescript
621
+ * // Set filter output size
622
+ * const ret = Option.setImageSize(filterContext, 'size', 1920, 1080, AV_OPT_SEARCH_CHILDREN);
623
+ * FFmpegError.throwIfError(ret, 'Failed to set image size');
624
+ * ```
625
+ */
626
+ static setImageSize(obj: OptionCapableObject, name: string, width: number, height: number, searchFlags?: AVOptionSearchFlags): number;
627
+ /**
628
+ * Set channel layout option value.
629
+ *
630
+ * Direct mapping to av_opt_set_chlayout().
631
+ *
632
+ * @param obj - Object to modify
633
+ *
634
+ * @param name - Option name
635
+ *
636
+ * @param value - Channel layout
637
+ *
638
+ * @param searchFlags - Search flags
639
+ *
640
+ * @returns 0 on success, negative AVERROR on error
641
+ *
642
+ * @example
643
+ * ```typescript
644
+ * // Set audio channel layout to stereo
645
+ * const ret = Option.setChannelLayout(codecContext, 'channel_layout', AV_CHANNEL_LAYOUT_STEREO, AV_OPT_SEARCH_CHILDREN);
646
+ * FFmpegError.throwIfError(ret, 'Failed to set channel layout');
647
+ * ```
648
+ */
649
+ static setChannelLayout(obj: OptionCapableObject, name: string, value: number, searchFlags?: AVOptionSearchFlags): number;
650
+ /**
651
+ * Set dictionary option value.
652
+ *
653
+ * Direct mapping to av_opt_set_dict_val().
654
+ *
655
+ * @param obj - Object to modify
656
+ *
657
+ * @param name - Option name
658
+ *
659
+ * @param value - Dictionary value
660
+ *
661
+ * @param searchFlags - Search flags
662
+ *
663
+ * @returns 0 on success, negative AVERROR on error
664
+ *
665
+ * @example
666
+ * ```typescript
667
+ * // Set metadata dictionary
668
+ * const dict = new Dictionary();
669
+ * dict.set('title', 'My Video');
670
+ * const ret = Option.setDict(formatContext, 'metadata', dict, AV_OPT_SEARCH_CHILDREN);
671
+ * FFmpegError.throwIfError(ret, 'Failed to set metadata');
672
+ * ```
673
+ */
674
+ static setDict(obj: OptionCapableObject, name: string, value: Dictionary, searchFlags?: AVOptionSearchFlags): number;
675
+ /**
676
+ * Set binary option value.
677
+ *
678
+ * Direct mapping to av_opt_set_bin().
679
+ *
680
+ * @param obj - Object to modify
681
+ *
682
+ * @param name - Option name
683
+ *
684
+ * @param value - Binary data
685
+ *
686
+ * @param searchFlags - Search flags
687
+ *
688
+ * @returns 0 on success, negative AVERROR on error
689
+ *
690
+ * @example
691
+ * ```typescript
692
+ * // Set binary extradata
693
+ * const extradata = Buffer.from([0x00, 0x01, 0x02, 0x03]);
694
+ * const ret = Option.setBin(codecContext, 'extradata', extradata, AV_OPT_SEARCH_CHILDREN);
695
+ * FFmpegError.throwIfError(ret, 'Failed to set extradata');
696
+ * ```
697
+ */
698
+ static setBin(obj: OptionCapableObject, name: string, value: Buffer, searchFlags?: AVOptionSearchFlags): number;
699
+ /**
700
+ * Set defaults on object.
701
+ *
702
+ * Sets all options to their default values.
703
+ *
704
+ * Direct mapping to av_opt_set_defaults().
705
+ *
706
+ * @param obj - Object to reset
707
+ *
708
+ * @example
709
+ * ```typescript
710
+ * // Reset all codec options to defaults
711
+ * Option.setDefaults(codecContext);
712
+ * ```
713
+ */
714
+ static setDefaults(obj: OptionCapableObject): void;
715
+ /**
716
+ * Copy options between objects.
717
+ *
718
+ * Copies option values from source to destination.
719
+ *
720
+ * Direct mapping to av_opt_copy().
721
+ *
722
+ * @param dest - Destination object
723
+ *
724
+ * @param src - Source object
725
+ *
726
+ * @returns 0 on success, negative AVERROR on error
727
+ *
728
+ * @example
729
+ * ```typescript
730
+ * // Copy options from one codec context to another
731
+ * const ret = Option.copy(destCodecContext, srcCodecContext);
732
+ * FFmpegError.throwIfError(ret, 'Failed to copy options');
733
+ * ```
734
+ */
735
+ static copy(dest: OptionCapableObject, src: OptionCapableObject): number;
736
+ /**
737
+ * Check if option is set to default.
738
+ *
739
+ * Direct mapping to av_opt_is_set_to_default().
740
+ *
741
+ * @param obj - Object to check
742
+ *
743
+ * @param name - Option name
744
+ *
745
+ * @param searchFlags - Search flags
746
+ *
747
+ * @returns True if default, false if modified, null if not found
748
+ *
749
+ * @example
750
+ * ```typescript
751
+ * // Check if bitrate is at default value
752
+ * const isDefault = Option.isSetToDefault(codecContext, 'b', AV_OPT_SEARCH_CHILDREN);
753
+ * console.log('Bitrate is default:', isDefault);
754
+ * ```
755
+ */
756
+ static isSetToDefault(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): boolean | null;
757
+ /**
758
+ * Serialize options to string.
759
+ *
760
+ * Direct mapping to av_opt_serialize().
761
+ *
762
+ * @param obj - Object to serialize
763
+ *
764
+ * @param optFlags - Option flags filter
765
+ *
766
+ * @param flags - Serialization flags
767
+ *
768
+ * @param keyValSep - Key-value separator
769
+ *
770
+ * @param pairsSep - Pairs separator
771
+ *
772
+ * @returns Serialized string, or null on error
773
+ *
774
+ * @example
775
+ * ```typescript
776
+ * // Serialize codec options to string
777
+ * const serialized = Option.serialize(codecContext, 0, 0, '=', ':');
778
+ * console.log('Options:', serialized); // 'bitrate=2000000:preset=fast'
779
+ * ```
780
+ */
781
+ static serialize(obj: OptionCapableObject, optFlags?: number, flags?: number, keyValSep?: string, pairsSep?: string): string | null;
782
+ /**
783
+ * Free option resources.
784
+ *
785
+ * Direct mapping to av_opt_free().
786
+ *
787
+ * @param obj - Object to free options from
788
+ *
789
+ * @example
790
+ * ```typescript
791
+ * // Free codec context options
792
+ * Option.free(codecContext);
793
+ * ```
794
+ */
795
+ static free(obj: OptionCapableObject): void;
796
+ /**
797
+ * Show options for debugging.
798
+ *
799
+ * Direct mapping to av_opt_show2().
800
+ *
801
+ * @param obj - Object to show options for
802
+ *
803
+ * @param reqFlags - Required flags
804
+ *
805
+ * @param rejFlags - Rejected flags
806
+ *
807
+ * @returns 0 on success, negative AVERROR on error
808
+ *
809
+ * @example
810
+ * ```typescript
811
+ * // Show all codec options for debugging
812
+ * const ret = Option.show(codecContext, 0, 0);
813
+ * FFmpegError.throwIfError(ret, 'Failed to show options');
814
+ * ```
815
+ */
816
+ static show(obj: OptionCapableObject, reqFlags?: number, rejFlags?: number): number;
817
+ }
818
+ /**
819
+ * Base class for FFmpeg objects that support AVOptions.
820
+ *
821
+ * Provides a common interface for getting, setting, and listing options
822
+ * on FFmpeg objects that have an AVClass structure. This includes codecs,
823
+ * formats, filters, and various processing contexts.
824
+ *
825
+ * Classes that support AVOptions should extend this class to inherit
826
+ * the option management functionality.
827
+ *
828
+ * @template T - The native FFmpeg object type that supports AVOptions
829
+ *
830
+ * @example
831
+ * ```typescript
832
+ * import { OptionMember, FFmpegError } from 'node-av';
833
+ * import { AV_OPT_TYPE_INT, AV_OPT_TYPE_STRING, AV_OPT_TYPE_RATIONAL } from 'node-av/constants';
834
+ *
835
+ * class CodecContext extends OptionMember<NativeCodecContext> {
836
+ * constructor(native: NativeCodecContext) {
837
+ * super(native);
838
+ * }
839
+ * }
840
+ *
841
+ * // Use inherited methods
842
+ * const codec = new CodecContext(native);
843
+ *
844
+ * // Set options with automatic type handling
845
+ * let ret = codec.setOption('preset', 'fast');
846
+ * FFmpegError.throwIfError(ret, 'set preset');
847
+ *
848
+ * ret = codec.setOption('bitrate', 2000000, AV_OPT_TYPE_INT);
849
+ * FFmpegError.throwIfError(ret, 'set bitrate');
850
+ *
851
+ * ret = codec.setOption('framerate', { num: 30, den: 1 }, AV_OPT_TYPE_RATIONAL);
852
+ * FFmpegError.throwIfError(ret, 'set framerate');
853
+ *
854
+ * // Get typed options
855
+ * const preset = codec.getOption('preset');
856
+ * const bitrate = codec.getOption('bitrate', AV_OPT_TYPE_INT);
857
+ * const framerate = codec.getOption('framerate', AV_OPT_TYPE_RATIONAL);
858
+ *
859
+ * // List all available options
860
+ * const options = codec.listOptions();
861
+ * for (const opt of options) {
862
+ * console.log(`${opt.name}: ${opt.help}`);
863
+ * }
864
+ * ```
865
+ *
866
+ * @see {@link Option} For static option methods
867
+ * @see {@link OptionInfo} For option metadata
868
+ */
869
+ export declare class OptionMember<T extends OptionCapableObject> {
870
+ protected native: T;
871
+ constructor(native: T);
872
+ setOption(name: string, value: string | number | boolean | bigint | null | undefined): number;
873
+ setOption(name: string, value: string, type: AVOptionTypeString, searchFlags?: AVOptionSearchFlags): number;
874
+ setOption(name: string, value: string, type: AVOptionTypeColor, searchFlags?: AVOptionSearchFlags): number;
875
+ setOption(name: string, value: number, type: AVOptionTypeInt, searchFlags?: AVOptionSearchFlags): number;
876
+ setOption(name: string, value: bigint, type: AVOptionTypeInt64, searchFlags?: AVOptionSearchFlags): number;
877
+ setOption(name: string, value: number, type: AVOptionTypeUint, searchFlags?: AVOptionSearchFlags): number;
878
+ setOption(name: string, value: bigint, type: AVOptionTypeUint64, searchFlags?: AVOptionSearchFlags): number;
879
+ setOption(name: string, value: number, type: AVOptionTypeFlags, searchFlags?: AVOptionSearchFlags): number;
880
+ setOption(name: string, value: boolean, type: AVOptionTypeBool, searchFlags?: AVOptionSearchFlags): number;
881
+ setOption(name: string, value: number, type: AVOptionTypeDuration, searchFlags?: AVOptionSearchFlags): number;
882
+ setOption(name: string, value: number, type: AVOptionTypeConst, searchFlags?: AVOptionSearchFlags): number;
883
+ setOption(name: string, value: number, type: AVOptionTypeDouble, searchFlags?: AVOptionSearchFlags): number;
884
+ setOption(name: string, value: number, type: AVOptionTypeFloat, searchFlags?: AVOptionSearchFlags): number;
885
+ setOption(name: string, value: IRational, type: AVOptionTypeRational, searchFlags?: AVOptionSearchFlags): number;
886
+ setOption(name: string, value: IRational, type: AVOptionTypeVideoRate, searchFlags?: AVOptionSearchFlags): number;
887
+ setOption(name: string, value: AVPixelFormat, type: AVOptionTypePixelFmt, searchFlags?: AVOptionSearchFlags): number;
888
+ setOption(name: string, value: AVSampleFormat, type: AVOptionTypeSampleFmt, searchFlags?: AVOptionSearchFlags): number;
889
+ setOption(name: string, value: IDimension, type: AVOptionTypeImageSize, searchFlags?: AVOptionSearchFlags): number;
890
+ setOption(name: string, value: number | bigint, type: AVOptionTypeChLayout, searchFlags?: AVOptionSearchFlags): number;
891
+ setOption(name: string, value: Buffer, type: AVOptionTypeBinary, searchFlags?: AVOptionSearchFlags): number;
892
+ setOption(name: string, value: number[], type: AVOptionTypeBinaryIntArray, searchFlags?: AVOptionSearchFlags): number;
893
+ setOption(name: string, value: Dictionary, type: AVOptionTypeDict, searchFlags?: AVOptionSearchFlags): number;
894
+ getOption(name: string, type?: AVOptionTypeString, searchFlags?: AVOptionSearchFlags): string | null;
895
+ getOption(name: string, type: AVOptionTypeColor, searchFlags?: AVOptionSearchFlags): string | null;
896
+ getOption(name: string, type: AVOptionTypeInt, searchFlags?: AVOptionSearchFlags): number | null;
897
+ getOption(name: string, type: AVOptionTypeInt64, searchFlags?: AVOptionSearchFlags): bigint | null;
898
+ getOption(name: string, type: AVOptionTypeUint, searchFlags?: AVOptionSearchFlags): number | null;
899
+ getOption(name: string, type: AVOptionTypeUint64, searchFlags?: AVOptionSearchFlags): bigint | null;
900
+ getOption(name: string, type: AVOptionTypeFlags, searchFlags?: AVOptionSearchFlags): number | null;
901
+ getOption(name: string, type: AVOptionTypeBool, searchFlags?: AVOptionSearchFlags): boolean | null;
902
+ getOption(name: string, type: AVOptionTypeDuration, searchFlags?: AVOptionSearchFlags): number | null;
903
+ getOption(name: string, type: AVOptionTypeConst, searchFlags?: AVOptionSearchFlags): number | null;
904
+ getOption(name: string, type: AVOptionTypeDouble, searchFlags?: AVOptionSearchFlags): number | null;
905
+ getOption(name: string, type: AVOptionTypeFloat, searchFlags?: AVOptionSearchFlags): number | null;
906
+ getOption(name: string, type: AVOptionTypeRational, searchFlags?: AVOptionSearchFlags): IRational | null;
907
+ getOption(name: string, type: AVOptionTypeVideoRate, searchFlags?: AVOptionSearchFlags): IRational | null;
908
+ getOption(name: string, type: AVOptionTypePixelFmt, searchFlags?: AVOptionSearchFlags): AVPixelFormat | null;
909
+ getOption(name: string, type: AVOptionTypeSampleFmt, searchFlags?: AVOptionSearchFlags): AVSampleFormat | null;
910
+ getOption(name: string, type: AVOptionTypeImageSize, searchFlags?: AVOptionSearchFlags): IDimension | null;
911
+ getOption(name: string, type: AVOptionTypeChLayout, searchFlags?: AVOptionSearchFlags): ChannelLayout | null;
912
+ getOption(name: string, type: AVOptionTypeDict, searchFlags?: AVOptionSearchFlags): Dictionary | null;
913
+ getOption(name: string, type: AVOptionTypeBinary, searchFlags?: AVOptionSearchFlags): string | null;
914
+ /**
915
+ * List all available options for this object.
916
+ *
917
+ * Uses the AVOption API to enumerate all options.
918
+ * Useful for discovering available settings and their types.
919
+ *
920
+ * Direct mapping to av_opt_next() iteration.
921
+ *
922
+ * @returns Array of option information objects
923
+ *
924
+ * @example
925
+ * ```typescript
926
+ * const options = obj.listOptions();
927
+ * for (const opt of options) {
928
+ * console.log(`${opt.name}: ${opt.help}`);
929
+ * console.log(` Type: ${opt.type}, Default: ${opt.defaultValue}`);
930
+ * console.log(` Range: ${opt.min} - ${opt.max}`);
931
+ * }
932
+ * ```
933
+ *
934
+ * @see {@link OptionInfo} For option metadata structure
935
+ */
936
+ listOptions(): OptionInfo[];
937
+ /**
938
+ * Intelligently set a format option based on its FFmpeg type.
939
+ *
940
+ * Queries the option type using av_opt_find() and calls the appropriate
941
+ * typed setOption() overload. Handles automatic type conversion from
942
+ * JavaScript types to FFmpeg option types.
943
+ *
944
+ * @param name - Option name
945
+ *
946
+ * @param value - Option value (null/undefined are skipped)
947
+ *
948
+ * @returns 0 on success, negative on error
949
+ *
950
+ * @internal
951
+ */
952
+ private setUnknownOption;
953
+ }