node-av 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +51 -59
  2. package/dist/api/bitstream-filter.d.ts +183 -123
  3. package/dist/api/bitstream-filter.js +185 -127
  4. package/dist/api/bitstream-filter.js.map +1 -1
  5. package/dist/api/decoder.d.ts +282 -130
  6. package/dist/api/decoder.js +290 -142
  7. package/dist/api/decoder.js.map +1 -1
  8. package/dist/api/encoder.d.ts +249 -160
  9. package/dist/api/encoder.js +276 -207
  10. package/dist/api/encoder.js.map +1 -1
  11. package/dist/api/filter-presets.d.ts +1944 -96
  12. package/dist/api/filter-presets.js +2059 -105
  13. package/dist/api/filter-presets.js.map +1 -1
  14. package/dist/api/filter.d.ts +264 -200
  15. package/dist/api/filter.js +269 -231
  16. package/dist/api/filter.js.map +1 -1
  17. package/dist/api/hardware.d.ts +246 -117
  18. package/dist/api/hardware.js +440 -217
  19. package/dist/api/hardware.js.map +1 -1
  20. package/dist/api/index.d.ts +3 -3
  21. package/dist/api/index.js +1 -1
  22. package/dist/api/index.js.map +1 -1
  23. package/dist/api/io-stream.d.ts +65 -55
  24. package/dist/api/io-stream.js +43 -40
  25. package/dist/api/io-stream.js.map +1 -1
  26. package/dist/api/media-input.d.ts +242 -139
  27. package/dist/api/media-input.js +205 -103
  28. package/dist/api/media-input.js.map +1 -1
  29. package/dist/api/media-output.d.ts +208 -126
  30. package/dist/api/media-output.js +212 -126
  31. package/dist/api/media-output.js.map +1 -1
  32. package/dist/api/pipeline.d.ts +361 -38
  33. package/dist/api/pipeline.js +255 -14
  34. package/dist/api/pipeline.js.map +1 -1
  35. package/dist/api/types.d.ts +26 -187
  36. package/dist/api/utilities/audio-sample.d.ts +0 -8
  37. package/dist/api/utilities/audio-sample.js +0 -8
  38. package/dist/api/utilities/audio-sample.js.map +1 -1
  39. package/dist/api/utilities/channel-layout.d.ts +0 -8
  40. package/dist/api/utilities/channel-layout.js +0 -8
  41. package/dist/api/utilities/channel-layout.js.map +1 -1
  42. package/dist/api/utilities/image.d.ts +0 -8
  43. package/dist/api/utilities/image.js +0 -8
  44. package/dist/api/utilities/image.js.map +1 -1
  45. package/dist/api/utilities/index.d.ts +3 -3
  46. package/dist/api/utilities/index.js +3 -3
  47. package/dist/api/utilities/index.js.map +1 -1
  48. package/dist/api/utilities/media-type.d.ts +1 -9
  49. package/dist/api/utilities/media-type.js +1 -9
  50. package/dist/api/utilities/media-type.js.map +1 -1
  51. package/dist/api/utilities/pixel-format.d.ts +1 -9
  52. package/dist/api/utilities/pixel-format.js +1 -9
  53. package/dist/api/utilities/pixel-format.js.map +1 -1
  54. package/dist/api/utilities/sample-format.d.ts +1 -9
  55. package/dist/api/utilities/sample-format.js +1 -9
  56. package/dist/api/utilities/sample-format.js.map +1 -1
  57. package/dist/api/utilities/streaming.d.ts +0 -8
  58. package/dist/api/utilities/streaming.js +0 -8
  59. package/dist/api/utilities/streaming.js.map +1 -1
  60. package/dist/api/utilities/timestamp.d.ts +0 -8
  61. package/dist/api/utilities/timestamp.js +0 -8
  62. package/dist/api/utilities/timestamp.js.map +1 -1
  63. package/dist/api/utils.d.ts +1 -2
  64. package/dist/api/utils.js +11 -0
  65. package/dist/api/utils.js.map +1 -1
  66. package/dist/constants/constants.d.ts +1 -1
  67. package/dist/constants/constants.js +2 -0
  68. package/dist/constants/constants.js.map +1 -1
  69. package/dist/lib/audio-fifo.d.ts +127 -170
  70. package/dist/lib/audio-fifo.js +130 -173
  71. package/dist/lib/audio-fifo.js.map +1 -1
  72. package/dist/lib/binding.d.ts +1 -0
  73. package/dist/lib/binding.js +7 -0
  74. package/dist/lib/binding.js.map +1 -1
  75. package/dist/lib/bitstream-filter-context.d.ts +139 -184
  76. package/dist/lib/bitstream-filter-context.js +139 -188
  77. package/dist/lib/bitstream-filter-context.js.map +1 -1
  78. package/dist/lib/bitstream-filter.d.ts +68 -54
  79. package/dist/lib/bitstream-filter.js +68 -54
  80. package/dist/lib/bitstream-filter.js.map +1 -1
  81. package/dist/lib/codec-context.d.ts +316 -380
  82. package/dist/lib/codec-context.js +316 -381
  83. package/dist/lib/codec-context.js.map +1 -1
  84. package/dist/lib/codec-parameters.d.ts +160 -170
  85. package/dist/lib/codec-parameters.js +162 -172
  86. package/dist/lib/codec-parameters.js.map +1 -1
  87. package/dist/lib/codec-parser.d.ts +91 -104
  88. package/dist/lib/codec-parser.js +92 -103
  89. package/dist/lib/codec-parser.js.map +1 -1
  90. package/dist/lib/codec.d.ts +266 -283
  91. package/dist/lib/codec.js +270 -287
  92. package/dist/lib/codec.js.map +1 -1
  93. package/dist/lib/dictionary.d.ts +149 -203
  94. package/dist/lib/dictionary.js +158 -212
  95. package/dist/lib/dictionary.js.map +1 -1
  96. package/dist/lib/error.d.ts +96 -130
  97. package/dist/lib/error.js +98 -128
  98. package/dist/lib/error.js.map +1 -1
  99. package/dist/lib/filter-context.d.ts +284 -218
  100. package/dist/lib/filter-context.js +290 -227
  101. package/dist/lib/filter-context.js.map +1 -1
  102. package/dist/lib/filter-graph.d.ts +251 -292
  103. package/dist/lib/filter-graph.js +253 -294
  104. package/dist/lib/filter-graph.js.map +1 -1
  105. package/dist/lib/filter-inout.d.ts +87 -95
  106. package/dist/lib/filter-inout.js +87 -95
  107. package/dist/lib/filter-inout.js.map +1 -1
  108. package/dist/lib/filter.d.ts +93 -111
  109. package/dist/lib/filter.js +93 -111
  110. package/dist/lib/filter.js.map +1 -1
  111. package/dist/lib/format-context.d.ts +320 -428
  112. package/dist/lib/format-context.js +313 -385
  113. package/dist/lib/format-context.js.map +1 -1
  114. package/dist/lib/frame.d.ts +262 -405
  115. package/dist/lib/frame.js +263 -408
  116. package/dist/lib/frame.js.map +1 -1
  117. package/dist/lib/hardware-device-context.d.ts +149 -203
  118. package/dist/lib/hardware-device-context.js +149 -203
  119. package/dist/lib/hardware-device-context.js.map +1 -1
  120. package/dist/lib/hardware-frames-context.d.ts +170 -180
  121. package/dist/lib/hardware-frames-context.js +171 -181
  122. package/dist/lib/hardware-frames-context.js.map +1 -1
  123. package/dist/lib/index.d.ts +3 -2
  124. package/dist/lib/index.js +3 -3
  125. package/dist/lib/index.js.map +1 -1
  126. package/dist/lib/input-format.d.ts +89 -117
  127. package/dist/lib/input-format.js +89 -117
  128. package/dist/lib/input-format.js.map +1 -1
  129. package/dist/lib/io-context.d.ts +209 -241
  130. package/dist/lib/io-context.js +220 -252
  131. package/dist/lib/io-context.js.map +1 -1
  132. package/dist/lib/log.d.ts +85 -119
  133. package/dist/lib/log.js +85 -122
  134. package/dist/lib/log.js.map +1 -1
  135. package/dist/lib/native-types.d.ts +118 -106
  136. package/dist/lib/native-types.js +0 -7
  137. package/dist/lib/native-types.js.map +1 -1
  138. package/dist/lib/option.d.ts +437 -218
  139. package/dist/lib/option.js +462 -226
  140. package/dist/lib/option.js.map +1 -1
  141. package/dist/lib/output-format.d.ts +77 -101
  142. package/dist/lib/output-format.js +77 -101
  143. package/dist/lib/output-format.js.map +1 -1
  144. package/dist/lib/packet.d.ts +172 -240
  145. package/dist/lib/packet.js +172 -241
  146. package/dist/lib/packet.js.map +1 -1
  147. package/dist/lib/rational.d.ts +0 -2
  148. package/dist/lib/rational.js +0 -2
  149. package/dist/lib/rational.js.map +1 -1
  150. package/dist/lib/software-resample-context.d.ts +241 -325
  151. package/dist/lib/software-resample-context.js +242 -326
  152. package/dist/lib/software-resample-context.js.map +1 -1
  153. package/dist/lib/software-scale-context.d.ts +129 -173
  154. package/dist/lib/software-scale-context.js +131 -175
  155. package/dist/lib/software-scale-context.js.map +1 -1
  156. package/dist/lib/stream.d.ts +87 -197
  157. package/dist/lib/stream.js +87 -197
  158. package/dist/lib/stream.js.map +1 -1
  159. package/dist/lib/utilities.d.ts +435 -181
  160. package/dist/lib/utilities.js +438 -182
  161. package/dist/lib/utilities.js.map +1 -1
  162. package/install/check.js +0 -1
  163. package/install/ffmpeg.js +0 -11
  164. package/package.json +25 -18
  165. package/release_notes.md +24 -59
  166. package/CHANGELOG.md +0 -8
