node-av 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE.md +22 -0
- package/README.md +377 -0
- package/binding.gyp +78 -0
- package/dist/api/bitstream-filter.d.ts +246 -0
- package/dist/api/bitstream-filter.js +369 -0
- package/dist/api/bitstream-filter.js.map +1 -0
- package/dist/api/decoder.d.ts +257 -0
- package/dist/api/decoder.js +424 -0
- package/dist/api/decoder.js.map +1 -0
- package/dist/api/encoder.d.ts +298 -0
- package/dist/api/encoder.js +574 -0
- package/dist/api/encoder.js.map +1 -0
- package/dist/api/filter.d.ts +457 -0
- package/dist/api/filter.js +876 -0
- package/dist/api/filter.js.map +1 -0
- package/dist/api/hardware.d.ts +318 -0
- package/dist/api/hardware.js +558 -0
- package/dist/api/hardware.js.map +1 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.js +20 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/io-stream.d.ts +109 -0
- package/dist/api/io-stream.js +124 -0
- package/dist/api/io-stream.js.map +1 -0
- package/dist/api/media-input.d.ts +295 -0
- package/dist/api/media-input.js +456 -0
- package/dist/api/media-input.js.map +1 -0
- package/dist/api/media-output.d.ts +274 -0
- package/dist/api/media-output.js +486 -0
- package/dist/api/media-output.js.map +1 -0
- package/dist/api/pipeline.d.ts +117 -0
- package/dist/api/pipeline.js +836 -0
- package/dist/api/pipeline.js.map +1 -0
- package/dist/api/types.d.ts +440 -0
- package/dist/api/types.js +2 -0
- package/dist/api/types.js.map +1 -0
- package/dist/api/utilities/audio-sample.d.ts +115 -0
- package/dist/api/utilities/audio-sample.js +110 -0
- package/dist/api/utilities/audio-sample.js.map +1 -0
- package/dist/api/utilities/channel-layout.d.ts +83 -0
- package/dist/api/utilities/channel-layout.js +87 -0
- package/dist/api/utilities/channel-layout.js.map +1 -0
- package/dist/api/utilities/image.d.ts +177 -0
- package/dist/api/utilities/image.js +183 -0
- package/dist/api/utilities/image.js.map +1 -0
- package/dist/api/utilities/index.d.ts +8 -0
- package/dist/api/utilities/index.js +17 -0
- package/dist/api/utilities/index.js.map +1 -0
- package/dist/api/utilities/media-type.d.ts +56 -0
- package/dist/api/utilities/media-type.js +60 -0
- package/dist/api/utilities/media-type.js.map +1 -0
- package/dist/api/utilities/pixel-format.d.ts +94 -0
- package/dist/api/utilities/pixel-format.js +102 -0
- package/dist/api/utilities/pixel-format.js.map +1 -0
- package/dist/api/utilities/sample-format.d.ts +132 -0
- package/dist/api/utilities/sample-format.js +144 -0
- package/dist/api/utilities/sample-format.js.map +1 -0
- package/dist/api/utilities/streaming.d.ts +104 -0
- package/dist/api/utilities/streaming.js +137 -0
- package/dist/api/utilities/streaming.js.map +1 -0
- package/dist/api/utilities/timestamp.d.ts +187 -0
- package/dist/api/utilities/timestamp.js +200 -0
- package/dist/api/utilities/timestamp.js.map +1 -0
- package/dist/api/utils.d.ts +61 -0
- package/dist/api/utils.js +330 -0
- package/dist/api/utils.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/audio-fifo.d.ts +339 -0
- package/dist/lib/audio-fifo.js +365 -0
- package/dist/lib/audio-fifo.js.map +1 -0
- package/dist/lib/binding.d.ts +192 -0
- package/dist/lib/binding.js +70 -0
- package/dist/lib/binding.js.map +1 -0
- package/dist/lib/bitstream-filter-context.d.ts +345 -0
- package/dist/lib/bitstream-filter-context.js +407 -0
- package/dist/lib/bitstream-filter-context.js.map +1 -0
- package/dist/lib/bitstream-filter.d.ts +124 -0
- package/dist/lib/bitstream-filter.js +138 -0
- package/dist/lib/bitstream-filter.js.map +1 -0
- package/dist/lib/channel-layouts.d.ts +51 -0
- package/dist/lib/channel-layouts.js +55 -0
- package/dist/lib/channel-layouts.js.map +1 -0
- package/dist/lib/codec-context.d.ts +763 -0
- package/dist/lib/codec-context.js +974 -0
- package/dist/lib/codec-context.js.map +1 -0
- package/dist/lib/codec-parameters.d.ts +362 -0
- package/dist/lib/codec-parameters.js +460 -0
- package/dist/lib/codec-parameters.js.map +1 -0
- package/dist/lib/codec-parser.d.ts +185 -0
- package/dist/lib/codec-parser.js +193 -0
- package/dist/lib/codec-parser.js.map +1 -0
- package/dist/lib/codec.d.ts +432 -0
- package/dist/lib/codec.js +492 -0
- package/dist/lib/codec.js.map +1 -0
- package/dist/lib/constants.d.ts +2037 -0
- package/dist/lib/constants.js +1659 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/dictionary.d.ts +371 -0
- package/dist/lib/dictionary.js +406 -0
- package/dist/lib/dictionary.js.map +1 -0
- package/dist/lib/error.d.ts +216 -0
- package/dist/lib/error.js +254 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/filter-context.d.ts +445 -0
- package/dist/lib/filter-context.js +505 -0
- package/dist/lib/filter-context.js.map +1 -0
- package/dist/lib/filter-graph.d.ts +556 -0
- package/dist/lib/filter-graph.js +608 -0
- package/dist/lib/filter-graph.js.map +1 -0
- package/dist/lib/filter-inout.d.ts +205 -0
- package/dist/lib/filter-inout.js +264 -0
- package/dist/lib/filter-inout.js.map +1 -0
- package/dist/lib/filter.d.ts +231 -0
- package/dist/lib/filter.js +260 -0
- package/dist/lib/filter.js.map +1 -0
- package/dist/lib/format-context.d.ts +798 -0
- package/dist/lib/format-context.js +845 -0
- package/dist/lib/format-context.js.map +1 -0
- package/dist/lib/frame.d.ts +784 -0
- package/dist/lib/frame.js +933 -0
- package/dist/lib/frame.js.map +1 -0
- package/dist/lib/hardware-device-context.d.ts +407 -0
- package/dist/lib/hardware-device-context.js +429 -0
- package/dist/lib/hardware-device-context.js.map +1 -0
- package/dist/lib/hardware-frames-context.d.ts +374 -0
- package/dist/lib/hardware-frames-context.js +430 -0
- package/dist/lib/hardware-frames-context.js.map +1 -0
- package/dist/lib/index.d.ts +31 -0
- package/dist/lib/index.js +54 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/input-format.d.ts +216 -0
- package/dist/lib/input-format.js +246 -0
- package/dist/lib/input-format.js.map +1 -0
- package/dist/lib/io-context.d.ts +495 -0
- package/dist/lib/io-context.js +550 -0
- package/dist/lib/io-context.js.map +1 -0
- package/dist/lib/log.d.ts +201 -0
- package/dist/lib/log.js +219 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/native-types.d.ts +719 -0
- package/dist/lib/native-types.js +2 -0
- package/dist/lib/native-types.js.map +1 -0
- package/dist/lib/option.d.ts +589 -0
- package/dist/lib/option.js +853 -0
- package/dist/lib/option.js.map +1 -0
- package/dist/lib/output-format.d.ts +179 -0
- package/dist/lib/output-format.js +205 -0
- package/dist/lib/output-format.js.map +1 -0
- package/dist/lib/packet.d.ts +487 -0
- package/dist/lib/packet.js +558 -0
- package/dist/lib/packet.js.map +1 -0
- package/dist/lib/rational.d.ts +210 -0
- package/dist/lib/rational.js +233 -0
- package/dist/lib/rational.js.map +1 -0
- package/dist/lib/software-resample-context.d.ts +572 -0
- package/dist/lib/software-resample-context.js +610 -0
- package/dist/lib/software-resample-context.js.map +1 -0
- package/dist/lib/software-scale-context.d.ts +290 -0
- package/dist/lib/software-scale-context.js +308 -0
- package/dist/lib/software-scale-context.js.map +1 -0
- package/dist/lib/stream.d.ts +322 -0
- package/dist/lib/stream.js +408 -0
- package/dist/lib/stream.js.map +1 -0
- package/dist/lib/types.d.ts +59 -0
- package/dist/lib/types.js +8 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utilities.d.ts +346 -0
- package/dist/lib/utilities.js +424 -0
- package/dist/lib/utilities.js.map +1 -0
- package/install/check.js +113 -0
- package/install/ffmpeg.js +163 -0
- package/package.json +107 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-context.js","sourceRoot":"","sources":["../../src/lib/codec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE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SAAS,EAAE,IAAI,IAAI,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,KAAK,CAAC,aAAa,CAAC,MAAc;QAChC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,sBAAsB,CAAC,QAAuB,EAAE,QAAwB;QACtE,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { Rational } from './rational.js';
|
|
2
|
+
import type { CodecContext } from './codec-context.js';
|
|
3
|
+
import type { AVChromaLocation, AVCodecID, AVColorPrimaries, AVColorRange, AVColorSpace, AVColorTransferCharacteristic, AVMediaType, AVPixelFormat, AVProfile, AVSampleFormat } from './constants.js';
|
|
4
|
+
import type { NativeCodecParameters, NativeWrapper } from './native-types.js';
|
|
5
|
+
import type { ChannelLayout } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Codec parameters for stream configuration.
|
|
8
|
+
*
|
|
9
|
+
* Describes the properties of an encoded media stream.
|
|
10
|
+
* Used to transfer codec parameters between contexts and streams.
|
|
11
|
+
* Contains essential information like codec type, dimensions, and format.
|
|
12
|
+
*
|
|
13
|
+
* Direct mapping to FFmpeg's AVCodecParameters.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import { CodecParameters, FFmpegError } from 'node-av';
|
|
18
|
+
* import { AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_H264, AV_PIX_FMT_YUV420P } from 'node-av/constants';
|
|
19
|
+
*
|
|
20
|
+
* // Create and allocate codec parameters
|
|
21
|
+
* const params = new CodecParameters();
|
|
22
|
+
* params.alloc();
|
|
23
|
+
*
|
|
24
|
+
* // Copy parameters from a codec context
|
|
25
|
+
* const ret = params.fromContext(codecContext);
|
|
26
|
+
* FFmpegError.throwIfError(ret, 'fromContext');
|
|
27
|
+
*
|
|
28
|
+
* // Set video parameters manually
|
|
29
|
+
* params.codecType = AVMEDIA_TYPE_VIDEO;
|
|
30
|
+
* params.codecId = AV_CODEC_ID_H264;
|
|
31
|
+
* params.width = 1920;
|
|
32
|
+
* params.height = 1080;
|
|
33
|
+
* params.format = AV_PIX_FMT_YUV420P;
|
|
34
|
+
*
|
|
35
|
+
* // Apply parameters to another codec context
|
|
36
|
+
* const ret2 = params.toContext(otherCodecContext);
|
|
37
|
+
* FFmpegError.throwIfError(ret2, 'toContext');
|
|
38
|
+
*
|
|
39
|
+
* // Copy to another parameters struct
|
|
40
|
+
* const params2 = new CodecParameters();
|
|
41
|
+
* params2.alloc();
|
|
42
|
+
* const copyRet = params.copy(params2);
|
|
43
|
+
* FFmpegError.throwIfError(copyRet, 'copy');
|
|
44
|
+
*
|
|
45
|
+
* // Clean up
|
|
46
|
+
* params.free();
|
|
47
|
+
* params2.free();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class CodecParameters implements NativeWrapper<NativeCodecParameters> {
|
|
51
|
+
private native;
|
|
52
|
+
/**
|
|
53
|
+
* Create new codec parameters.
|
|
54
|
+
*
|
|
55
|
+
* The parameters are uninitialized - you must call alloc() before use.
|
|
56
|
+
* No FFmpeg resources are allocated until alloc() is called.
|
|
57
|
+
*
|
|
58
|
+
* Direct wrapper around AVCodecParameters.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* import { CodecParameters } from 'node-av';
|
|
63
|
+
*
|
|
64
|
+
* const params = new CodecParameters();
|
|
65
|
+
* params.alloc();
|
|
66
|
+
* // Parameters are now ready for use
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
constructor();
|
|
70
|
+
/**
|
|
71
|
+
* General type of the encoded data.
|
|
72
|
+
*
|
|
73
|
+
* Identifies the media type (video, audio, subtitle, etc.).
|
|
74
|
+
*
|
|
75
|
+
* Direct mapping to AVCodecParameters->codec_type
|
|
76
|
+
*/
|
|
77
|
+
get codecType(): AVMediaType;
|
|
78
|
+
set codecType(value: AVMediaType);
|
|
79
|
+
/**
|
|
80
|
+
* Specific type of the encoded data.
|
|
81
|
+
*
|
|
82
|
+
* Identifies the exact codec (H.264, AAC, etc.).
|
|
83
|
+
*
|
|
84
|
+
* Direct mapping to AVCodecParameters->codec_id
|
|
85
|
+
*/
|
|
86
|
+
get codecId(): AVCodecID;
|
|
87
|
+
set codecId(value: AVCodecID);
|
|
88
|
+
/**
|
|
89
|
+
* Codec tag.
|
|
90
|
+
*
|
|
91
|
+
* Direct mapping to AVCodecParameters->codec_tag
|
|
92
|
+
* Additional information about the codec (corresponds to the AVI FOURCC).
|
|
93
|
+
*/
|
|
94
|
+
get codecTag(): number;
|
|
95
|
+
set codecTag(value: number);
|
|
96
|
+
/**
|
|
97
|
+
* Extra binary data needed for initializing the decoder.
|
|
98
|
+
*
|
|
99
|
+
* Direct mapping to AVCodecParameters->extradata
|
|
100
|
+
* The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger
|
|
101
|
+
* than extradata_size to avoid problems if it is read with the bitstream reader.
|
|
102
|
+
* The bytewise contents of extradata must not depend on the architecture or CPU endianness.
|
|
103
|
+
* Must be allocated with the av_malloc() family of functions.
|
|
104
|
+
*/
|
|
105
|
+
get extradata(): Buffer | null;
|
|
106
|
+
set extradata(value: Buffer | null);
|
|
107
|
+
/**
|
|
108
|
+
* Size of the extradata content in bytes.
|
|
109
|
+
*
|
|
110
|
+
* Direct mapping to AVCodecParameters->extradata_size
|
|
111
|
+
*/
|
|
112
|
+
get extradataSize(): number;
|
|
113
|
+
/**
|
|
114
|
+
* Format of the encoded data.
|
|
115
|
+
* - video: the pixel format (AVPixelFormat)
|
|
116
|
+
* - audio: the sample format (AVSampleFormat)
|
|
117
|
+
*/
|
|
118
|
+
get format(): AVPixelFormat | AVSampleFormat;
|
|
119
|
+
set format(value: AVPixelFormat | AVSampleFormat);
|
|
120
|
+
/**
|
|
121
|
+
* The average bitrate of the encoded data (in bits per second).
|
|
122
|
+
*/
|
|
123
|
+
get bitRate(): bigint;
|
|
124
|
+
set bitRate(value: bigint);
|
|
125
|
+
/**
|
|
126
|
+
* Codec-specific bitstream restrictions that the stream conforms to.
|
|
127
|
+
* FF_PROFILE_H264_BASELINE, FF_PROFILE_H264_MAIN, etc.
|
|
128
|
+
*/
|
|
129
|
+
get profile(): AVProfile;
|
|
130
|
+
set profile(value: AVProfile);
|
|
131
|
+
/**
|
|
132
|
+
* Level of the bitstream.
|
|
133
|
+
* FF_LEVEL_UNKNOWN or codec-specific values.
|
|
134
|
+
*/
|
|
135
|
+
get level(): number;
|
|
136
|
+
set level(value: number);
|
|
137
|
+
/**
|
|
138
|
+
* Video frame width in pixels.
|
|
139
|
+
*
|
|
140
|
+
* Direct mapping to AVCodecParameters->width
|
|
141
|
+
*/
|
|
142
|
+
get width(): number;
|
|
143
|
+
set width(value: number);
|
|
144
|
+
/**
|
|
145
|
+
* Video frame height in pixels.
|
|
146
|
+
*
|
|
147
|
+
* Direct mapping to AVCodecParameters->height
|
|
148
|
+
*/
|
|
149
|
+
get height(): number;
|
|
150
|
+
set height(value: number);
|
|
151
|
+
/**
|
|
152
|
+
* The pixel aspect ratio (width / height) which a single pixel should have when displayed.
|
|
153
|
+
*
|
|
154
|
+
* When the aspect ratio is unknown / undefined, the numerator should be set to 0
|
|
155
|
+
* (the denominator may have any value).
|
|
156
|
+
*/
|
|
157
|
+
get sampleAspectRatio(): Rational;
|
|
158
|
+
set sampleAspectRatio(value: Rational);
|
|
159
|
+
/**
|
|
160
|
+
* Video only. The framerate of the video.
|
|
161
|
+
* This is the fundamental unit of time (in seconds) in terms
|
|
162
|
+
* of which frame timestamps are represented.
|
|
163
|
+
*/
|
|
164
|
+
get frameRate(): Rational;
|
|
165
|
+
set frameRate(value: Rational);
|
|
166
|
+
/**
|
|
167
|
+
* Video only. Additional colorspace characteristics.
|
|
168
|
+
* AVCOL_RANGE_MPEG, AVCOL_RANGE_JPEG, etc.
|
|
169
|
+
*/
|
|
170
|
+
get colorRange(): AVColorRange;
|
|
171
|
+
set colorRange(value: AVColorRange);
|
|
172
|
+
/**
|
|
173
|
+
* Chromaticity coordinates of the source primaries.
|
|
174
|
+
* AVCOL_PRI_BT709, AVCOL_PRI_BT2020, etc.
|
|
175
|
+
*/
|
|
176
|
+
get colorPrimaries(): AVColorPrimaries;
|
|
177
|
+
set colorPrimaries(value: AVColorPrimaries);
|
|
178
|
+
/**
|
|
179
|
+
* Color Transfer Characteristic.
|
|
180
|
+
* AVCOL_TRC_BT709, AVCOL_TRC_SMPTE2084, etc.
|
|
181
|
+
*/
|
|
182
|
+
get colorTrc(): AVColorTransferCharacteristic;
|
|
183
|
+
set colorTrc(value: AVColorTransferCharacteristic);
|
|
184
|
+
/**
|
|
185
|
+
* YUV colorspace type.
|
|
186
|
+
* AVCOL_SPC_BT709, AVCOL_SPC_BT2020_NCL, etc.
|
|
187
|
+
*/
|
|
188
|
+
get colorSpace(): AVColorSpace;
|
|
189
|
+
set colorSpace(value: AVColorSpace);
|
|
190
|
+
/**
|
|
191
|
+
* Location of chroma samples.
|
|
192
|
+
* AVCHROMA_LOC_LEFT, AVCHROMA_LOC_CENTER, etc.
|
|
193
|
+
*/
|
|
194
|
+
get chromaLocation(): AVChromaLocation;
|
|
195
|
+
set chromaLocation(value: AVChromaLocation);
|
|
196
|
+
/**
|
|
197
|
+
* Audio channel layout.
|
|
198
|
+
* @deprecated use ch_layout
|
|
199
|
+
*/
|
|
200
|
+
get channelLayout(): ChannelLayout;
|
|
201
|
+
set channelLayout(value: ChannelLayout);
|
|
202
|
+
/**
|
|
203
|
+
* Audio only. The number of audio channels.
|
|
204
|
+
* @deprecated use ch_layout.nb_channels
|
|
205
|
+
*/
|
|
206
|
+
get channels(): number;
|
|
207
|
+
set channels(value: number);
|
|
208
|
+
/**
|
|
209
|
+
* Audio sample rate.
|
|
210
|
+
*
|
|
211
|
+
* Direct mapping to AVCodecParameters->sample_rate
|
|
212
|
+
* The number of audio samples per second.
|
|
213
|
+
*/
|
|
214
|
+
get sampleRate(): number;
|
|
215
|
+
set sampleRate(value: number);
|
|
216
|
+
/**
|
|
217
|
+
* Allocate a new AVCodecParameters and set its fields to default values.
|
|
218
|
+
*
|
|
219
|
+
* Allocates the parameters structure and initializes with defaults.
|
|
220
|
+
* Must be called before using the parameters.
|
|
221
|
+
*
|
|
222
|
+
* Direct mapping to avcodec_parameters_alloc()
|
|
223
|
+
*
|
|
224
|
+
* @throws {Error} Memory allocation failure (ENOMEM)
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* import { CodecParameters } from 'node-av';
|
|
229
|
+
*
|
|
230
|
+
* const params = new CodecParameters();
|
|
231
|
+
* params.alloc();
|
|
232
|
+
* // Parameters are now allocated with default values
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* @see {@link free} To free the parameters
|
|
236
|
+
*/
|
|
237
|
+
alloc(): void;
|
|
238
|
+
/**
|
|
239
|
+
* Free the codec parameters and everything associated with it.
|
|
240
|
+
*
|
|
241
|
+
* Releases all resources associated with the parameters.
|
|
242
|
+
* The parameters become invalid after this call.
|
|
243
|
+
*
|
|
244
|
+
* Direct mapping to avcodec_parameters_free()
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* params.free();
|
|
249
|
+
* // params is now invalid and should not be used
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
free(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Copy the contents of this CodecParameters to dst.
|
|
255
|
+
*
|
|
256
|
+
* Copies all parameter values to the destination.
|
|
257
|
+
* Any allocated fields in dst are freed and replaced with newly allocated duplicates.
|
|
258
|
+
*
|
|
259
|
+
* Direct mapping to avcodec_parameters_copy()
|
|
260
|
+
*
|
|
261
|
+
* @param dst - Destination CodecParameters. Must be allocated.
|
|
262
|
+
*
|
|
263
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
264
|
+
* - 0: Success
|
|
265
|
+
* - AVERROR(ENOMEM): Memory allocation failure
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```typescript
|
|
269
|
+
* import { CodecParameters, FFmpegError } from 'node-av';
|
|
270
|
+
*
|
|
271
|
+
* const src = new CodecParameters();
|
|
272
|
+
* src.alloc();
|
|
273
|
+
* // ... set up src parameters ...
|
|
274
|
+
*
|
|
275
|
+
* const dst = new CodecParameters();
|
|
276
|
+
* dst.alloc();
|
|
277
|
+
* const ret = src.copy(dst);
|
|
278
|
+
* FFmpegError.throwIfError(ret, 'copy');
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* @see {@link fromContext} To copy from codec context
|
|
282
|
+
* @see {@link toContext} To copy to codec context
|
|
283
|
+
*/
|
|
284
|
+
copy(dst: CodecParameters): number;
|
|
285
|
+
/**
|
|
286
|
+
* Fill this parameters struct based on the values from the supplied codec context.
|
|
287
|
+
*
|
|
288
|
+
* Copies codec parameters from a codec context to this parameters struct.
|
|
289
|
+
* Any allocated fields are freed and replaced with duplicates.
|
|
290
|
+
*
|
|
291
|
+
* Direct mapping to avcodec_parameters_from_context()
|
|
292
|
+
*
|
|
293
|
+
* @param codecContext - Source CodecContext to copy from
|
|
294
|
+
*
|
|
295
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
296
|
+
* - 0: Success
|
|
297
|
+
* - AVERROR(EINVAL): Invalid codec context
|
|
298
|
+
* - AVERROR(ENOMEM): Memory allocation failure
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```typescript
|
|
302
|
+
* import { FFmpegError } from 'node-av';
|
|
303
|
+
*
|
|
304
|
+
* // Copy encoder parameters to stream
|
|
305
|
+
* const ret = outputStream.codecpar.fromContext(encoderContext);
|
|
306
|
+
* FFmpegError.throwIfError(ret, 'fromContext');
|
|
307
|
+
* ```
|
|
308
|
+
*
|
|
309
|
+
* @see {@link toContext} To copy in the opposite direction
|
|
310
|
+
*/
|
|
311
|
+
fromContext(codecContext: CodecContext): number;
|
|
312
|
+
/**
|
|
313
|
+
* Fill the codec context based on the values from this codec parameters.
|
|
314
|
+
*
|
|
315
|
+
* Copies parameters from this struct to a codec context.
|
|
316
|
+
* Any allocated fields in the codec context are freed and replaced with duplicates.
|
|
317
|
+
*
|
|
318
|
+
* Direct mapping to avcodec_parameters_to_context()
|
|
319
|
+
*
|
|
320
|
+
* @param codecContext - Destination CodecContext to copy to
|
|
321
|
+
*
|
|
322
|
+
* @returns 0 on success, negative AVERROR on error:
|
|
323
|
+
* - 0: Success
|
|
324
|
+
* - AVERROR(EINVAL): Invalid codec context
|
|
325
|
+
* - AVERROR(ENOMEM): Memory allocation failure
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* import { FFmpegError } from 'node-av';
|
|
330
|
+
*
|
|
331
|
+
* // Copy stream parameters to decoder
|
|
332
|
+
* const ret = inputStream.codecpar.toContext(decoderContext);
|
|
333
|
+
* FFmpegError.throwIfError(ret, 'toContext');
|
|
334
|
+
* ```
|
|
335
|
+
*
|
|
336
|
+
* @see {@link fromContext} To copy in the opposite direction
|
|
337
|
+
*/
|
|
338
|
+
toContext(codecContext: CodecContext): number;
|
|
339
|
+
/**
|
|
340
|
+
* Get the native FFmpeg AVCodecParameters pointer.
|
|
341
|
+
*
|
|
342
|
+
* @internal For use by other wrapper classes
|
|
343
|
+
* @returns The underlying native codec parameters object
|
|
344
|
+
*/
|
|
345
|
+
getNative(): NativeCodecParameters;
|
|
346
|
+
/**
|
|
347
|
+
* Dispose of the codec parameters.
|
|
348
|
+
*
|
|
349
|
+
* Implements the Disposable interface for automatic cleanup.
|
|
350
|
+
* Equivalent to calling free().
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```typescript
|
|
354
|
+
* {
|
|
355
|
+
* using params = new CodecParameters();
|
|
356
|
+
* params.alloc();
|
|
357
|
+
* // ... use parameters
|
|
358
|
+
* } // Automatically freed when leaving scope
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
[Symbol.dispose](): void;
|
|
362
|
+
}
|