node-av 1.0.3 → 1.2.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.
- package/README.md +56 -41
- package/dist/api/bitstream-filter.d.ts +180 -123
- package/dist/api/bitstream-filter.js +182 -126
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +286 -130
- package/dist/api/decoder.js +321 -159
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +254 -158
- package/dist/api/encoder.js +326 -298
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +912 -0
- package/dist/api/filter-presets.js +1407 -0
- package/dist/api/filter-presets.js.map +1 -0
- package/dist/api/filter.d.ts +280 -284
- package/dist/api/filter.js +435 -509
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +226 -159
- package/dist/api/hardware.js +405 -287
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/index.d.ts +3 -2
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.d.ts +65 -61
- package/dist/api/io-stream.js +45 -47
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/media-input.d.ts +244 -141
- package/dist/api/media-input.js +207 -104
- package/dist/api/media-input.js.map +1 -1
- package/dist/api/media-output.d.ts +206 -128
- package/dist/api/media-output.js +212 -129
- package/dist/api/media-output.js.map +1 -1
- package/dist/api/pipeline.d.ts +168 -38
- package/dist/api/pipeline.js +238 -14
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/types.d.ts +22 -182
- package/dist/api/utilities/audio-sample.d.ts +1 -1
- package/dist/api/utilities/image.d.ts +1 -1
- package/dist/api/utilities/media-type.d.ts +1 -1
- package/dist/api/utilities/pixel-format.d.ts +1 -1
- package/dist/api/utilities/sample-format.d.ts +1 -1
- package/dist/api/utilities/timestamp.d.ts +1 -1
- package/dist/api/utils.d.ts +1 -2
- package/dist/api/utils.js +9 -0
- package/dist/api/utils.js.map +1 -1
- package/dist/{lib → constants}/channel-layouts.d.ts +1 -1
- package/dist/constants/channel-layouts.js.map +1 -0
- package/dist/{lib → constants}/constants.d.ts +19 -4
- package/dist/{lib → constants}/constants.js +15 -1
- package/dist/constants/constants.js.map +1 -0
- package/dist/constants/decoders.d.ts +609 -0
- package/dist/constants/decoders.js +617 -0
- package/dist/constants/decoders.js.map +1 -0
- package/dist/constants/encoders.d.ts +285 -0
- package/dist/constants/encoders.js +298 -0
- package/dist/constants/encoders.js.map +1 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/audio-fifo.d.ts +128 -171
- package/dist/lib/audio-fifo.js +130 -173
- package/dist/lib/audio-fifo.js.map +1 -1
- package/dist/lib/binding.d.ts +7 -5
- package/dist/lib/binding.js +5 -0
- package/dist/lib/binding.js.map +1 -1
- package/dist/lib/bitstream-filter-context.d.ts +139 -184
- package/dist/lib/bitstream-filter-context.js +139 -188
- package/dist/lib/bitstream-filter-context.js.map +1 -1
- package/dist/lib/bitstream-filter.d.ts +69 -55
- package/dist/lib/bitstream-filter.js +68 -54
- package/dist/lib/bitstream-filter.js.map +1 -1
- package/dist/lib/codec-context.d.ts +317 -381
- package/dist/lib/codec-context.js +316 -381
- package/dist/lib/codec-context.js.map +1 -1
- package/dist/lib/codec-parameters.d.ts +161 -171
- package/dist/lib/codec-parameters.js +162 -172
- package/dist/lib/codec-parameters.js.map +1 -1
- package/dist/lib/codec-parser.d.ts +92 -105
- package/dist/lib/codec-parser.js +92 -103
- package/dist/lib/codec-parser.js.map +1 -1
- package/dist/lib/codec.d.ts +328 -217
- package/dist/lib/codec.js +392 -218
- package/dist/lib/codec.js.map +1 -1
- package/dist/lib/dictionary.d.ts +150 -204
- package/dist/lib/dictionary.js +159 -213
- package/dist/lib/dictionary.js.map +1 -1
- package/dist/lib/error.d.ts +97 -131
- package/dist/lib/error.js +98 -128
- package/dist/lib/error.js.map +1 -1
- package/dist/lib/filter-context.d.ts +317 -194
- package/dist/lib/filter-context.js +335 -200
- package/dist/lib/filter-context.js.map +1 -1
- package/dist/lib/filter-graph.d.ts +252 -293
- package/dist/lib/filter-graph.js +253 -294
- package/dist/lib/filter-graph.js.map +1 -1
- package/dist/lib/filter-inout.d.ts +87 -95
- package/dist/lib/filter-inout.js +87 -95
- package/dist/lib/filter-inout.js.map +1 -1
- package/dist/lib/filter.d.ts +93 -111
- package/dist/lib/filter.js +94 -112
- package/dist/lib/filter.js.map +1 -1
- package/dist/lib/format-context.d.ts +321 -429
- package/dist/lib/format-context.js +314 -386
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +263 -406
- package/dist/lib/frame.js +263 -408
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/hardware-device-context.d.ts +150 -204
- package/dist/lib/hardware-device-context.js +149 -203
- package/dist/lib/hardware-device-context.js.map +1 -1
- package/dist/lib/hardware-frames-context.d.ts +171 -181
- package/dist/lib/hardware-frames-context.js +171 -181
- package/dist/lib/hardware-frames-context.js.map +1 -1
- package/dist/lib/index.d.ts +2 -3
- package/dist/lib/index.js +2 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/input-format.d.ts +90 -118
- package/dist/lib/input-format.js +89 -117
- package/dist/lib/input-format.js.map +1 -1
- package/dist/lib/io-context.d.ts +210 -242
- package/dist/lib/io-context.js +221 -253
- package/dist/lib/io-context.js.map +1 -1
- package/dist/lib/log.d.ts +86 -120
- package/dist/lib/log.js +85 -122
- package/dist/lib/log.js.map +1 -1
- package/dist/lib/native-types.d.ts +127 -112
- package/dist/lib/native-types.js +9 -0
- package/dist/lib/native-types.js.map +1 -1
- package/dist/lib/option.d.ts +285 -242
- package/dist/lib/option.js +310 -250
- package/dist/lib/option.js.map +1 -1
- package/dist/lib/output-format.d.ts +78 -102
- package/dist/lib/output-format.js +77 -101
- package/dist/lib/output-format.js.map +1 -1
- package/dist/lib/packet.d.ts +173 -241
- package/dist/lib/packet.js +172 -241
- package/dist/lib/packet.js.map +1 -1
- package/dist/lib/rational.d.ts +0 -2
- package/dist/lib/rational.js +0 -2
- package/dist/lib/rational.js.map +1 -1
- package/dist/lib/software-resample-context.d.ts +242 -326
- package/dist/lib/software-resample-context.js +242 -326
- package/dist/lib/software-resample-context.js.map +1 -1
- package/dist/lib/software-scale-context.d.ts +130 -174
- package/dist/lib/software-scale-context.js +132 -176
- package/dist/lib/software-scale-context.js.map +1 -1
- package/dist/lib/stream.d.ts +88 -198
- package/dist/lib/stream.js +87 -197
- package/dist/lib/stream.js.map +1 -1
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/utilities.d.ts +372 -181
- package/dist/lib/utilities.js +373 -182
- package/dist/lib/utilities.js.map +1 -1
- package/install/check.js +0 -1
- package/package.json +32 -24
- package/release_notes.md +43 -13
- package/CHANGELOG.md +0 -8
- package/dist/lib/channel-layouts.js.map +0 -1
- package/dist/lib/constants.js.map +0 -1
- /package/dist/{lib → constants}/channel-layouts.js +0 -0
package/dist/lib/option.d.ts
CHANGED
|
@@ -1,501 +1,507 @@
|
|
|
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';
|
|
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';
|
|
13
3
|
import type { OptionCapableObject } from './binding.js';
|
|
14
|
-
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.js';
|
|
15
4
|
import type { NativeOption } from './native-types.js';
|
|
16
5
|
import type { ChannelLayout, IRational } from './types.js';
|
|
17
6
|
/**
|
|
18
|
-
*
|
|
7
|
+
* Option information descriptor.
|
|
19
8
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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.
|
|
22
14
|
*
|
|
23
15
|
* @example
|
|
24
16
|
* ```typescript
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
105
|
+
* Get the underlying native Option object.
|
|
106
|
+
*
|
|
107
|
+
* @returns The native Option binding object
|
|
87
108
|
*
|
|
88
|
-
* @internal
|
|
89
|
-
* @returns The underlying native option object
|
|
109
|
+
* @internal
|
|
90
110
|
*/
|
|
91
111
|
getNative(): NativeOption;
|
|
92
112
|
}
|
|
93
113
|
/**
|
|
94
|
-
*
|
|
114
|
+
* FFmpeg option management utilities.
|
|
95
115
|
*
|
|
96
|
-
* Provides static methods for
|
|
97
|
-
*
|
|
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
|
-
*
|
|
121
|
+
* Direct mapping to FFmpeg's AVOption API.
|
|
100
122
|
*
|
|
101
123
|
* @example
|
|
102
124
|
* ```typescript
|
|
103
|
-
*
|
|
104
|
-
*
|
|
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');
|
|
131
|
+
*
|
|
132
|
+
* ret = Option.setInt(obj, 'bitrate', 2000000);
|
|
133
|
+
* FFmpegError.throwIfError(ret, 'set bitrate');
|
|
134
|
+
*
|
|
135
|
+
* ret = Option.setRational(obj, 'framerate', { num: 30, den: 1 });
|
|
136
|
+
* FFmpegError.throwIfError(ret, 'set framerate');
|
|
105
137
|
*
|
|
106
|
-
* // Get
|
|
107
|
-
* const
|
|
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');
|
|
108
142
|
*
|
|
109
|
-
* //
|
|
143
|
+
* // List all options
|
|
110
144
|
* let opt = null;
|
|
111
|
-
* while ((opt = Option.next(
|
|
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
|
|
155
|
+
* Iterate to next option.
|
|
120
156
|
*
|
|
121
|
-
*
|
|
157
|
+
* Iterates through available options on an object.
|
|
122
158
|
*
|
|
123
|
-
*
|
|
124
|
-
* @param prev - Previous option for iteration, or null to start
|
|
159
|
+
* Direct mapping to av_opt_next().
|
|
125
160
|
*
|
|
126
|
-
* @
|
|
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(
|
|
132
|
-
* console.log(
|
|
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
|
|
175
|
+
* Find option by name.
|
|
139
176
|
*
|
|
140
|
-
*
|
|
177
|
+
* Searches for an option with the specified name.
|
|
141
178
|
*
|
|
142
|
-
*
|
|
143
|
-
* @param name - Option name to find
|
|
144
|
-
* @param searchFlags - Search flags (default: 0)
|
|
179
|
+
* Direct mapping to av_opt_find().
|
|
145
180
|
*
|
|
146
|
-
* @
|
|
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(
|
|
188
|
+
* const opt = Option.find(obj, 'bitrate');
|
|
151
189
|
* if (opt) {
|
|
152
|
-
* console.log(`Found
|
|
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
|
|
196
|
+
* Find option with target info.
|
|
159
197
|
*
|
|
160
|
-
*
|
|
198
|
+
* Like find() but also indicates if option was found on different target.
|
|
161
199
|
*
|
|
162
|
-
*
|
|
163
|
-
* @param name - Option name to find
|
|
164
|
-
* @param searchFlags - Search flags (default: 0)
|
|
200
|
+
* Direct mapping to av_opt_find2().
|
|
165
201
|
*
|
|
166
|
-
* @
|
|
202
|
+
* @param obj - Object to search
|
|
203
|
+
* @param name - Option name
|
|
204
|
+
* @param searchFlags - Search flags
|
|
205
|
+
* @returns Object with option and target info
|
|
206
|
+
*
|
|
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
|
|
220
|
+
* Get string option value.
|
|
174
221
|
*
|
|
175
|
-
*
|
|
176
|
-
* Converts any option type to its string representation.
|
|
222
|
+
* Direct mapping to av_opt_get().
|
|
177
223
|
*
|
|
178
|
-
* @param obj -
|
|
224
|
+
* @param obj - Object to query
|
|
179
225
|
* @param name - Option name
|
|
180
|
-
* @param searchFlags - Search flags
|
|
181
|
-
*
|
|
182
|
-
* @returns Value string on success, null if option not found or on error
|
|
226
|
+
* @param searchFlags - Search flags
|
|
227
|
+
* @returns Option value as string, or null
|
|
183
228
|
*/
|
|
184
229
|
static get(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): string | null;
|
|
185
230
|
/**
|
|
186
|
-
* Get option value
|
|
231
|
+
* Get integer option value.
|
|
187
232
|
*
|
|
188
|
-
*
|
|
189
|
-
* Option must be of integer type.
|
|
233
|
+
* Direct mapping to av_opt_get_int().
|
|
190
234
|
*
|
|
191
|
-
* @param obj -
|
|
235
|
+
* @param obj - Object to query
|
|
192
236
|
* @param name - Option name
|
|
193
|
-
* @param searchFlags - Search flags
|
|
194
|
-
*
|
|
195
|
-
* @returns Integer value on success, null if option not found or on error
|
|
237
|
+
* @param searchFlags - Search flags
|
|
238
|
+
* @returns Option value as integer, or null
|
|
196
239
|
*/
|
|
197
240
|
static getInt(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): number | null;
|
|
198
241
|
/**
|
|
199
|
-
* Get option value
|
|
242
|
+
* Get double option value.
|
|
200
243
|
*
|
|
201
|
-
*
|
|
202
|
-
* Option must be of double/float type.
|
|
244
|
+
* Direct mapping to av_opt_get_double().
|
|
203
245
|
*
|
|
204
|
-
* @param obj -
|
|
246
|
+
* @param obj - Object to query
|
|
205
247
|
* @param name - Option name
|
|
206
|
-
* @param searchFlags - Search flags
|
|
207
|
-
*
|
|
208
|
-
* @returns Double value on success, null if option not found or on error
|
|
248
|
+
* @param searchFlags - Search flags
|
|
249
|
+
* @returns Option value as double, or null
|
|
209
250
|
*/
|
|
210
251
|
static getDouble(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): number | null;
|
|
211
252
|
/**
|
|
212
|
-
* Get option value
|
|
253
|
+
* Get rational option value.
|
|
213
254
|
*
|
|
214
|
-
*
|
|
215
|
-
* Option must be of rational type.
|
|
255
|
+
* Direct mapping to av_opt_get_q().
|
|
216
256
|
*
|
|
217
|
-
* @param obj -
|
|
257
|
+
* @param obj - Object to query
|
|
218
258
|
* @param name - Option name
|
|
219
|
-
* @param searchFlags - Search flags
|
|
220
|
-
*
|
|
221
|
-
* @returns Rational object {num, den} on success, null if option not found or on error
|
|
259
|
+
* @param searchFlags - Search flags
|
|
260
|
+
* @returns Option value as rational, or null
|
|
222
261
|
*/
|
|
223
262
|
static getRational(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): IRational | null;
|
|
224
263
|
/**
|
|
225
|
-
* Get option value
|
|
264
|
+
* Get pixel format option value.
|
|
226
265
|
*
|
|
227
|
-
*
|
|
228
|
-
* Option must be of pixel format type.
|
|
266
|
+
* Direct mapping to av_opt_get_pixel_fmt().
|
|
229
267
|
*
|
|
230
|
-
* @param obj -
|
|
268
|
+
* @param obj - Object to query
|
|
231
269
|
* @param name - Option name
|
|
232
|
-
* @param searchFlags - Search flags
|
|
233
|
-
*
|
|
234
|
-
* @returns AVPixelFormat enum value on success, null if option not found or on error
|
|
270
|
+
* @param searchFlags - Search flags
|
|
271
|
+
* @returns Pixel format value, or null
|
|
235
272
|
*/
|
|
236
273
|
static getPixelFormat(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): AVPixelFormat | null;
|
|
237
274
|
/**
|
|
238
|
-
* Get option value
|
|
275
|
+
* Get sample format option value.
|
|
239
276
|
*
|
|
240
|
-
*
|
|
241
|
-
* Option must be of sample format type.
|
|
277
|
+
* Direct mapping to av_opt_get_sample_fmt().
|
|
242
278
|
*
|
|
243
|
-
* @param obj -
|
|
279
|
+
* @param obj - Object to query
|
|
244
280
|
* @param name - Option name
|
|
245
|
-
* @param searchFlags - Search flags
|
|
246
|
-
*
|
|
247
|
-
* @returns AVSampleFormat enum value on success, null if option not found or on error
|
|
281
|
+
* @param searchFlags - Search flags
|
|
282
|
+
* @returns Sample format value, or null
|
|
248
283
|
*/
|
|
249
284
|
static getSampleFormat(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): AVSampleFormat | null;
|
|
250
285
|
/**
|
|
251
|
-
* Get option value
|
|
286
|
+
* Get image size option value.
|
|
252
287
|
*
|
|
253
|
-
*
|
|
254
|
-
* Option must be of image size type.
|
|
288
|
+
* Direct mapping to av_opt_get_image_size().
|
|
255
289
|
*
|
|
256
|
-
* @param obj -
|
|
290
|
+
* @param obj - Object to query
|
|
257
291
|
* @param name - Option name
|
|
258
|
-
* @param searchFlags - Search flags
|
|
259
|
-
*
|
|
260
|
-
* @returns Size object {width, height} on success, null if option not found or on error
|
|
292
|
+
* @param searchFlags - Search flags
|
|
293
|
+
* @returns Width and height, or null
|
|
261
294
|
*/
|
|
262
295
|
static getImageSize(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): {
|
|
263
296
|
width: number;
|
|
264
297
|
height: number;
|
|
265
298
|
} | null;
|
|
266
299
|
/**
|
|
267
|
-
* Get option value
|
|
300
|
+
* Get channel layout option value.
|
|
268
301
|
*
|
|
269
|
-
*
|
|
270
|
-
* Option must be of channel layout type.
|
|
302
|
+
* Direct mapping to av_opt_get_chlayout().
|
|
271
303
|
*
|
|
272
|
-
* @param obj -
|
|
304
|
+
* @param obj - Object to query
|
|
273
305
|
* @param name - Option name
|
|
274
|
-
* @param searchFlags - Search flags
|
|
275
|
-
*
|
|
276
|
-
* @returns ChannelLayout object on success, null if option not found or on error
|
|
306
|
+
* @param searchFlags - Search flags
|
|
307
|
+
* @returns Channel layout, or null
|
|
277
308
|
*/
|
|
278
309
|
static getChannelLayout(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): ChannelLayout | null;
|
|
279
310
|
/**
|
|
280
|
-
* Get option value
|
|
311
|
+
* Get dictionary option value.
|
|
281
312
|
*
|
|
282
|
-
*
|
|
283
|
-
* Option must be of dictionary type.
|
|
313
|
+
* Direct mapping to av_opt_get_dict_val().
|
|
284
314
|
*
|
|
285
|
-
* @param obj -
|
|
315
|
+
* @param obj - Object to query
|
|
286
316
|
* @param name - Option name
|
|
287
|
-
* @param searchFlags - Search flags
|
|
288
|
-
*
|
|
289
|
-
* @returns Dictionary object on success, null if option not found or on error
|
|
317
|
+
* @param searchFlags - Search flags
|
|
318
|
+
* @returns Dictionary value, or null
|
|
290
319
|
*/
|
|
291
320
|
static getDict(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): Dictionary | null;
|
|
292
321
|
/**
|
|
293
|
-
* Set option value
|
|
322
|
+
* Set string option value.
|
|
294
323
|
*
|
|
295
|
-
*
|
|
296
|
-
* Can be used for any option type - FFmpeg will parse the string.
|
|
324
|
+
* Direct mapping to av_opt_set().
|
|
297
325
|
*
|
|
298
|
-
* @param obj -
|
|
326
|
+
* @param obj - Object to modify
|
|
299
327
|
* @param name - Option name
|
|
300
|
-
* @param value - String value
|
|
301
|
-
* @param searchFlags - Search flags
|
|
302
|
-
*
|
|
303
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
328
|
+
* @param value - String value
|
|
329
|
+
* @param searchFlags - Search flags
|
|
330
|
+
* @returns 0 on success, negative AVERROR on error
|
|
304
331
|
*/
|
|
305
332
|
static set(obj: OptionCapableObject, name: string, value: string, searchFlags?: AVOptionSearchFlags): number;
|
|
306
333
|
/**
|
|
307
|
-
* Set option value
|
|
334
|
+
* Set integer option value.
|
|
308
335
|
*
|
|
309
|
-
*
|
|
310
|
-
* More efficient than set() for numeric options.
|
|
336
|
+
* Direct mapping to av_opt_set_int().
|
|
311
337
|
*
|
|
312
|
-
* @param obj -
|
|
338
|
+
* @param obj - Object to modify
|
|
313
339
|
* @param name - Option name
|
|
314
|
-
* @param value -
|
|
315
|
-
* @param searchFlags - Search flags
|
|
316
|
-
*
|
|
317
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
340
|
+
* @param value - Integer value
|
|
341
|
+
* @param searchFlags - Search flags
|
|
342
|
+
* @returns 0 on success, negative AVERROR on error
|
|
318
343
|
*/
|
|
319
344
|
static setInt(obj: OptionCapableObject, name: string, value: number | bigint, searchFlags?: AVOptionSearchFlags): number;
|
|
320
345
|
/**
|
|
321
|
-
* Set option value
|
|
346
|
+
* Set double option value.
|
|
322
347
|
*
|
|
323
|
-
*
|
|
324
|
-
* More efficient than set() for floating point options.
|
|
348
|
+
* Direct mapping to av_opt_set_double().
|
|
325
349
|
*
|
|
326
|
-
* @param obj -
|
|
350
|
+
* @param obj - Object to modify
|
|
327
351
|
* @param name - Option name
|
|
328
|
-
* @param value - Double value
|
|
329
|
-
* @param searchFlags - Search flags
|
|
330
|
-
*
|
|
331
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
352
|
+
* @param value - Double value
|
|
353
|
+
* @param searchFlags - Search flags
|
|
354
|
+
* @returns 0 on success, negative AVERROR on error
|
|
332
355
|
*/
|
|
333
356
|
static setDouble(obj: OptionCapableObject, name: string, value: number, searchFlags?: AVOptionSearchFlags): number;
|
|
334
357
|
/**
|
|
335
|
-
* Set option value
|
|
358
|
+
* Set rational option value.
|
|
336
359
|
*
|
|
337
|
-
*
|
|
338
|
-
* For framerates, aspect ratios, time bases, etc.
|
|
360
|
+
* Direct mapping to av_opt_set_q().
|
|
339
361
|
*
|
|
340
|
-
* @param obj -
|
|
362
|
+
* @param obj - Object to modify
|
|
341
363
|
* @param name - Option name
|
|
342
|
-
* @param value - Rational
|
|
343
|
-
* @param searchFlags - Search flags
|
|
344
|
-
*
|
|
345
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
364
|
+
* @param value - Rational value
|
|
365
|
+
* @param searchFlags - Search flags
|
|
366
|
+
* @returns 0 on success, negative AVERROR on error
|
|
346
367
|
*/
|
|
347
368
|
static setRational(obj: OptionCapableObject, name: string, value: IRational, searchFlags?: AVOptionSearchFlags): number;
|
|
348
369
|
/**
|
|
349
|
-
* Set option value
|
|
370
|
+
* Set pixel format option value.
|
|
350
371
|
*
|
|
351
|
-
*
|
|
352
|
-
* More type-safe than using set() with string names.
|
|
372
|
+
* Direct mapping to av_opt_set_pixel_fmt().
|
|
353
373
|
*
|
|
354
|
-
* @param obj -
|
|
374
|
+
* @param obj - Object to modify
|
|
355
375
|
* @param name - Option name
|
|
356
|
-
* @param value -
|
|
357
|
-
* @param searchFlags - Search flags
|
|
358
|
-
*
|
|
359
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
376
|
+
* @param value - Pixel format
|
|
377
|
+
* @param searchFlags - Search flags
|
|
378
|
+
* @returns 0 on success, negative AVERROR on error
|
|
360
379
|
*/
|
|
361
380
|
static setPixelFormat(obj: OptionCapableObject, name: string, value: AVPixelFormat, searchFlags?: AVOptionSearchFlags): number;
|
|
362
381
|
/**
|
|
363
|
-
* Set option value
|
|
382
|
+
* Set sample format option value.
|
|
364
383
|
*
|
|
365
|
-
*
|
|
366
|
-
* More type-safe than using set() with string names.
|
|
384
|
+
* Direct mapping to av_opt_set_sample_fmt().
|
|
367
385
|
*
|
|
368
|
-
* @param obj -
|
|
386
|
+
* @param obj - Object to modify
|
|
369
387
|
* @param name - Option name
|
|
370
|
-
* @param value -
|
|
371
|
-
* @param searchFlags - Search flags
|
|
372
|
-
*
|
|
373
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
388
|
+
* @param value - Sample format
|
|
389
|
+
* @param searchFlags - Search flags
|
|
390
|
+
* @returns 0 on success, negative AVERROR on error
|
|
374
391
|
*/
|
|
375
392
|
static setSampleFormat(obj: OptionCapableObject, name: string, value: AVSampleFormat, searchFlags?: AVOptionSearchFlags): number;
|
|
376
393
|
/**
|
|
377
|
-
* Set option value
|
|
394
|
+
* Set image size option value.
|
|
378
395
|
*
|
|
379
|
-
*
|
|
380
|
-
* Convenient for setting width and height together.
|
|
396
|
+
* Direct mapping to av_opt_set_image_size().
|
|
381
397
|
*
|
|
382
|
-
* @param obj -
|
|
398
|
+
* @param obj - Object to modify
|
|
383
399
|
* @param name - Option name
|
|
384
|
-
* @param width -
|
|
385
|
-
* @param height -
|
|
386
|
-
* @param searchFlags - Search flags
|
|
387
|
-
*
|
|
388
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
400
|
+
* @param width - Image width
|
|
401
|
+
* @param height - Image height
|
|
402
|
+
* @param searchFlags - Search flags
|
|
403
|
+
* @returns 0 on success, negative AVERROR on error
|
|
389
404
|
*/
|
|
390
405
|
static setImageSize(obj: OptionCapableObject, name: string, width: number, height: number, searchFlags?: AVOptionSearchFlags): number;
|
|
391
406
|
/**
|
|
392
|
-
* Set option value
|
|
407
|
+
* Set channel layout option value.
|
|
393
408
|
*
|
|
394
|
-
*
|
|
395
|
-
* For audio channel configuration.
|
|
409
|
+
* Direct mapping to av_opt_set_chlayout().
|
|
396
410
|
*
|
|
397
|
-
* @param obj -
|
|
411
|
+
* @param obj - Object to modify
|
|
398
412
|
* @param name - Option name
|
|
399
|
-
* @param value - Channel layout
|
|
400
|
-
* @param searchFlags - Search flags
|
|
401
|
-
*
|
|
402
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
413
|
+
* @param value - Channel layout
|
|
414
|
+
* @param searchFlags - Search flags
|
|
415
|
+
* @returns 0 on success, negative AVERROR on error
|
|
403
416
|
*/
|
|
404
417
|
static setChannelLayout(obj: OptionCapableObject, name: string, value: number, searchFlags?: AVOptionSearchFlags): number;
|
|
405
418
|
/**
|
|
406
|
-
* Set option value
|
|
419
|
+
* Set dictionary option value.
|
|
407
420
|
*
|
|
408
|
-
*
|
|
409
|
-
* For options that accept key-value pairs.
|
|
421
|
+
* Direct mapping to av_opt_set_dict_val().
|
|
410
422
|
*
|
|
411
|
-
* @param obj -
|
|
423
|
+
* @param obj - Object to modify
|
|
412
424
|
* @param name - Option name
|
|
413
|
-
* @param value - Dictionary
|
|
414
|
-
* @param searchFlags - Search flags
|
|
415
|
-
*
|
|
416
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
425
|
+
* @param value - Dictionary value
|
|
426
|
+
* @param searchFlags - Search flags
|
|
427
|
+
* @returns 0 on success, negative AVERROR on error
|
|
417
428
|
*/
|
|
418
429
|
static setDict(obj: OptionCapableObject, name: string, value: Dictionary, searchFlags?: AVOptionSearchFlags): number;
|
|
419
430
|
/**
|
|
420
|
-
* Set option value
|
|
431
|
+
* Set binary option value.
|
|
421
432
|
*
|
|
422
|
-
*
|
|
423
|
-
* For options that accept raw binary data.
|
|
433
|
+
* Direct mapping to av_opt_set_bin().
|
|
424
434
|
*
|
|
425
|
-
* @param obj -
|
|
435
|
+
* @param obj - Object to modify
|
|
426
436
|
* @param name - Option name
|
|
427
|
-
* @param value - Binary data
|
|
428
|
-
* @param searchFlags - Search flags
|
|
429
|
-
*
|
|
430
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
437
|
+
* @param value - Binary data
|
|
438
|
+
* @param searchFlags - Search flags
|
|
439
|
+
* @returns 0 on success, negative AVERROR on error
|
|
431
440
|
*/
|
|
432
441
|
static setBin(obj: OptionCapableObject, name: string, value: Buffer, searchFlags?: AVOptionSearchFlags): number;
|
|
433
442
|
/**
|
|
434
|
-
* Set
|
|
443
|
+
* Set defaults on object.
|
|
444
|
+
*
|
|
445
|
+
* Sets all options to their default values.
|
|
435
446
|
*
|
|
436
|
-
*
|
|
447
|
+
* Direct mapping to av_opt_set_defaults().
|
|
437
448
|
*
|
|
438
|
-
* @param obj -
|
|
449
|
+
* @param obj - Object to reset
|
|
439
450
|
*/
|
|
440
451
|
static setDefaults(obj: OptionCapableObject): void;
|
|
441
452
|
/**
|
|
442
|
-
* Copy options
|
|
453
|
+
* Copy options between objects.
|
|
443
454
|
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
455
|
+
* Copies option values from source to destination.
|
|
456
|
+
*
|
|
457
|
+
* Direct mapping to av_opt_copy().
|
|
446
458
|
*
|
|
447
459
|
* @param dest - Destination object
|
|
448
460
|
* @param src - Source object
|
|
449
|
-
*
|
|
450
|
-
* @returns 0 on success, negative AVERROR code on failure
|
|
461
|
+
* @returns 0 on success, negative AVERROR on error
|
|
451
462
|
*/
|
|
452
463
|
static copy(dest: OptionCapableObject, src: OptionCapableObject): number;
|
|
453
464
|
/**
|
|
454
|
-
* Check if option is set to
|
|
465
|
+
* Check if option is set to default.
|
|
455
466
|
*
|
|
456
|
-
*
|
|
467
|
+
* Direct mapping to av_opt_is_set_to_default().
|
|
457
468
|
*
|
|
458
|
-
* @param obj -
|
|
469
|
+
* @param obj - Object to check
|
|
459
470
|
* @param name - Option name
|
|
460
|
-
* @param searchFlags - Search flags
|
|
461
|
-
*
|
|
462
|
-
* @returns true if set to default, false if not, null if option not found or on error
|
|
471
|
+
* @param searchFlags - Search flags
|
|
472
|
+
* @returns True if default, false if modified, null if not found
|
|
463
473
|
*/
|
|
464
474
|
static isSetToDefault(obj: OptionCapableObject, name: string, searchFlags?: AVOptionSearchFlags): boolean | null;
|
|
465
475
|
/**
|
|
466
476
|
* Serialize options to string.
|
|
467
477
|
*
|
|
468
|
-
*
|
|
469
|
-
* Converts all non-default options to a string representation.
|
|
478
|
+
* Direct mapping to av_opt_serialize().
|
|
470
479
|
*
|
|
471
|
-
* @param obj -
|
|
472
|
-
* @param optFlags - Option flags
|
|
473
|
-
* @param flags - Serialization flags
|
|
474
|
-
* @param keyValSep - Key-value separator
|
|
475
|
-
* @param pairsSep - Pairs separator
|
|
476
|
-
*
|
|
477
|
-
* @returns Serialized string on success, null on error or if no options to serialize
|
|
480
|
+
* @param obj - Object to serialize
|
|
481
|
+
* @param optFlags - Option flags filter
|
|
482
|
+
* @param flags - Serialization flags
|
|
483
|
+
* @param keyValSep - Key-value separator
|
|
484
|
+
* @param pairsSep - Pairs separator
|
|
485
|
+
* @returns Serialized string, or null on error
|
|
478
486
|
*/
|
|
479
487
|
static serialize(obj: OptionCapableObject, optFlags?: number, flags?: number, keyValSep?: string, pairsSep?: string): string | null;
|
|
480
488
|
/**
|
|
481
|
-
* Free
|
|
489
|
+
* Free option resources.
|
|
482
490
|
*
|
|
483
|
-
*
|
|
491
|
+
* Direct mapping to av_opt_free().
|
|
484
492
|
*
|
|
485
|
-
* @param obj -
|
|
493
|
+
* @param obj - Object to free options from
|
|
486
494
|
*/
|
|
487
495
|
static free(obj: OptionCapableObject): void;
|
|
488
496
|
/**
|
|
489
|
-
* Show options
|
|
490
|
-
*
|
|
491
|
-
* Uses av_opt_show2() internally.
|
|
492
|
-
* Prints all available options to stderr.
|
|
497
|
+
* Show options for debugging.
|
|
493
498
|
*
|
|
494
|
-
*
|
|
495
|
-
* @param reqFlags - Required flags (default: 0)
|
|
496
|
-
* @param rejFlags - Rejected flags (default: 0)
|
|
499
|
+
* Direct mapping to av_opt_show2().
|
|
497
500
|
*
|
|
498
|
-
* @
|
|
501
|
+
* @param obj - Object to show options for
|
|
502
|
+
* @param reqFlags - Required flags
|
|
503
|
+
* @param rejFlags - Rejected flags
|
|
504
|
+
* @returns 0 on success, negative AVERROR on error
|
|
499
505
|
*/
|
|
500
506
|
static show(obj: OptionCapableObject, reqFlags?: number, rejFlags?: number): number;
|
|
501
507
|
}
|
|
@@ -513,10 +519,42 @@ export declare class Option {
|
|
|
513
519
|
*
|
|
514
520
|
* @example
|
|
515
521
|
* ```typescript
|
|
522
|
+
* import { OptionMember, FFmpegError } from 'node-av';
|
|
523
|
+
* import { AV_OPT_TYPE_INT, AV_OPT_TYPE_STRING, AV_OPT_TYPE_RATIONAL } from 'node-av/constants';
|
|
524
|
+
*
|
|
516
525
|
* class CodecContext extends OptionMember<NativeCodecContext> {
|
|
517
|
-
*
|
|
526
|
+
* constructor(native: NativeCodecContext) {
|
|
527
|
+
* super(native);
|
|
528
|
+
* }
|
|
529
|
+
* }
|
|
530
|
+
*
|
|
531
|
+
* // Use inherited methods
|
|
532
|
+
* const codec = new CodecContext(native);
|
|
533
|
+
*
|
|
534
|
+
* // Set options with automatic type handling
|
|
535
|
+
* let ret = codec.setOption('preset', 'fast');
|
|
536
|
+
* FFmpegError.throwIfError(ret, 'set preset');
|
|
537
|
+
*
|
|
538
|
+
* ret = codec.setOption('bitrate', 2000000, AV_OPT_TYPE_INT);
|
|
539
|
+
* FFmpegError.throwIfError(ret, 'set bitrate');
|
|
540
|
+
*
|
|
541
|
+
* ret = codec.setOption('framerate', { num: 30, den: 1 }, AV_OPT_TYPE_RATIONAL);
|
|
542
|
+
* FFmpegError.throwIfError(ret, 'set framerate');
|
|
543
|
+
*
|
|
544
|
+
* // Get typed options
|
|
545
|
+
* const preset = codec.getOption('preset');
|
|
546
|
+
* const bitrate = codec.getOption('bitrate', AV_OPT_TYPE_INT);
|
|
547
|
+
* const framerate = codec.getOption('framerate', AV_OPT_TYPE_RATIONAL);
|
|
548
|
+
*
|
|
549
|
+
* // List all available options
|
|
550
|
+
* const options = codec.listOptions();
|
|
551
|
+
* for (const opt of options) {
|
|
552
|
+
* console.log(`${opt.name}: ${opt.help}`);
|
|
518
553
|
* }
|
|
519
554
|
* ```
|
|
555
|
+
*
|
|
556
|
+
* @see {@link Option} For static option methods
|
|
557
|
+
* @see {@link OptionInfo} For option metadata
|
|
520
558
|
*/
|
|
521
559
|
export declare class OptionMember<T extends OptionCapableObject> {
|
|
522
560
|
protected native: T;
|
|
@@ -574,6 +612,8 @@ export declare class OptionMember<T extends OptionCapableObject> {
|
|
|
574
612
|
* Uses the AVOption API to enumerate all options.
|
|
575
613
|
* Useful for discovering available settings and their types.
|
|
576
614
|
*
|
|
615
|
+
* Direct mapping to av_opt_next() iteration.
|
|
616
|
+
*
|
|
577
617
|
* @returns Array of option information objects
|
|
578
618
|
*
|
|
579
619
|
* @example
|
|
@@ -582,8 +622,11 @@ export declare class OptionMember<T extends OptionCapableObject> {
|
|
|
582
622
|
* for (const opt of options) {
|
|
583
623
|
* console.log(`${opt.name}: ${opt.help}`);
|
|
584
624
|
* console.log(` Type: ${opt.type}, Default: ${opt.defaultValue}`);
|
|
625
|
+
* console.log(` Range: ${opt.min} - ${opt.max}`);
|
|
585
626
|
* }
|
|
586
627
|
* ```
|
|
628
|
+
*
|
|
629
|
+
* @see {@link OptionInfo} For option metadata structure
|
|
587
630
|
*/
|
|
588
631
|
listOptions(): OptionInfo[];
|
|
589
632
|
}
|