@@ -1,501 +1,683 @@
1
- /**
2
- * Option - FFmpeg AVOption System Bindings
3
- *
4
- * Provides low-level access to FFmpeg's AVOption API for getting and setting
5
- * options on various FFmpeg objects (CodecContext, FormatContext, FilterContext, etc).
6
- *
7
- * The AVOption API is FFmpeg's unified system for runtime configuration,
8
- * allowing type-safe access to object properties with validation.
9
- *
10
- * @module lib/option
11
- */
12
1
  import { Dictionary } from './dictionary.js';
13
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';
14
3
  import type { OptionCapableObject } from './binding.js';
15
4
  import type { NativeOption } from './native-types.js';
16
5
  import type { ChannelLayout, IRational } from './types.js';
17
6
  /**
18
- * Low-level wrapper for a single AVOption.
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.
19
12
  *
20
- * Provides metadata about an option including its name, type, range, and default value.
21
- * Options are not created directly but retrieved through Option.next() or Option.find().
13
+ * Direct mapping to FFmpeg's AVOption.
22
14
  *
23
15
  * @example
24
16
  * ```typescript
25
- * const opt = Option.find(codecContext, 'bitrate');
26
- * if (opt) {
27
- * console.log(`Option ${opt.name}: ${opt.help}`);
28
- * console.log(`Type: ${opt.type}, Default: ${opt.defaultValue}`);
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}`);
29
27
  * }
30
28
  * ```
29
+ *
30
+ * @see [AVOption](https://ffmpeg.org/doxygen/trunk/structAVOption.html) - FFmpeg Doxygen
31
31
  */
