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/api/decoder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../../src/api/decoder.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"decoder.js","sourceRoot":"","sources":["../../src/api/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAM1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,OAAO,OAAO;IACV,YAAY,CAAe;IAC3B,KAAK,CAAQ;IACb,WAAW,CAAS;IACpB,MAAM,CAAS;IACf,MAAM,G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Ae;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACK,KAAK,CAAC,oBAAoB;QAChC,4BAA4B;QAC5B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAEnB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE7D,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;YACd,oDAAoD;YACpD,gFAAgF;YAEhF,qCAAqC;YACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;aAAM,IAAI,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACzD,kCAAkC;YAClC,OAAO,IAAI,CAAC;QACd,CAAC;aAAM,CAAC;YACN,QAAQ;YACR,WAAW,CAAC,YAAY,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;QACd,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF"}
|
package/dist/api/encoder.d.ts
CHANGED
|
@@ -1,298 +1,394 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* parameter configuration, and packet management.
|
|
6
|
-
*
|
|
7
|
-
* Handles codec initialization, frame encoding, and packet output.
|
|
8
|
-
* Supports hardware acceleration and zero-copy transcoding.
|
|
9
|
-
*
|
|
10
|
-
* @module api/encoder
|
|
11
|
-
*/
|
|
12
|
-
import { CodecContext, Packet } from '../lib/index.js';
|
|
13
|
-
import { Stream } from '../lib/stream.js';
|
|
14
|
-
import type { AVPixelFormat, Frame } from '../lib/index.js';
|
|
1
|
+
import { Codec, CodecContext, Packet } from '../lib/index.js';
|
|
2
|
+
import type { AVCodecID } from '../constants/constants.js';
|
|
3
|
+
import type { FFEncoderCodec } from '../constants/encoders.js';
|
|
4
|
+
import type { Frame } from '../lib/index.js';
|
|
15
5
|
import type { EncoderOptions, StreamInfo } from './types.js';
|
|
16
6
|
/**
|
|
17
|
-
* High-level encoder for
|
|
18
|
-
*
|
|
19
|
-
* Handles codec initialization, frame encoding, and packet output.
|
|
20
|
-
* Supports various codecs with flexible configuration options.
|
|
7
|
+
* High-level encoder for audio and video streams.
|
|
21
8
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
9
|
+
* Provides a simplified interface for encoding media frames to packets.
|
|
10
|
+
* Handles codec initialization, hardware acceleration setup, and packet management.
|
|
11
|
+
* Supports both synchronous frame-by-frame encoding and async iteration over packets.
|
|
12
|
+
* Essential component in media processing pipelines for converting raw frames to compressed data.
|
|
24
13
|
*
|
|
25
14
|
* @example
|
|
26
15
|
* ```typescript
|
|
16
|
+
* import { Encoder } from 'node-av/api';
|
|
17
|
+
* import { AV_CODEC_ID_H264 } from 'node-av/constants';
|
|
18
|
+
*
|
|
27
19
|
* // Create H.264 encoder
|
|
28
20
|
* const encoder = await Encoder.create('libx264', {
|
|
21
|
+
* type: 'video',
|
|
29
22
|
* width: 1920,
|
|
30
23
|
* height: 1080,
|
|
31
|
-
* pixelFormat:
|
|
24
|
+
* pixelFormat: AV_PIX_FMT_YUV420P,
|
|
25
|
+
* timeBase: { num: 1, den: 30 },
|
|
26
|
+
* frameRate: { num: 30, den: 1 }
|
|
27
|
+
* }, {
|
|
32
28
|
* bitrate: '5M',
|
|
33
|
-
* gopSize: 60
|
|
34
|
-
* options: {
|
|
35
|
-
* preset: 'fast',
|
|
36
|
-
* crf: 23
|
|
37
|
-
* }
|
|
29
|
+
* gopSize: 60
|
|
38
30
|
* });
|
|
39
31
|
*
|
|
40
32
|
* // Encode frames
|
|
41
33
|
* const packet = await encoder.encode(frame);
|
|
42
34
|
* if (packet) {
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* // Flush encoder
|
|
47
|
-
* let packet;
|
|
48
|
-
* while ((packet = await encoder.flush()) !== null) {
|
|
49
|
-
* // Process final packets
|
|
35
|
+
* await output.writePacket(packet);
|
|
36
|
+
* packet.free();
|
|
50
37
|
* }
|
|
51
|
-
* encoder.close();
|
|
52
38
|
* ```
|
|
53
39
|
*
|
|
54
40
|
* @example
|
|
55
41
|
* ```typescript
|
|
56
|
-
* //
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
42
|
+
* // Hardware-accelerated encoding
|
|
43
|
+
* import { HardwareContext } from 'node-av/api';
|
|
44
|
+
* import { AV_HWDEVICE_TYPE_CUDA } from 'node-av/constants';
|
|
45
|
+
*
|
|
46
|
+
* const hw = HardwareContext.create(AV_HWDEVICE_TYPE_CUDA);
|
|
47
|
+
* const encoder = await Encoder.create('h264_nvenc', streamInfo, {
|
|
48
|
+
* hardware: hw,
|
|
49
|
+
* bitrate: '10M'
|
|
64
50
|
* });
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
51
|
+
*
|
|
52
|
+
* // Frames with hw_frames_ctx will be encoded on GPU
|
|
53
|
+
* for await (const packet of encoder.packets(frames)) {
|
|
54
|
+
* await output.writePacket(packet);
|
|
55
|
+
* packet.free();
|
|
56
|
+
* }
|
|
68
57
|
* ```
|
|
58
|
+
*
|
|
59
|
+
* @see {@link Decoder} For decoding packets to frames
|
|
60
|
+
* @see {@link MediaOutput} For writing encoded packets
|
|
61
|
+
* @see {@link HardwareContext} For GPU acceleration
|
|
69
62
|
*/
|
|
70
63
|
export declare class Encoder implements Disposable {
|
|
71
64
|
private codecContext;
|
|
72
65
|
private packet;
|
|
73
|
-
private
|
|
66
|
+
private codec;
|
|
74
67
|
private isOpen;
|
|
75
|
-
private supportedFormats;
|
|
76
|
-
private preferredFormat?;
|
|
77
68
|
private hardware?;
|
|
78
|
-
private isHardwareEncoder;
|
|
79
69
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* @param codecContext - Initialized codec context
|
|
85
|
-
* @param codecName - Name of the codec
|
|
86
|
-
* @param hardware - Optional hardware context for late framesContext binding
|
|
70
|
+
* @param codecContext - Configured codec context
|
|
71
|
+
* @param codec - Encoder codec
|
|
72
|
+
* @param hardware - Optional hardware context
|
|
73
|
+
* @internal
|
|
87
74
|
*/
|
|
88
75
|
private constructor();
|
|
89
76
|
/**
|
|
90
77
|
* Create an encoder with specified codec and options.
|
|
91
78
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
79
|
+
* Initializes an encoder with the appropriate codec and configuration.
|
|
80
|
+
* Automatically configures parameters based on input stream info.
|
|
81
|
+
* Handles hardware acceleration setup if provided.
|
|
94
82
|
*
|
|
95
|
-
*
|
|
96
|
-
* configures the context with provided options, and opens it.
|
|
97
|
-
* Handles hardware setup including shared frames context for zero-copy.
|
|
83
|
+
* Direct mapping to avcodec_find_encoder_by_name() or avcodec_find_encoder().
|
|
98
84
|
*
|
|
99
|
-
* @param
|
|
100
|
-
* @param input - Stream
|
|
85
|
+
* @param encoderCodec - Codec name, ID, or instance to use for encoding
|
|
86
|
+
* @param input - Stream information to configure encoder
|
|
101
87
|
* @param options - Encoder configuration options
|
|
88
|
+
* @returns Configured encoder instance
|
|
102
89
|
*
|
|
103
|
-
* @
|
|
104
|
-
*
|
|
105
|
-
* @throws {Error} If codec not found or configuration fails
|
|
90
|
+
* @throws {Error} If encoder not found or unsupported format
|
|
91
|
+
* @throws {FFmpegError} If codec initialization fails
|
|
106
92
|
*
|
|
107
93
|
* @example
|
|
108
94
|
* ```typescript
|
|
109
|
-
* //
|
|
110
|
-
* const
|
|
111
|
-
* const
|
|
95
|
+
* // From decoder stream info
|
|
96
|
+
* const streamInfo = decoder.getOutputStreamInfo();
|
|
97
|
+
* const encoder = await Encoder.create('libx264', streamInfo, {
|
|
112
98
|
* bitrate: '5M',
|
|
113
|
-
* gopSize: 60
|
|
99
|
+
* gopSize: 60,
|
|
100
|
+
* options: {
|
|
101
|
+
* preset: 'fast',
|
|
102
|
+
* crf: '23'
|
|
103
|
+
* }
|
|
114
104
|
* });
|
|
105
|
+
* ```
|
|
115
106
|
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* // With custom stream info
|
|
110
|
+
* const encoder = await Encoder.create('aac', {
|
|
111
|
+
* type: 'audio',
|
|
112
|
+
* sampleRate: 48000,
|
|
113
|
+
* sampleFormat: AV_SAMPLE_FMT_FLTP,
|
|
114
|
+
* channelLayout: AV_CH_LAYOUT_STEREO,
|
|
115
|
+
* timeBase: { num: 1, den: 48000 }
|
|
116
|
+
* }, {
|
|
119
117
|
* bitrate: '192k'
|
|
120
118
|
* });
|
|
119
|
+
* ```
|
|
121
120
|
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* // Hardware encoder
|
|
124
|
+
* const hw = HardwareContext.auto();
|
|
125
|
+
* const encoder = await Encoder.create('hevc_videotoolbox', streamInfo, {
|
|
126
|
+
* hardware: hw,
|
|
127
|
+
* bitrate: '8M'
|
|
128
|
+
* });
|
|
122
129
|
* ```
|
|
130
|
+
*
|
|
131
|
+
* @see {@link Decoder.getOutputStreamInfo} For stream info source
|
|
132
|
+
* @see {@link EncoderOptions} For configuration options
|
|
123
133
|
*/
|
|
124
|
-
static create(
|
|
134
|
+
static create(encoderCodec: FFEncoderCodec | AVCodecID | Codec, input: StreamInfo, options?: EncoderOptions): Promise<Encoder>;
|
|
125
135
|
/**
|
|
126
136
|
* Check if encoder is open.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* if (encoder.isEncoderOpen) {
|
|
141
|
+
* const packet = await encoder.encode(frame);
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
127
144
|
*/
|
|
128
145
|
get isEncoderOpen(): boolean;
|
|
129
146
|
/**
|
|
130
|
-
*
|
|
147
|
+
* Check if encoder uses hardware acceleration.
|
|
148
|
+
*
|
|
149
|
+
* @returns true if hardware-accelerated
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* if (encoder.isHardware()) {
|
|
154
|
+
* console.log('Using GPU acceleration');
|
|
155
|
+
* }
|
|
156
|
+
* ```
|
|
131
157
|
*
|
|
132
|
-
*
|
|
133
|
-
|
|
158
|
+
* @see {@link HardwareContext} For hardware setup
|
|
159
|
+
*/
|
|
160
|
+
isHardware(): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Encode a frame to a packet.
|
|
134
163
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
164
|
+
* Sends a frame to the encoder and attempts to receive an encoded packet.
|
|
165
|
+
* Handles internal buffering - may return null if more frames needed.
|
|
166
|
+
* Automatically manages encoder state and hardware context binding.
|
|
137
167
|
*
|
|
138
|
-
*
|
|
168
|
+
* Direct mapping to avcodec_send_frame() and avcodec_receive_packet().
|
|
139
169
|
*
|
|
140
|
-
* @
|
|
170
|
+
* @param frame - Raw frame to encode (or null to flush)
|
|
171
|
+
* @returns Encoded packet or null if more data needed
|
|
141
172
|
*
|
|
142
|
-
* @throws {Error} If encoder is closed
|
|
173
|
+
* @throws {Error} If encoder is closed
|
|
174
|
+
* @throws {FFmpegError} If encoding fails
|
|
143
175
|
*
|
|
144
176
|
* @example
|
|
145
177
|
* ```typescript
|
|
146
178
|
* const packet = await encoder.encode(frame);
|
|
147
179
|
* if (packet) {
|
|
148
|
-
*
|
|
180
|
+
* console.log(`Encoded packet with PTS: ${packet.pts}`);
|
|
149
181
|
* await output.writePacket(packet);
|
|
182
|
+
* packet.free();
|
|
150
183
|
* }
|
|
151
184
|
* ```
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* // Encode loop
|
|
189
|
+
* for await (const frame of decoder.frames(input.packets())) {
|
|
190
|
+
* const packet = await encoder.encode(frame);
|
|
191
|
+
* if (packet) {
|
|
192
|
+
* await output.writePacket(packet);
|
|
193
|
+
* packet.free();
|
|
194
|
+
* }
|
|
195
|
+
* frame.free();
|
|
196
|
+
* }
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* @see {@link packets} For automatic frame iteration
|
|
200
|
+
* @see {@link flush} For end-of-stream handling
|
|
152
201
|
*/
|
|
153
202
|
encode(frame: Frame | null): Promise<Packet | null>;
|
|
154
203
|
/**
|
|
155
|
-
*
|
|
204
|
+
* Encode frame stream to packet stream.
|
|
156
205
|
*
|
|
157
|
-
*
|
|
158
|
-
* Automatically
|
|
159
|
-
*
|
|
206
|
+
* High-level async generator for complete encoding pipeline.
|
|
207
|
+
* Automatically manages frame memory, encoder state,
|
|
208
|
+
* and flushes buffered packets at end.
|
|
209
|
+
* Primary interface for stream-based encoding.
|
|
160
210
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* Input frames are automatically freed after processing.
|
|
166
|
-
*
|
|
167
|
-
* @param frames - Async iterable of frames to encode (will be freed automatically)
|
|
211
|
+
* @param frames - Async iterable of frames (freed automatically)
|
|
212
|
+
* @yields Encoded packets (caller must free)
|
|
213
|
+
* @throws {Error} If encoder is closed
|
|
214
|
+
* @throws {FFmpegError} If encoding fails
|
|
168
215
|
*
|
|
169
|
-
* @
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* // Basic encoding pipeline
|
|
219
|
+
* for await (const packet of encoder.packets(decoder.frames(input.packets()))) {
|
|
220
|
+
* await output.writePacket(packet);
|
|
221
|
+
* packet.free(); // Must free output packets
|
|
222
|
+
* }
|
|
223
|
+
* ```
|
|
170
224
|
*
|
|
171
225
|
* @example
|
|
172
226
|
* ```typescript
|
|
173
|
-
* //
|
|
174
|
-
*
|
|
227
|
+
* // With frame filtering
|
|
228
|
+
* async function* filteredFrames() {
|
|
229
|
+
* for await (const frame of decoder.frames(input.packets())) {
|
|
230
|
+
* await filter.filterFrame(frame);
|
|
231
|
+
* const filtered = await filter.getFrame();
|
|
232
|
+
* if (filtered) {
|
|
233
|
+
* yield filtered;
|
|
234
|
+
* }
|
|
235
|
+
* }
|
|
236
|
+
* }
|
|
237
|
+
*
|
|
238
|
+
* for await (const packet of encoder.packets(filteredFrames())) {
|
|
175
239
|
* await output.writePacket(packet);
|
|
176
|
-
* packet.free();
|
|
240
|
+
* packet.free();
|
|
177
241
|
* }
|
|
178
242
|
* ```
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* ```typescript
|
|
246
|
+
* // Pipeline integration
|
|
247
|
+
* import { pipeline } from 'node-av/api';
|
|
248
|
+
*
|
|
249
|
+
* const control = pipeline(
|
|
250
|
+
* input,
|
|
251
|
+
* decoder,
|
|
252
|
+
* encoder,
|
|
253
|
+
* output
|
|
254
|
+
* );
|
|
255
|
+
* await control.completion;
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @see {@link encode} For single frame encoding
|
|
259
|
+
* @see {@link Decoder.frames} For frame source
|
|
179
260
|
*/
|
|
180
261
|
packets(frames: AsyncIterable<Frame>): AsyncGenerator<Packet>;
|
|
181
262
|
/**
|
|
182
|
-
* Flush encoder and get
|
|
263
|
+
* Flush encoder and get buffered packet.
|
|
183
264
|
*
|
|
184
|
-
*
|
|
185
|
-
* Call repeatedly until
|
|
265
|
+
* Signals end-of-stream and retrieves remaining packets.
|
|
266
|
+
* Call repeatedly until null to get all buffered packets.
|
|
267
|
+
* Essential for ensuring all frames are encoded.
|
|
186
268
|
*
|
|
187
|
-
*
|
|
188
|
-
* Retrieves buffered packets from the encoder.
|
|
269
|
+
* Direct mapping to avcodec_send_frame(NULL).
|
|
189
270
|
*
|
|
190
|
-
* @returns
|
|
271
|
+
* @returns Buffered packet or null if none remaining
|
|
191
272
|
*
|
|
192
273
|
* @throws {Error} If encoder is closed
|
|
193
274
|
*
|
|
194
275
|
* @example
|
|
195
276
|
* ```typescript
|
|
196
|
-
* // Flush
|
|
277
|
+
* // Flush remaining packets
|
|
197
278
|
* let packet;
|
|
198
279
|
* while ((packet = await encoder.flush()) !== null) {
|
|
199
|
-
*
|
|
280
|
+
* console.log('Got buffered packet');
|
|
200
281
|
* await output.writePacket(packet);
|
|
282
|
+
* packet.free();
|
|
201
283
|
* }
|
|
202
284
|
* ```
|
|
285
|
+
*
|
|
286
|
+
* @see {@link flushPackets} For async iteration
|
|
287
|
+
* @see {@link packets} For complete encoding pipeline
|
|
203
288
|
*/
|
|
204
289
|
flush(): Promise<Packet | null>;
|
|
205
290
|
/**
|
|
206
|
-
* Flush
|
|
207
|
-
*
|
|
208
|
-
* More convenient than calling flush() in a loop.
|
|
209
|
-
* Automatically sends flush signal and yields all buffered packets.
|
|
291
|
+
* Flush all buffered packets as async generator.
|
|
210
292
|
*
|
|
211
|
-
*
|
|
293
|
+
* Convenient async iteration over remaining packets.
|
|
294
|
+
* Automatically handles repeated flush calls.
|
|
295
|
+
* Useful for end-of-stream processing.
|
|
212
296
|
*
|
|
297
|
+
* @yields Buffered packets
|
|
213
298
|
* @throws {Error} If encoder is closed
|
|
214
299
|
*
|
|
215
300
|
* @example
|
|
216
301
|
* ```typescript
|
|
217
|
-
* //
|
|
302
|
+
* // Flush at end of encoding
|
|
218
303
|
* for await (const packet of encoder.flushPackets()) {
|
|
219
|
-
*
|
|
220
|
-
*
|
|
304
|
+
* console.log('Processing buffered packet');
|
|
305
|
+
* await output.writePacket(packet);
|
|
306
|
+
* packet.free();
|
|
221
307
|
* }
|
|
222
308
|
* ```
|
|
309
|
+
*
|
|
310
|
+
* @see {@link flush} For single packet flush
|
|
311
|
+
* @see {@link packets} For complete pipeline
|
|
223
312
|
*/
|
|
224
313
|
flushPackets(): AsyncGenerator<Packet>;
|
|
225
314
|
/**
|
|
226
315
|
* Close encoder and free resources.
|
|
227
316
|
*
|
|
228
|
-
*
|
|
317
|
+
* Releases codec context and internal packet buffer.
|
|
318
|
+
* Safe to call multiple times.
|
|
319
|
+
* Does NOT dispose hardware context - caller is responsible.
|
|
320
|
+
* Automatically called by Symbol.dispose.
|
|
229
321
|
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
*
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
* Get codec context for advanced configuration.
|
|
240
|
-
*
|
|
241
|
-
* Use with caution - direct manipulation may cause issues.
|
|
242
|
-
*
|
|
243
|
-
* Provides access to the underlying AVCodecContext for advanced operations.
|
|
244
|
-
*
|
|
245
|
-
* @returns CodecContext or null if closed
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* const encoder = await Encoder.create('libx264', streamInfo);
|
|
325
|
+
* try {
|
|
326
|
+
* // Use encoder
|
|
327
|
+
* } finally {
|
|
328
|
+
* encoder.close();
|
|
329
|
+
* }
|
|
330
|
+
* ```
|
|
246
331
|
*
|
|
247
|
-
* @
|
|
332
|
+
* @see {@link Symbol.dispose} For automatic cleanup
|
|
248
333
|
*/
|
|
249
|
-
|
|
334
|
+
close(): void;
|
|
250
335
|
/**
|
|
251
|
-
* Get
|
|
336
|
+
* Get encoder codec.
|
|
252
337
|
*
|
|
253
|
-
* Returns the
|
|
338
|
+
* Returns the codec used by this encoder.
|
|
339
|
+
* Useful for checking codec capabilities and properties.
|
|
254
340
|
*
|
|
255
|
-
* @returns
|
|
341
|
+
* @returns Codec instance
|
|
256
342
|
*
|
|
257
343
|
* @example
|
|
258
344
|
* ```typescript
|
|
259
|
-
* const
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* }
|
|
345
|
+
* const codec = encoder.getCodec();
|
|
346
|
+
* console.log(`Using codec: ${codec.name}`);
|
|
347
|
+
* console.log(`Capabilities: ${codec.capabilities}`);
|
|
263
348
|
* ```
|
|
349
|
+
*
|
|
350
|
+
* @see {@link Codec} For codec properties
|
|
264
351
|
*/
|
|
265
|
-
|
|
352
|
+
getCodec(): Codec;
|
|
266
353
|
/**
|
|
267
|
-
* Get
|
|
354
|
+
* Get underlying codec context.
|
|
268
355
|
*
|
|
269
|
-
* Returns
|
|
356
|
+
* Returns the internal codec context for advanced operations.
|
|
357
|
+
* Returns null if encoder is closed.
|
|
270
358
|
*
|
|
271
|
-
* @returns
|
|
359
|
+
* @returns Codec context or null
|
|
272
360
|
*
|
|
273
|
-
* @
|
|
274
|
-
* ```typescript
|
|
275
|
-
* const formats = encoder.getSupportedPixelFormats();
|
|
276
|
-
* console.log(`Encoder supports: ${formats.join(', ')}`);
|
|
277
|
-
* ```
|
|
361
|
+
* @internal
|
|
278
362
|
*/
|
|
279
|
-
|
|
363
|
+
getCodecContext(): CodecContext | null;
|
|
280
364
|
/**
|
|
281
|
-
* Receive
|
|
365
|
+
* Receive packet from encoder.
|
|
366
|
+
*
|
|
367
|
+
* Internal method to get encoded packets from codec.
|
|
368
|
+
* Handles packet cloning and error checking.
|
|
282
369
|
*
|
|
283
|
-
*
|
|
370
|
+
* Direct mapping to avcodec_receive_packet().
|
|
284
371
|
*
|
|
285
|
-
*
|
|
286
|
-
* Clones the packet for the user to prevent internal buffer corruption.
|
|
372
|
+
* @returns Cloned packet or null
|
|
287
373
|
*
|
|
288
|
-
* @
|
|
374
|
+
* @throws {FFmpegError} If receive fails with error other than AVERROR_EAGAIN or AVERROR_EOF
|
|
289
375
|
*/
|
|
290
376
|
private receivePacket;
|
|
291
377
|
/**
|
|
292
|
-
*
|
|
378
|
+
* Dispose of encoder.
|
|
379
|
+
*
|
|
380
|
+
* Implements Disposable interface for automatic cleanup.
|
|
381
|
+
* Equivalent to calling close().
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```typescript
|
|
385
|
+
* {
|
|
386
|
+
* using encoder = await Encoder.create('libx264', streamInfo);
|
|
387
|
+
* // Encode frames...
|
|
388
|
+
* } // Automatically closed
|
|
389
|
+
* ```
|
|
293
390
|
*
|
|
294
|
-
*
|
|
295
|
-
* Calls close() to free all resources.
|
|
391
|
+
* @see {@link close} For manual cleanup
|
|
296
392
|
*/
|
|
297
393
|
[Symbol.dispose](): void;
|
|
298
394
|
}
|