32
32
  export declare class OptionInfo {
33
33
  private native;
34
- /** @internal */
34
+ /**
35
+ * @param native - The native option instance
36
+ * @internal
37
+ */
35
38
  constructor(native: NativeOption);
36
39
  /**
37
40
  * Option name.
38
41
  *
39
- * The key used to get/set this option.
42
+ * The name used to get/set this option.
43
+ *
44
+ * Direct mapping to AVOption->name.
40
45
  */
41
46
  get name(): string | null;
42
47
  /**
43
48
  * Option help text.
44
49
  *
45
- * Human-readable description of the option.
50
+ * Human-readable description of the option's purpose.
51
+ *
52
+ * Direct mapping to AVOption->help.
46
53
  */
47
54
  get help(): string | null;
48
55
  /**
49
56
  * Option type.
50
57
  *
51
- * Determines the data type and valid range of values.
58
+ * Data type of the option value (AV_OPT_TYPE_*).
59
+ *
60
+ * Direct mapping to AVOption->type.
52
61
  */
53
62
  get type(): AVOptionType;
54
63
  /**
55
64
  * Default value.
56
65
  *
57
- * The value used if not explicitly set.
66
+ * The default value for this option.
58
67
  * Type depends on the option type.
68
+ *
69
+ * Direct mapping to AVOption->default_val.
59
70
  */
60
71
  get defaultValue(): unknown;
61
72
  /**
62
73
  * Minimum value.
63
74
  *
64
- * For numeric types, the minimum allowed value.
75
+ * Minimum valid value for numeric options.
76
+ *
77
+ * Direct mapping to AVOption->min.
65
78
  */
66
79
  get min(): number;
67
80
  /**
68
81
  * Maximum value.
69
82
  *
70
- * For numeric types, the maximum allowed value.
83
+ * Maximum valid value for numeric options.
84
+ *
85
+ * Direct mapping to AVOption->max.
71
86
  */
72
87
  get max(): number;
73
88
  /**
74
89
  * Option flags.
75
90
  *
76
- * Bitfield of AV_OPT_FLAG_* values indicating option properties.
91
+ * Combination of AV_OPT_FLAG_* indicating option properties.
92
+ *
93
+ * Direct mapping to AVOption->flags.
77
94
  */
78
95
  get flags(): AVOptionFlag;
79
96
  /**
80
97
  * Option unit.
81
98
  *
82
- * For options that are part of a named group.
99
+ * Unit string for grouping related options.
100
+ *
101
+ * Direct mapping to AVOption->unit.
83
102
  */
84
103
  get unit(): string | null;
85
104
  /**
86
- * Get the native FFmpeg AVOption pointer.
105
+ * Get the underlying native Option object.
87
106
  *
88
- * @internal For use by other wrapper classes
89
- * @returns The underlying native option object
107
+ * @returns The native Option binding object
108
+ *
109
+ * @internal
90
110
  */
91
111
  getNative(): NativeOption;
92
112
  }
93
113
  /**
94
- * Low-level FFmpeg AVOption API.
114
+ * FFmpeg option management utilities.
95
115
  *
96
- * Provides static methods for accessing and modifying options on FFmpeg objects.
97
- * All methods work with native objects from the low-level API.
116
+ * Provides static methods for getting, setting, and querying options
117
+ * on FFmpeg objects that support the AVOption API. Handles type conversion
118
+ * and validation for various option types including strings, numbers,
119
+ * rationals, pixel formats, and more.
98
120
  *
99
- * Uses av_opt_* functions internally.
121
+ * Direct mapping to FFmpeg's AVOption API.
100
122
  *
101
123
  * @example
102
124
  * ```typescript
103
- * // Set codec bitrate
104
- * Option.setInt(codecContext, 'b', 2000000);
125
+ * import { Option, FFmpegError } from 'node-av';
126
+ * import { AV_OPT_SEARCH_CHILDREN, AV_PIX_FMT_YUV420P } from 'node-av/constants';
127
+ *
128
+ * // Set various option types
129
+ * let ret = Option.set(obj, 'preset', 'fast');
130
+ * FFmpegError.throwIfError(ret, 'set preset');
105
131
  *
106
- * // Get current bitrate
107
- * const bitrate = Option.getInt(codecContext, 'b');
132
+ * ret = Option.setInt(obj, 'bitrate', 2000000);
133
+ * FFmpegError.throwIfError(ret, 'set bitrate');
108
134
  *
109
- * // Iterate through all options
135
+ * ret = Option.setRational(obj, 'framerate', { num: 30, den: 1 });
136
+ * FFmpegError.throwIfError(ret, 'set framerate');
137
+ *
138
+ * // Get option values
139
+ * const preset = Option.get(obj, 'preset');
140
+ * const bitrate = Option.getInt(obj, 'bitrate');
141
+ * const framerate = Option.getRational(obj, 'framerate');
142
+ *
143
+ * // List all options
110
144
  * let opt = null;
111
- * while ((opt = Option.next(codecContext, opt))) {
145
+ * while ((opt = Option.next(obj, opt))) {
112
146
  * console.log(`${opt.name}: ${opt.help}`);
113
147
  * }
114
148
  * ```
149
+ *
150
+ * @see [AVOption API](https://ffmpeg.org/doxygen/trunk/group__avoptions.html) - FFmpeg Doxygen
151
+ * @see {@link OptionMember} For inherited option support
115
152
  */
116
153
  export declare class Option {
117
- private constructor();
118
154
  /**
119
- * Iterate through options of an object.
155
+ * Iterate to next option.
120
156
  *
121
- * Uses av_opt_next() internally.
157
+ * Iterates through available options on an object.
122
158
  *
123
- * @param obj - Native object (CodecContext, FormatContext, FilterContext, etc.)
124
- * @param prev - Previous option for iteration, or null to start
159
+ * Direct mapping to av_opt_next().
125
160
  *
126
- * @returns Next option or null when done
161
+ * @param obj - Object with options
162
+ * @param prev - Previous option (null to get first)
163
+ * @returns Next option, or null if no more
127
164
  *
128
165
  * @example
129
166
  * ```typescript
130
167
  * let opt = null;
131
- * while ((opt = Option.next(codecContext, opt))) {
132
- * console.log(`${opt.name}: ${opt.help}`);
168
+ * while ((opt = Option.next(obj, opt))) {
169
+ * console.log(`Option: ${opt.name}`);
133
170
  * }
134
171
  * ```
135
172
  */
136
173
  static next(obj: OptionCapableObject, prev?: OptionInfo | null): OptionInfo | null;
137
174
  /**
138
- * Find an option by name.
175
+ * Find option by name.
139
176
  *
140
- * Uses av_opt_find() internally.
177
+ * Searches for an option with the specified name.
141
178
  *
142
- * @param obj - Native object
143
- * @param name - Option name to find
144
- * @param searchFlags - Search flags (default: 0)
179
+ * Direct mapping to av_opt_find().
145
180
  *
146
- * @returns Found option or null
181
+ * @param obj - Object to search
182
+ * @param name - Option name
183
+ * @param searchFlags - Search flags
184
+ * @returns Option info if found, null otherwise
147
185
  *
148
186
  * @example
149
187
  * ```typescript
150
- * const opt = Option.find(codecContext, 'bitrate');
188
+ * const opt = Option.find(obj, 'bitrate');
151
189
  * if (opt) {
152
- * console.log(`Found option: ${opt.name}`);
190
+ * console.log(`Found: ${opt.name}, Type: ${opt.type}`);
153
191
  * }
154
192
  * ```
155
193
  */
156
194
  static find(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): OptionInfo | null;
157
195
  /**
158
- * Find an option by name with target object information.
196
+ * Find option with target info.
197
+ *
198
+ * Like find() but also indicates if option was found on different target.
159
199
  *
160
- * Uses av_opt_find2() internally.
200
+ * Direct mapping to av_opt_find2().
161
201
  *
162
- * @param obj - Native object
163
- * @param name - Option name to find
164
- * @param searchFlags - Search flags (default: 0)
202
+ * @param obj - Object to search
203
+ * @param name - Option name
204
+ * @param searchFlags - Search flags
205
+ * @returns Object with option and target info
165
206
  *
166
- * @returns Object with option and whether target differs, or null
207
+ * @example
208
+ * ```typescript
209
+ * const result = Option.find2(obj, 'bitrate', AV_OPT_SEARCH_CHILDREN);
210
+ * if (result?.option) {
211
+ * console.log(`Found on ${result.isDifferentTarget ? 'child' : 'object'}`);
212
+ * }
213
+ * ```
167
214
  */
168
215
  static find2(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): {
169
216
  option: OptionInfo | null;
170
217
  isDifferentTarget: boolean;
171
218
  } | null;
172
219
  /**
173
- * Get option value as string.
220
+ * Get string option value.
174
221
  *
175
- * Uses av_opt_get() internally.
176
- * Converts any option type to its string representation.
222
+ * Direct mapping to av_opt_get().
177
223
  *
178
- * @param obj - Native object
224
+ * @param obj - Object to query
179
225
  * @param name - Option name
180
- * @param searchFlags - Search flags (default: 0)
226
+ * @param searchFlags - Search flags
227
+ * @returns Option value as string, or null
181
228
  *
182
- * @returns Value string on success, null if option not found or on error
229
+ * @example
230
+ * ```typescript
231
+ * // Get codec preset option
232
+ * const preset = Option.get(codecContext, 'preset', AV_OPT_SEARCH_CHILDREN);
233
+ * console.log('Codec preset:', preset); // 'medium', 'fast', etc.
234
+ * ```
183
235
  */
184
236
  static get(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): string | null;
185
237
  /**
186
- * Get option value as integer.
238
+ * Get integer option value.
187
239
  *
188
- * Uses av_opt_get_int() internally.
189
- * Option must be of integer type.
240
+ * Direct mapping to av_opt_get_int().
190
241
  *
191
- * @param obj - Native object
242
+ * @param obj - Object to query
192
243
  * @param name - Option name
193
- * @param searchFlags - Search flags (default: 0)
244
+ * @param searchFlags - Search flags
245
+ * @returns Option value as integer, or null
194
246
  *
195
- * @returns Integer value on success, null if option not found or on error
247
+ * @example
248
+ * ```typescript
249
+ * // Get codec GOP size
250
+ * const gopSize = Option.getInt(codecContext, 'g', AV_OPT_SEARCH_CHILDREN);
251
+ * console.log('GOP size:', gopSize); // 60, 120, etc.
252
+ * ```
196
253
  */
197
254
  static getInt(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): number | null;
198
255
  /**
199
- * Get option value as double.
256
+ * Get double option value.
200
257
  *
201
- * Uses av_opt_get_double() internally.
202
- * Option must be of double/float type.
258
+ * Direct mapping to av_opt_get_double().
203
259
  *
204
- * @param obj - Native object
260
+ * @param obj - Object to query
205
261
  * @param name - Option name
206
- * @param searchFlags - Search flags (default: 0)
262
+ * @param searchFlags - Search flags
263
+ * @returns Option value as double, or null
207
264
  *
208
- * @returns Double value on success, null if option not found or on error
265
+ * @example
266
+ * ```typescript
267
+ * // Get codec quality scale
268
+ * const crf = Option.getDouble(codecContext, 'crf', AV_OPT_SEARCH_CHILDREN);
269
+ * console.log('CRF value:', crf); // 23.0, 18.0, etc.
270
+ * ```
209
271
  */
210
272
  static getDouble(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): number | null;
211
273
  /**
212
- * Get option value as rational.
274
+ * Get rational option value.
213
275
  *
214
- * Uses av_opt_get_q() internally.
215
- * Option must be of rational type.
276
+ * Direct mapping to av_opt_get_q().
216
277
  *
217
- * @param obj - Native object
278
+ * @param obj - Object to query
218
279
  * @param name - Option name
219
- * @param searchFlags - Search flags (default: 0)
280
+ * @param searchFlags - Search flags
281
+ * @returns Option value as rational, or null
220
282
  *
221
- * @returns Rational object {num, den} on success, null if option not found or on error
283
+ * @example
284
+ * ```typescript
285
+ * // Get codec time base
286
+ * const timeBase = Option.getRational(codecContext, 'time_base', AV_OPT_SEARCH_CHILDREN);
287
+ * console.log('Time base:', timeBase); // { num: 1, den: 30 }
288
+ * ```
222
289
  */
223
290
  static getRational(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): IRational | null;
224
291
  /**
225
- * Get option value as pixel format.
292
+ * Get pixel format option value.
226
293
  *
227
- * Uses av_opt_get_pixel_fmt() internally.
228
- * Option must be of pixel format type.
294
+ * Direct mapping to av_opt_get_pixel_fmt().
229
295
  *
230
- * @param obj - Native object
296
+ * @param obj - Object to query
231
297
  * @param name - Option name
232
- * @param searchFlags - Search flags (default: 0)
298
+ * @param searchFlags - Search flags
299
+ * @returns Pixel format value, or null
233
300
  *
234
- * @returns AVPixelFormat enum value on success, null if option not found or on error
301
+ * @example
302
+ * ```typescript
303
+ * // Get filter pixel format
304
+ * const pixFmt = Option.getPixelFormat(filterContext, 'pix_fmt', AV_OPT_SEARCH_CHILDREN);
305
+ * console.log('Pixel format:', pixFmt); // AV_PIX_FMT_YUV420P, etc.
306
+ * ```
235
307
  */
236
308
  static getPixelFormat(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): AVPixelFormat | null;
237
309
  /**
238
- * Get option value as sample format.
310
+ * Get sample format option value.
239
311
  *
240
- * Uses av_opt_get_sample_fmt() internally.
241
- * Option must be of sample format type.
312
+ * Direct mapping to av_opt_get_sample_fmt().
242
313
  *
243
- * @param obj - Native object
314
+ * @param obj - Object to query
244
315
  * @param name - Option name
245
- * @param searchFlags - Search flags (default: 0)
316
+ * @param searchFlags - Search flags
317
+ * @returns Sample format value, or null
246
318
  *
247
- * @returns AVSampleFormat enum value on success, null if option not found or on error
319
+ * @example
320
+ * ```typescript
321
+ * // Get audio codec sample format
322
+ * const sampleFmt = Option.getSampleFormat(codecContext, 'sample_fmt', AV_OPT_SEARCH_CHILDREN);
323
+ * console.log('Sample format:', sampleFmt); // AV_SAMPLE_FMT_FLTP, etc.
324
+ * ```
248
325
  */
249
326
  static getSampleFormat(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): AVSampleFormat | null;
250
327
  /**
251
- * Get option value as image size.
328
+ * Get image size option value.
252
329
  *
253
- * Uses av_opt_get_image_size() internally.
254
- * Option must be of image size type.
330
+ * Direct mapping to av_opt_get_image_size().
255
331
  *
256
- * @param obj - Native object
332
+ * @param obj - Object to query
257
333
  * @param name - Option name
258
- * @param searchFlags - Search flags (default: 0)
334
+ * @param searchFlags - Search flags
335
+ * @returns Width and height, or null
259
336
  *
260
- * @returns Size object {width, height} on success, null if option not found or on error
337
+ * @example
338
+ * ```typescript
339
+ * // Get filter output size
340
+ * const size = Option.getImageSize(filterContext, 'size', AV_OPT_SEARCH_CHILDREN);
341
+ * console.log('Output size:', size); // { width: 1920, height: 1080 }
342
+ * ```
261
343
  */
262
344
  static getImageSize(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): {
263
345
  width: number;
264
346
  height: number;
265
347
  } | null;
266
348
  /**
267
- * Get option value as channel layout.
349
+ * Get channel layout option value.
268
350
  *
269
- * Uses av_opt_get_chlayout() internally.
270
- * Option must be of channel layout type.
351
+ * Direct mapping to av_opt_get_chlayout().
271
352
  *
272
- * @param obj - Native object
353
+ * @param obj - Object to query
273
354
  * @param name - Option name
274
- * @param searchFlags - Search flags (default: 0)
355
+ * @param searchFlags - Search flags
356
+ * @returns Channel layout, or null
275
357
  *
276
- * @returns ChannelLayout object on success, null if option not found or on error
358
+ * @example
359
+ * ```typescript
360
+ * // Get audio channel layout
361
+ * const layout = Option.getChannelLayout(codecContext, 'channel_layout', AV_OPT_SEARCH_CHILDREN);
362
+ * console.log('Channel layout:', layout); // stereo, 5.1, etc.
363
+ * ```
277
364
  */
278
365
  static getChannelLayout(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): ChannelLayout | null;
279
366
  /**
280
- * Get option value as dictionary.
367
+ * Get dictionary option value.
281
368
  *
282
- * Uses av_opt_get_dict_val() internally.
283
- * Option must be of dictionary type.
369
+ * Direct mapping to av_opt_get_dict_val().
284
370
  *
285
- * @param obj - Native object
371
+ * @param obj - Object to query
286
372
  * @param name - Option name
287
- * @param searchFlags - Search flags (default: 0)
373
+ * @param searchFlags - Search flags
374
+ * @returns Dictionary value, or null
288
375
  *
289
- * @returns Dictionary object on success, null if option not found or on error
376
+ * @example
377
+ * ```typescript
378
+ * // Get metadata dictionary
379
+ * const metadata = Option.getDict(formatContext, 'metadata', AV_OPT_SEARCH_CHILDREN);
380
+ * console.log('Metadata:', metadata?.get('title'));
381
+ * ```
290
382
  */
291
383
  static getDict(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): Dictionary | null;
292
384
  /**
293
- * Set option value from string.
385
+ * Set string option value.
294
386
  *
295
- * Uses av_opt_set() internally.
296
- * Can be used for any option type - FFmpeg will parse the string.
387
+ * Direct mapping to av_opt_set().
297
388
  *
298
- * @param obj - Native object
389
+ * @param obj - Object to modify
299
390
  * @param name - Option name
300
- * @param value - String value to set
301
- * @param searchFlags - Search flags (default: 0)
391
+ * @param value - String value
392
+ * @param searchFlags - Search flags
393
+ * @returns 0 on success, negative AVERROR on error
302
394
  *
303
- * @returns 0 on success, negative AVERROR code on failure
395
+ * @example
396
+ * ```typescript
397
+ * // Set codec preset
398
+ * const ret = Option.set(codecContext, 'preset', 'fast', AV_OPT_SEARCH_CHILDREN);
399
+ * FFmpegError.throwIfError(ret, 'Failed to set preset');
400
+ * ```
304
401
  */
305
402
  static set(obj: OptionCapableObject, name: string, value: string, searchFlags?: AVOptionSearchFlags): number;
306
403
  /**
307
- * Set option value as integer.
404
+ * Set integer option value.
308
405
  *
309
- * Uses av_opt_set_int() internally.
310
- * More efficient than set() for numeric options.
406
+ * Direct mapping to av_opt_set_int().
311
407
  *
312
- * @param obj - Native object
408
+ * @param obj - Object to modify
313
409
  * @param name - Option name
314
- * @param value - Number or BigInt value to set
315
- * @param searchFlags - Search flags (default: 0)
410
+ * @param value - Integer value
411
+ * @param searchFlags - Search flags
412
+ * @returns 0 on success, negative AVERROR on error
316
413
  *
317
- * @returns 0 on success, negative AVERROR code on failure
414
+ * @example
415
+ * ```typescript
416
+ * // Set codec bitrate
417
+ * const ret = Option.setInt(codecContext, 'b', 2000000, AV_OPT_SEARCH_CHILDREN);
418
+ * FFmpegError.throwIfError(ret, 'Failed to set bitrate');
419
+ * ```
318
420
  */
319
421
  static setInt(obj: OptionCapableObject, name: string, value: number | bigint, searchFlags?: AVOptionSearchFlags): number;
320
422
  /**
321
- * Set option value as double.
423
+ * Set double option value.
322
424
  *
323
- * Uses av_opt_set_double() internally.
324
- * More efficient than set() for floating point options.
425
+ * Direct mapping to av_opt_set_double().
325
426
  *
326
- * @param obj - Native object
427
+ * @param obj - Object to modify
327
428
  * @param name - Option name
328
- * @param value - Double value to set
329
- * @param searchFlags - Search flags (default: 0)
429
+ * @param value - Double value
430
+ * @param searchFlags - Search flags
431
+ * @returns 0 on success, negative AVERROR on error
330
432
  *
331
- * @returns 0 on success, negative AVERROR code on failure
433
+ * @example
434
+ * ```typescript
435
+ * // Set codec CRF value
436
+ * const ret = Option.setDouble(codecContext, 'crf', 23.0, AV_OPT_SEARCH_CHILDREN);
437
+ * FFmpegError.throwIfError(ret, 'Failed to set CRF');
438
+ * ```
332
439
  */
333
440
  static setDouble(obj: OptionCapableObject, name: string, value: number, searchFlags?: AVOptionSearchFlags): number;
334
441
  /**
335
- * Set option value as rational.
442
+ * Set rational option value.
336
443
  *
337
- * Uses av_opt_set_q() internally.
338
- * For framerates, aspect ratios, time bases, etc.
444
+ * Direct mapping to av_opt_set_q().
339
445
  *
340
- * @param obj - Native object
446
+ * @param obj - Object to modify
341
447
  * @param name - Option name
342
- * @param value - Rational object {num, den} to set
343
- * @param searchFlags - Search flags (default: 0)
448
+ * @param value - Rational value
449
+ * @param searchFlags - Search flags
450
+ * @returns 0 on success, negative AVERROR on error
344
451
  *
345
- * @returns 0 on success, negative AVERROR code on failure
452
+ * @example
453
+ * ```typescript
454
+ * // Set codec frame rate
455
+ * const ret = Option.setRational(codecContext, 'framerate', { num: 30, den: 1 }, AV_OPT_SEARCH_CHILDREN);
456
+ * FFmpegError.throwIfError(ret, 'Failed to set framerate');
457
+ * ```
346
458
  */
347
459
  static setRational(obj: OptionCapableObject, name: string, value: IRational, searchFlags?: AVOptionSearchFlags): number;
348
460
  /**
349
- * Set option value as pixel format.
461
+ * Set pixel format option value.
350
462
  *
351
- * Uses av_opt_set_pixel_fmt() internally.
352
- * More type-safe than using set() with string names.
463
+ * Direct mapping to av_opt_set_pixel_fmt().
353
464
  *
354
- * @param obj - Native object
465
+ * @param obj - Object to modify
355
466
  * @param name - Option name
356
- * @param value - AVPixelFormat enum value
357
- * @param searchFlags - Search flags (default: 0)
467
+ * @param value - Pixel format
468
+ * @param searchFlags - Search flags
469
+ * @returns 0 on success, negative AVERROR on error
358
470
  *
359
- * @returns 0 on success, negative AVERROR code on failure
471
+ * @example
472
+ * ```typescript
473
+ * // Set filter pixel format
474
+ * const ret = Option.setPixelFormat(filterContext, 'pix_fmt', AV_PIX_FMT_YUV420P, AV_OPT_SEARCH_CHILDREN);
475
+ * FFmpegError.throwIfError(ret, 'Failed to set pixel format');
476
+ * ```
360
477
  */
361
478
  static setPixelFormat(obj: OptionCapableObject, name: string, value: AVPixelFormat, searchFlags?: AVOptionSearchFlags): number;
362
479
  /**
363
- * Set option value as sample format.
480
+ * Set sample format option value.
364
481
  *
365
- * Uses av_opt_set_sample_fmt() internally.
366
- * More type-safe than using set() with string names.
482
+ * Direct mapping to av_opt_set_sample_fmt().
367
483
  *
368
- * @param obj - Native object
484
+ * @param obj - Object to modify
369
485
  * @param name - Option name
370
- * @param value - AVSampleFormat enum value
371
- * @param searchFlags - Search flags (default: 0)
486
+ * @param value - Sample format
487
+ * @param searchFlags - Search flags
488
+ * @returns 0 on success, negative AVERROR on error
372
489
  *
373
- * @returns 0 on success, negative AVERROR code on failure
490
+ * @example
491
+ * ```typescript
492
+ * // Set audio codec sample format
493
+ * const ret = Option.setSampleFormat(codecContext, 'sample_fmt', AV_SAMPLE_FMT_FLTP, AV_OPT_SEARCH_CHILDREN);
494
+ * FFmpegError.throwIfError(ret, 'Failed to set sample format');
495
+ * ```
374
496
  */
375
497
  static setSampleFormat(obj: OptionCapableObject, name: string, value: AVSampleFormat, searchFlags?: AVOptionSearchFlags): number;
376
498
  /**
377
- * Set option value as image size.
499
+ * Set image size option value.
378
500
  *
379
- * Uses av_opt_set_image_size() internally.
380
- * Convenient for setting width and height together.
501
+ * Direct mapping to av_opt_set_image_size().
381
502
  *
382
- * @param obj - Native object
503
+ * @param obj - Object to modify
383
504
  * @param name - Option name
384
- * @param width - Width in pixels
385
- * @param height - Height in pixels
386
- * @param searchFlags - Search flags (default: 0)
505
+ * @param width - Image width
506
+ * @param height - Image height
507
+ * @param searchFlags - Search flags
508
+ * @returns 0 on success, negative AVERROR on error
387
509
  *
388
- * @returns 0 on success, negative AVERROR code on failure
510
+ * @example
511
+ * ```typescript
512
+ * // Set filter output size
513
+ * const ret = Option.setImageSize(filterContext, 'size', 1920, 1080, AV_OPT_SEARCH_CHILDREN);
514
+ * FFmpegError.throwIfError(ret, 'Failed to set image size');
515
+ * ```
389
516
  */
390
517
  static setImageSize(obj: OptionCapableObject, name: string, width: number, height: number, searchFlags?: AVOptionSearchFlags): number;
391
518
  /**
392
- * Set option value as channel layout.
519
+ * Set channel layout option value.
393
520
  *
394
- * Uses av_opt_set_chlayout() internally.
395
- * For audio channel configuration.
521
+ * Direct mapping to av_opt_set_chlayout().
396
522
  *
397
- * @param obj - Native object
523
+ * @param obj - Object to modify
398
524
  * @param name - Option name
399
- * @param value - Channel layout mask (e.g., AV_CH_LAYOUT_STEREO)
400
- * @param searchFlags - Search flags (default: 0)
525
+ * @param value - Channel layout
526
+ * @param searchFlags - Search flags
527
+ * @returns 0 on success, negative AVERROR on error
401
528
  *
402
- * @returns 0 on success, negative AVERROR code on failure
529
+ * @example
530
+ * ```typescript
531
+ * // Set audio channel layout to stereo
532
+ * const ret = Option.setChannelLayout(codecContext, 'channel_layout', AV_CHANNEL_LAYOUT_STEREO, AV_OPT_SEARCH_CHILDREN);
533
+ * FFmpegError.throwIfError(ret, 'Failed to set channel layout');
534
+ * ```
403
535
  */
404
536
  static setChannelLayout(obj: OptionCapableObject, name: string, value: number, searchFlags?: AVOptionSearchFlags): number;
405
537
  /**
406
- * Set option value as dictionary.
538
+ * Set dictionary option value.
407
539
  *
408
- * Uses av_opt_set_dict_val() internally.
409
- * For options that accept key-value pairs.
540
+ * Direct mapping to av_opt_set_dict_val().
410
541
  *
411
- * @param obj - Native object
542
+ * @param obj - Object to modify
412
543
  * @param name - Option name
413
- * @param value - Dictionary object
414
- * @param searchFlags - Search flags (default: 0)
544
+ * @param value - Dictionary value
545
+ * @param searchFlags - Search flags
546
+ * @returns 0 on success, negative AVERROR on error
415
547
  *
416
- * @returns 0 on success, negative AVERROR code on failure
548
+ * @example
549
+ * ```typescript
550
+ * // Set metadata dictionary
551
+ * const dict = new Dictionary();
552
+ * dict.set('title', 'My Video');
553
+ * const ret = Option.setDict(formatContext, 'metadata', dict, AV_OPT_SEARCH_CHILDREN);
554
+ * FFmpegError.throwIfError(ret, 'Failed to set metadata');
555
+ * ```
417
556
  */
418
557
  static setDict(obj: OptionCapableObject, name: string, value: Dictionary, searchFlags?: AVOptionSearchFlags): number;
419
558
  /**
420
- * Set option value as binary data.
559
+ * Set binary option value.
421
560
  *
422
- * Uses av_opt_set_bin() internally.
423
- * For options that accept raw binary data.
561
+ * Direct mapping to av_opt_set_bin().
424
562
  *
425
- * @param obj - Native object
563
+ * @param obj - Object to modify
426
564
  * @param name - Option name
427
- * @param value - Binary data as Buffer
428
- * @param searchFlags - Search flags (default: 0)
565
+ * @param value - Binary data
566
+ * @param searchFlags - Search flags
567
+ * @returns 0 on success, negative AVERROR on error
429
568
  *
430
- * @returns 0 on success, negative AVERROR code on failure
569
+ * @example
570
+ * ```typescript
571
+ * // Set binary extradata
572
+ * const extradata = Buffer.from([0x00, 0x01, 0x02, 0x03]);
573
+ * const ret = Option.setBin(codecContext, 'extradata', extradata, AV_OPT_SEARCH_CHILDREN);
574
+ * FFmpegError.throwIfError(ret, 'Failed to set extradata');
575
+ * ```
431
576
  */
432
577
  static setBin(obj: OptionCapableObject, name: string, value: Buffer, searchFlags?: AVOptionSearchFlags): number;
433
578
  /**
434
- * Set all options to their default values.
579
+ * Set defaults on object.
580
+ *
581
+ * Sets all options to their default values.
435
582
  *
436
- * Uses av_opt_set_defaults() internally.
583
+ * Direct mapping to av_opt_set_defaults().
437
584
  *
438
- * @param obj - Native object
585
+ * @param obj - Object to reset
586
+ *
587
+ * @example
588
+ * ```typescript
589
+ * // Reset all codec options to defaults
590
+ * Option.setDefaults(codecContext);
591
+ * ```
439
592
  */
440
593
  static setDefaults(obj: OptionCapableObject): void;
441
594
  /**
442
- * Copy options from source to destination.
595
+ * Copy options between objects.
596
+ *
597
+ * Copies option values from source to destination.
443
598
  *
444
- * Uses av_opt_copy() internally.
445
- * Copies all option values from one object to another.
599
+ * Direct mapping to av_opt_copy().
446
600
  *
447
601
  * @param dest - Destination object
448
602
  * @param src - Source object
603
+ * @returns 0 on success, negative AVERROR on error
449
604
  *
450
- * @returns 0 on success, negative AVERROR code on failure
605
+ * @example
606
+ * ```typescript
607
+ * // Copy options from one codec context to another
608
+ * const ret = Option.copy(destCodecContext, srcCodecContext);
609
+ * FFmpegError.throwIfError(ret, 'Failed to copy options');
610
+ * ```
451
611
  */
452
612
  static copy(dest: OptionCapableObject, src: OptionCapableObject): number;
453
613
  /**
454
- * Check if option is set to its default value.
614
+ * Check if option is set to default.
455
615
  *
456
- * Uses av_opt_is_set_to_default_by_name() internally.
616
+ * Direct mapping to av_opt_is_set_to_default().
457
617
  *
458
- * @param obj - Native object
618
+ * @param obj - Object to check
459
619
  * @param name - Option name
460
- * @param searchFlags - Search flags (default: 0)
620
+ * @param searchFlags - Search flags
621
+ * @returns True if default, false if modified, null if not found
461
622
  *
462
- * @returns true if set to default, false if not, null if option not found or on error
623
+ * @example
624
+ * ```typescript
625
+ * // Check if bitrate is at default value
626
+ * const isDefault = Option.isSetToDefault(codecContext, 'b', AV_OPT_SEARCH_CHILDREN);
627
+ * console.log('Bitrate is default:', isDefault);
628
+ * ```
463
629
  */
464
630
  static isSetToDefault(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): boolean | null;
465
631
  /**
466
632
  * Serialize options to string.
467
633
  *
468
- * Uses av_opt_serialize() internally.
469
- * Converts all non-default options to a string representation.
634
+ * Direct mapping to av_opt_serialize().
470
635
  *
471
- * @param obj - Native object
472
- * @param optFlags - Option flags to include (default: 0)
473
- * @param flags - Serialization flags (default: 0)
474
- * @param keyValSep - Key-value separator (default: '=')
475
- * @param pairsSep - Pairs separator (default: ',')
636
+ * @param obj - Object to serialize
637
+ * @param optFlags - Option flags filter
638
+ * @param flags - Serialization flags
639
+ * @param keyValSep - Key-value separator
640
+ * @param pairsSep - Pairs separator
641
+ * @returns Serialized string, or null on error
476
642
  *
477
- * @returns Serialized string on success, null on error or if no options to serialize
643
+ * @example
644
+ * ```typescript
645
+ * // Serialize codec options to string
646
+ * const serialized = Option.serialize(codecContext, 0, 0, '=', ':');
647
+ * console.log('Options:', serialized); // 'bitrate=2000000:preset=fast'
648
+ * ```
478
649
  */
479
650
  static serialize(obj: OptionCapableObject, optFlags?: number, flags?: number, keyValSep?: string, pairsSep?: string): string | null;
480
651
  /**
481
- * Free options of an object.
652
+ * Free option resources.
653
+ *
654
+ * Direct mapping to av_opt_free().
482
655
  *
483
- * Uses av_opt_free() internally.
656
+ * @param obj - Object to free options from
484
657
  *
485
- * @param obj - Native object
658
+ * @example
659
+ * ```typescript
660
+ * // Free codec context options
661
+ * Option.free(codecContext);
662
+ * ```
486
663
  */
487
664
  static free(obj: OptionCapableObject): void;
488
665
  /**
489
- * Show options to stderr for debugging.
666
+ * Show options for debugging.
490
667
  *
491
- * Uses av_opt_show2() internally.
492
- * Prints all available options to stderr.
668
+ * Direct mapping to av_opt_show2().
493
669
  *
494
- * @param obj - Native object
495
- * @param reqFlags - Required flags (default: 0)
496
- * @param rejFlags - Rejected flags (default: 0)
670
+ * @param obj - Object to show options for
671
+ * @param reqFlags - Required flags
672
+ * @param rejFlags - Rejected flags
673
+ * @returns 0 on success, negative AVERROR on error
497
674
  *
498
- * @returns 0 on success, negative AVERROR code on failure
675
+ * @example
676
+ * ```typescript
677
+ * // Show all codec options for debugging
678
+ * const ret = Option.show(codecContext, 0, 0);
679
+ * FFmpegError.throwIfError(ret, 'Failed to show options');
680
+ * ```
499
681
  */
500
682
  static show(obj: OptionCapableObject, reqFlags?: number, rejFlags?: number): number;
501
683
  }
@@ -513,10 +695,42 @@ export declare class Option {
513
695
  *
514
696
  * @example
515
697
  * ```typescript
698
+ * import { OptionMember, FFmpegError } from 'node-av';
699
+ * import { AV_OPT_TYPE_INT, AV_OPT_TYPE_STRING, AV_OPT_TYPE_RATIONAL } from 'node-av/constants';
700
+ *
516
701
  * class CodecContext extends OptionMember<NativeCodecContext> {
517
- * // Inherits setOption, getOption, listOptions
702
+ * constructor(native: NativeCodecContext) {
703
+ * super(native);
704
+ * }
705
+ * }
706
+ *
707
+ * // Use inherited methods
708
+ * const codec = new CodecContext(native);
709
+ *
710
+ * // Set options with automatic type handling
711
+ * let ret = codec.setOption('preset', 'fast');
712
+ * FFmpegError.throwIfError(ret, 'set preset');
713
+ *
714
+ * ret = codec.setOption('bitrate', 2000000, AV_OPT_TYPE_INT);
715
+ * FFmpegError.throwIfError(ret, 'set bitrate');
716
+ *
717
+ * ret = codec.setOption('framerate', { num: 30, den: 1 }, AV_OPT_TYPE_RATIONAL);
718
+ * FFmpegError.throwIfError(ret, 'set framerate');
719
+ *
720
+ * // Get typed options
721
+ * const preset = codec.getOption('preset');
722
+ * const bitrate = codec.getOption('bitrate', AV_OPT_TYPE_INT);
723
+ * const framerate = codec.getOption('framerate', AV_OPT_TYPE_RATIONAL);
724
+ *
725
+ * // List all available options
726
+ * const options = codec.listOptions();
727
+ * for (const opt of options) {
728
+ * console.log(`${opt.name}: ${opt.help}`);
518
729
  * }
519
730
  * ```
731
+ *
732
+ * @see {@link Option} For static option methods
733
+ * @see {@link OptionInfo} For option metadata
520
734
  */
521
735
  export declare class OptionMember<T extends OptionCapableObject> {
522
736
  protected native: T;
@@ -574,6 +788,8 @@ export declare class OptionMember<T extends OptionCapableObject> {
574
788
  * Uses the AVOption API to enumerate all options.
575
789
  * Useful for discovering available settings and their types.
576
790
  *
791
+ * Direct mapping to av_opt_next() iteration.
792
+ *
577
793
  * @returns Array of option information objects
578
794
  *
579
795
  * @example
@@ -582,8 +798,11 @@ export declare class OptionMember<T extends OptionCapableObject> {
582
798
  * for (const opt of options) {
583
799
  * console.log(`${opt.name}: ${opt.help}`);
584
800
  * console.log(` Type: ${opt.type}, Default: ${opt.defaultValue}`);
801
+ * console.log(` Range: ${opt.min} - ${opt.max}`);
585
802
  * }
586
803
  * ```
804
+ *
805
+ * @see {@link OptionInfo} For option metadata structure
587
806
  */
588
807
  listOptions(): OptionInfo[];
589
808
  }