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/media-output.js
CHANGED
|
@@ -1,66 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MediaOutput - Unified Output Handler for FFmpeg
|
|
3
|
-
*
|
|
4
|
-
* Provides a high-level interface for writing media to various destinations.
|
|
5
|
-
* Supports files, streams, and custom IO with automatic format configuration.
|
|
6
|
-
*
|
|
7
|
-
* Central entry point for all media output operations.
|
|
8
|
-
* Manages FormatContext lifecycle and provides stream management.
|
|
9
|
-
*
|
|
10
|
-
* @module api/media-output
|
|
11
|
-
*/
|
|
12
1
|
import { mkdir } from 'fs/promises';
|
|
13
2
|
import { dirname, resolve } from 'path';
|
|
14
|
-
import { AVFMT_FLAG_CUSTOM_IO, AVFMT_NOFILE, AVIO_FLAG_WRITE
|
|
3
|
+
import { AVFMT_FLAG_CUSTOM_IO, AVFMT_NOFILE, AVIO_FLAG_WRITE } from '../constants/constants.js';
|
|
4
|
+
import { FFmpegError, FormatContext, IOContext, Rational } from '../lib/index.js';
|
|
15
5
|
import { Encoder } from './encoder.js';
|
|
16
6
|
/**
|
|
17
|
-
*
|
|
7
|
+
* High-level media output for writing and muxing media files.
|
|
18
8
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* adding streams, writing packets, and finalizing output.
|
|
9
|
+
* Provides simplified access to media muxing and file writing operations.
|
|
10
|
+
* Handles stream configuration, packet writing, and format management.
|
|
11
|
+
* Supports files, URLs, and custom I/O with automatic cleanup.
|
|
12
|
+
* Essential component for media encoding pipelines and transcoding.
|
|
24
13
|
*
|
|
25
14
|
* @example
|
|
26
15
|
* ```typescript
|
|
27
|
-
* import { MediaOutput
|
|
16
|
+
* import { MediaOutput } from 'node-av/api';
|
|
28
17
|
*
|
|
29
|
-
* //
|
|
30
|
-
*
|
|
18
|
+
* // Create output file
|
|
19
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
31
20
|
*
|
|
32
|
-
* // Add
|
|
33
|
-
* const
|
|
34
|
-
*
|
|
35
|
-
* height: 1080,
|
|
36
|
-
* pixelFormat: AV_PIX_FMT_YUV420P
|
|
37
|
-
* });
|
|
38
|
-
* const streamIdx = output.addStream(encoder);
|
|
21
|
+
* // Add streams from encoders
|
|
22
|
+
* const videoIdx = output.addStream(videoEncoder);
|
|
23
|
+
* const audioIdx = output.addStream(audioEncoder);
|
|
39
24
|
*
|
|
40
|
-
* // Write header
|
|
25
|
+
* // Write header
|
|
41
26
|
* await output.writeHeader();
|
|
42
|
-
*
|
|
27
|
+
*
|
|
28
|
+
* // Write packets
|
|
29
|
+
* await output.writePacket(packet, videoIdx);
|
|
30
|
+
*
|
|
31
|
+
* // Write trailer and close
|
|
43
32
|
* await output.writeTrailer();
|
|
44
|
-
* await output.close();
|
|
45
33
|
* ```
|
|
46
34
|
*
|
|
47
35
|
* @example
|
|
48
36
|
* ```typescript
|
|
49
|
-
* // Stream copy
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* const videoStream = input.video();
|
|
54
|
-
* const streamIdx = output.addStream(videoStream);
|
|
37
|
+
* // Stream copy
|
|
38
|
+
* await using input = await MediaInput.open('input.mp4');
|
|
39
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
55
40
|
*
|
|
41
|
+
* // Copy stream configuration
|
|
42
|
+
* const videoIdx = output.addStream(input.video());
|
|
56
43
|
* await output.writeHeader();
|
|
44
|
+
*
|
|
57
45
|
* for await (const packet of input.packets()) {
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* }
|
|
46
|
+
* await output.writePacket(packet, videoIdx);
|
|
47
|
+
* packet.free();
|
|
61
48
|
* }
|
|
62
|
-
* await output.writeTrailer();
|
|
63
49
|
* ```
|
|
50
|
+
*
|
|
51
|
+
* @see {@link MediaInput} For reading media files
|
|
52
|
+
* @see {@link Encoder} For encoding frames to packets
|
|
53
|
+
* @see {@link FormatContext} For low-level API
|
|
64
54
|
*/
|
|
65
55
|
export class MediaOutput {
|
|
66
56
|
formatContext;
|
|
@@ -70,50 +60,63 @@ export class MediaOutput {
|
|
|
70
60
|
trailerWritten = false;
|
|
71
61
|
closed = false;
|
|
72
62
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* Initializes the output with a new FormatContext.
|
|
76
|
-
* The actual format setup happens in the static factory method.
|
|
63
|
+
* @internal
|
|
77
64
|
*/
|
|
78
65
|
constructor() {
|
|
79
66
|
this.formatContext = new FormatContext();
|
|
80
67
|
}
|
|
81
68
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* Creates a FormatContext and prepares the output for writing.
|
|
85
|
-
* Automatically detects format from filename/URL if not specified.
|
|
86
|
-
*
|
|
87
|
-
* If io callbacks is used, it creates a FormatContext with custom IO handling.
|
|
88
|
-
* Format must be explicitly specified for custom IO.
|
|
69
|
+
* Open media output for writing.
|
|
89
70
|
*
|
|
90
|
-
*
|
|
71
|
+
* Creates and configures output context for muxing.
|
|
72
|
+
* Automatically creates directories for file output.
|
|
73
|
+
* Supports files, URLs, and custom I/O callbacks.
|
|
91
74
|
*
|
|
92
|
-
*
|
|
93
|
-
* @param options - Optional configuration
|
|
75
|
+
* Direct mapping to avformat_alloc_output_context2() and avio_open2().
|
|
94
76
|
*
|
|
95
|
-
* @
|
|
77
|
+
* @param target - File path, URL, or I/O callbacks
|
|
78
|
+
* @param options - Output configuration options
|
|
79
|
+
* @returns Opened media output instance
|
|
96
80
|
*
|
|
97
|
-
* @throws {Error} If format
|
|
81
|
+
* @throws {Error} If format required for custom I/O
|
|
82
|
+
* @throws {FFmpegError} If allocation or opening fails
|
|
98
83
|
*
|
|
99
84
|
* @example
|
|
100
85
|
* ```typescript
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* seek: (offset, whence) => offset
|
|
104
|
-
* };
|
|
105
|
-
* const output = await MediaOutput.open(callbacks, { format: 'mp4' });
|
|
86
|
+
* // Create file output
|
|
87
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
106
88
|
* ```
|
|
107
89
|
*
|
|
108
90
|
* @example
|
|
109
91
|
* ```typescript
|
|
110
|
-
*
|
|
92
|
+
* // Create output with specific format
|
|
93
|
+
* await using output = await MediaOutput.open('output.ts', {
|
|
94
|
+
* format: 'mpegts'
|
|
95
|
+
* });
|
|
111
96
|
* ```
|
|
112
97
|
*
|
|
113
98
|
* @example
|
|
114
99
|
* ```typescript
|
|
115
|
-
*
|
|
100
|
+
* // Custom I/O callbacks
|
|
101
|
+
* const callbacks = {
|
|
102
|
+
* write: async (buffer: Buffer) => {
|
|
103
|
+
* // Write to custom destination
|
|
104
|
+
* return buffer.length;
|
|
105
|
+
* },
|
|
106
|
+
* seek: async (offset: bigint, whence: number) => {
|
|
107
|
+
* // Seek in custom destination
|
|
108
|
+
* return offset;
|
|
109
|
+
* }
|
|
110
|
+
* };
|
|
111
|
+
*
|
|
112
|
+
* await using output = await MediaOutput.open(callbacks, {
|
|
113
|
+
* format: 'mp4',
|
|
114
|
+
* bufferSize: 8192
|
|
115
|
+
* });
|
|
116
116
|
* ```
|
|
117
|
+
*
|
|
118
|
+
* @see {@link MediaOutputOptions} For configuration options
|
|
119
|
+
* @see {@link IOOutputCallbacks} For custom I/O interface
|
|
117
120
|
*/
|
|
118
121
|
static async open(target, options) {
|
|
119
122
|
const output = new MediaOutput();
|
|
@@ -162,7 +165,8 @@ export class MediaOutput {
|
|
|
162
165
|
// Cleanup on error
|
|
163
166
|
if (output.ioContext) {
|
|
164
167
|
try {
|
|
165
|
-
|
|
168
|
+
const isCustomIO = (output.formatContext.flags & AVFMT_FLAG_CUSTOM_IO) !== 0;
|
|
169
|
+
if (isCustomIO) {
|
|
166
170
|
// Clear the pb reference first
|
|
167
171
|
output.formatContext.pb = null;
|
|
168
172
|
// For custom IO with callbacks, free the context
|
|
@@ -189,46 +193,38 @@ export class MediaOutput {
|
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
195
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* Creates a new stream in the output format context.
|
|
195
|
-
* Copies codec parameters from encoder or input stream.
|
|
196
|
+
* Add a stream to the output.
|
|
196
197
|
*
|
|
197
|
-
*
|
|
198
|
+
* Configures output stream from encoder or input stream.
|
|
199
|
+
* Must be called before writeHeader().
|
|
200
|
+
* Returns stream index for packet writing.
|
|
198
201
|
*
|
|
199
|
-
*
|
|
200
|
-
* @param options - Optional stream configuration
|
|
201
|
-
* @param options.timeBase - Custom output timebase for the stream.
|
|
202
|
-
* If not specified, uses the source's timebase.
|
|
203
|
-
* When set, packets will be automatically rescaled
|
|
204
|
-
* from source timebase to this output timebase.
|
|
202
|
+
* Direct mapping to avformat_new_stream() and avcodec_parameters_copy().
|
|
205
203
|
*
|
|
204
|
+
* @param source - Encoder or stream to add
|
|
205
|
+
* @param options - Stream configuration options
|
|
206
|
+
* @param options.timeBase - Optional custom timebase for the stream
|
|
206
207
|
* @returns Stream index for packet writing
|
|
207
208
|
*
|
|
208
|
-
* @throws {Error} If called after header
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```typescript
|
|
212
|
-
* // Add encoder stream (transcoding) - uses encoder's timebase
|
|
213
|
-
* const encoder = await Encoder.create('libx264', { width: 1920, height: 1080 });
|
|
214
|
-
* const streamIdx = output.addStream(encoder);
|
|
215
|
-
* ```
|
|
209
|
+
* @throws {Error} If called after header written or output closed
|
|
216
210
|
*
|
|
217
211
|
* @example
|
|
218
212
|
* ```typescript
|
|
219
|
-
* // Add stream
|
|
220
|
-
* const
|
|
221
|
-
* const
|
|
213
|
+
* // Add stream from encoder
|
|
214
|
+
* const videoIdx = output.addStream(videoEncoder);
|
|
215
|
+
* const audioIdx = output.addStream(audioEncoder);
|
|
222
216
|
* ```
|
|
223
217
|
*
|
|
224
218
|
* @example
|
|
225
219
|
* ```typescript
|
|
226
|
-
* //
|
|
227
|
-
* const streamIdx = output.addStream(
|
|
228
|
-
* timeBase: { num: 1, den: 90000 }
|
|
220
|
+
* // Stream copy with custom timebase
|
|
221
|
+
* const streamIdx = output.addStream(input.video(), {
|
|
222
|
+
* timeBase: { num: 1, den: 90000 }
|
|
229
223
|
* });
|
|
230
|
-
* // Packets from encoder will be automatically rescaled to 1/90000
|
|
231
224
|
* ```
|
|
225
|
+
*
|
|
226
|
+
* @see {@link writePacket} For writing packets to streams
|
|
227
|
+
* @see {@link Encoder} For transcoding source
|
|
232
228
|
*/
|
|
233
229
|
addStream(source, options) {
|
|
234
230
|
if (this.closed) {
|
|
@@ -276,26 +272,42 @@ export class MediaOutput {
|
|
|
276
272
|
return stream.index;
|
|
277
273
|
}
|
|
278
274
|
/**
|
|
279
|
-
*
|
|
275
|
+
* Write a packet to the output.
|
|
280
276
|
*
|
|
281
|
-
* Writes
|
|
282
|
-
* Automatically
|
|
277
|
+
* Writes muxed packet to the specified stream.
|
|
278
|
+
* Automatically handles timestamp rescaling.
|
|
279
|
+
* Must be called after writeHeader() and before writeTrailer().
|
|
283
280
|
*
|
|
284
|
-
*
|
|
281
|
+
* Direct mapping to av_interleaved_write_frame().
|
|
285
282
|
*
|
|
286
283
|
* @param packet - Packet to write
|
|
287
284
|
* @param streamIndex - Target stream index
|
|
285
|
+
* @throws {Error} If stream invalid or called at wrong time
|
|
286
|
+
* @throws {FFmpegError} If write fails
|
|
288
287
|
*
|
|
289
|
-
* @
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* // Write encoded packet
|
|
291
|
+
* const packet = await encoder.encode(frame);
|
|
292
|
+
* if (packet) {
|
|
293
|
+
* await output.writePacket(packet, videoIdx);
|
|
294
|
+
* packet.free();
|
|
295
|
+
* }
|
|
296
|
+
* ```
|
|
290
297
|
*
|
|
291
298
|
* @example
|
|
292
299
|
* ```typescript
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
300
|
+
* // Stream copy with packet processing
|
|
301
|
+
* for await (const packet of input.packets()) {
|
|
302
|
+
* if (packet.streamIndex === inputVideoIdx) {
|
|
303
|
+
* await output.writePacket(packet, outputVideoIdx);
|
|
304
|
+
* }
|
|
305
|
+
* packet.free();
|
|
297
306
|
* }
|
|
298
307
|
* ```
|
|
308
|
+
*
|
|
309
|
+
* @see {@link addStream} For adding streams
|
|
310
|
+
* @see {@link writeHeader} Must be called first
|
|
299
311
|
*/
|
|
300
312
|
async writePacket(packet, streamIndex) {
|
|
301
313
|
if (this.closed) {
|
|
@@ -331,21 +343,29 @@ export class MediaOutput {
|
|
|
331
343
|
FFmpegError.throwIfError(ret, 'Failed to write packet');
|
|
332
344
|
}
|
|
333
345
|
/**
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
* Writes the container header with stream information.
|
|
337
|
-
* Must be called before writing any packets.
|
|
346
|
+
* Write file header.
|
|
338
347
|
*
|
|
339
|
-
*
|
|
348
|
+
* Writes format header with stream configuration.
|
|
349
|
+
* Must be called after adding all streams and before writing packets.
|
|
350
|
+
* Finalizes stream parameters and initializes muxer.
|
|
340
351
|
*
|
|
341
|
-
*
|
|
352
|
+
* Direct mapping to avformat_write_header().
|
|
342
353
|
*
|
|
343
|
-
* @throws {Error} If
|
|
354
|
+
* @throws {Error} If already written or output closed
|
|
355
|
+
* @throws {FFmpegError} If write fails
|
|
344
356
|
*
|
|
345
357
|
* @example
|
|
346
358
|
* ```typescript
|
|
359
|
+
* // Standard workflow
|
|
360
|
+
* const output = await MediaOutput.open('output.mp4');
|
|
361
|
+
* output.addStream(encoder);
|
|
347
362
|
* await output.writeHeader();
|
|
363
|
+
* // Now ready to write packets
|
|
348
364
|
* ```
|
|
365
|
+
*
|
|
366
|
+
* @see {@link addStream} Must add streams first
|
|
367
|
+
* @see {@link writePacket} Can write packets after
|
|
368
|
+
* @see {@link writeTrailer} Must call at end
|
|
349
369
|
*/
|
|
350
370
|
async writeHeader() {
|
|
351
371
|
if (this.closed) {
|
|
@@ -359,19 +379,26 @@ export class MediaOutput {
|
|
|
359
379
|
this.headerWritten = true;
|
|
360
380
|
}
|
|
361
381
|
/**
|
|
362
|
-
*
|
|
382
|
+
* Write file trailer.
|
|
363
383
|
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
384
|
+
* Writes format trailer and finalizes the file.
|
|
385
|
+
* Must be called after all packets are written.
|
|
386
|
+
* Flushes any buffered data and updates file headers.
|
|
366
387
|
*
|
|
367
|
-
*
|
|
388
|
+
* Direct mapping to av_write_trailer().
|
|
368
389
|
*
|
|
369
|
-
* @throws {Error} If header not written
|
|
390
|
+
* @throws {Error} If header not written or already written
|
|
391
|
+
* @throws {FFmpegError} If write fails
|
|
370
392
|
*
|
|
371
393
|
* @example
|
|
372
394
|
* ```typescript
|
|
395
|
+
* // Finalize output
|
|
373
396
|
* await output.writeTrailer();
|
|
397
|
+
* await output.close();
|
|
374
398
|
* ```
|
|
399
|
+
*
|
|
400
|
+
* @see {@link writeHeader} Must be called first
|
|
401
|
+
* @see {@link close} For cleanup after trailer
|
|
375
402
|
*/
|
|
376
403
|
async writeTrailer() {
|
|
377
404
|
if (this.closed) {
|
|
@@ -388,17 +415,23 @@ export class MediaOutput {
|
|
|
388
415
|
this.trailerWritten = true;
|
|
389
416
|
}
|
|
390
417
|
/**
|
|
391
|
-
*
|
|
418
|
+
* Close media output and free resources.
|
|
392
419
|
*
|
|
393
|
-
* Writes trailer if needed
|
|
420
|
+
* Writes trailer if needed and releases all resources.
|
|
394
421
|
* Safe to call multiple times.
|
|
395
|
-
*
|
|
396
|
-
* Uses av_write_trailer(), avio_closep(), and avformat_free_context() internally.
|
|
422
|
+
* Automatically called by Symbol.asyncDispose.
|
|
397
423
|
*
|
|
398
424
|
* @example
|
|
399
425
|
* ```typescript
|
|
400
|
-
* await output.
|
|
426
|
+
* const output = await MediaOutput.open('output.mp4');
|
|
427
|
+
* try {
|
|
428
|
+
* // Use output
|
|
429
|
+
* } finally {
|
|
430
|
+
* await output.close();
|
|
431
|
+
* }
|
|
401
432
|
* ```
|
|
433
|
+
*
|
|
434
|
+
* @see {@link Symbol.asyncDispose} For automatic cleanup
|
|
402
435
|
*/
|
|
403
436
|
async close() {
|
|
404
437
|
if (this.closed) {
|
|
@@ -418,9 +451,11 @@ export class MediaOutput {
|
|
|
418
451
|
if (this.ioContext) {
|
|
419
452
|
this.formatContext.pb = null;
|
|
420
453
|
}
|
|
454
|
+
// Determine if this is custom IO before freeing format context
|
|
455
|
+
const isCustomIO = (this.formatContext.flags & AVFMT_FLAG_CUSTOM_IO) !== 0;
|
|
421
456
|
// For file-based IO, close the file handle via closep
|
|
422
457
|
// For custom IO, the context will be freed below
|
|
423
|
-
if (this.ioContext && !
|
|
458
|
+
if (this.ioContext && !isCustomIO) {
|
|
424
459
|
try {
|
|
425
460
|
await this.ioContext.closep();
|
|
426
461
|
}
|
|
@@ -438,7 +473,7 @@ export class MediaOutput {
|
|
|
438
473
|
}
|
|
439
474
|
}
|
|
440
475
|
// Now free custom IO context if present
|
|
441
|
-
if (this.ioContext &&
|
|
476
|
+
if (this.ioContext && isCustomIO) {
|
|
442
477
|
try {
|
|
443
478
|
this.ioContext.freeContext();
|
|
444
479
|
}
|
|
@@ -448,47 +483,95 @@ export class MediaOutput {
|
|
|
448
483
|
}
|
|
449
484
|
}
|
|
450
485
|
/**
|
|
451
|
-
*
|
|
486
|
+
* Get stream information.
|
|
487
|
+
*
|
|
488
|
+
* Returns internal stream info for the specified index.
|
|
489
|
+
*
|
|
490
|
+
* @param streamIndex - Stream index
|
|
491
|
+
* @returns Stream info or undefined
|
|
492
|
+
*
|
|
493
|
+
* @example
|
|
494
|
+
* ```typescript
|
|
495
|
+
* const info = output.getStreamInfo(0);
|
|
496
|
+
* console.log(`Stream 0 timebase: ${info?.timeBase.num}/${info?.timeBase.den}`);
|
|
497
|
+
* ```
|
|
452
498
|
*/
|
|
453
499
|
getStreamInfo(streamIndex) {
|
|
454
500
|
return this.streams.get(streamIndex);
|
|
455
501
|
}
|
|
456
502
|
/**
|
|
457
|
-
*
|
|
503
|
+
* Get all stream indices.
|
|
504
|
+
*
|
|
505
|
+
* Returns array of all added stream indices.
|
|
506
|
+
*
|
|
507
|
+
* @returns Array of stream indices
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```typescript
|
|
511
|
+
* const indices = output.getStreamIndices();
|
|
512
|
+
* console.log(`Output has ${indices.length} streams`);
|
|
513
|
+
* ```
|
|
458
514
|
*/
|
|
459
515
|
getStreamIndices() {
|
|
460
516
|
return Array.from(this.streams.keys());
|
|
461
517
|
}
|
|
462
518
|
/**
|
|
463
|
-
*
|
|
519
|
+
* Check if header has been written.
|
|
520
|
+
*
|
|
521
|
+
* @returns true if header written
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```typescript
|
|
525
|
+
* if (!output.isHeaderWritten()) {
|
|
526
|
+
* await output.writeHeader();
|
|
527
|
+
* }
|
|
528
|
+
* ```
|
|
464
529
|
*/
|
|
465
530
|
isHeaderWritten() {
|
|
466
531
|
return this.headerWritten;
|
|
467
532
|
}
|
|
468
533
|
/**
|
|
469
|
-
*
|
|
534
|
+
* Check if trailer has been written.
|
|
535
|
+
*
|
|
536
|
+
* @returns true if trailer written
|
|
537
|
+
*
|
|
538
|
+
* @example
|
|
539
|
+
* ```typescript
|
|
540
|
+
* if (!output.isTrailerWritten()) {
|
|
541
|
+
* await output.writeTrailer();
|
|
542
|
+
* }
|
|
543
|
+
* ```
|
|
470
544
|
*/
|
|
471
545
|
isTrailerWritten() {
|
|
472
546
|
return this.trailerWritten;
|
|
473
547
|
}
|
|
474
548
|
/**
|
|
475
|
-
*
|
|
549
|
+
* Get underlying format context.
|
|
476
550
|
*
|
|
477
|
-
*
|
|
551
|
+
* Returns the internal format context for advanced operations.
|
|
552
|
+
*
|
|
553
|
+
* @returns Format context
|
|
554
|
+
*
|
|
555
|
+
* @internal
|
|
478
556
|
*/
|
|
479
557
|
getFormatContext() {
|
|
480
558
|
return this.formatContext;
|
|
481
559
|
}
|
|
482
560
|
/**
|
|
483
|
-
*
|
|
561
|
+
* Dispose of media output.
|
|
484
562
|
*
|
|
485
|
-
*
|
|
563
|
+
* Implements AsyncDisposable interface for automatic cleanup.
|
|
564
|
+
* Equivalent to calling close().
|
|
486
565
|
*
|
|
487
566
|
* @example
|
|
488
567
|
* ```typescript
|
|
489
|
-
*
|
|
490
|
-
*
|
|
568
|
+
* {
|
|
569
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
570
|
+
* // Use output...
|
|
571
|
+
* } // Automatically closed
|
|
491
572
|
* ```
|
|
573
|
+
*
|
|
574
|
+
* @see {@link close} For manual cleanup
|
|
492
575
|
*/
|
|
493
576
|
async [Symbol.asyncDispose]() {
|
|
494
577
|
await this.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-output.js","sourceRoot":"","sources":["../../src/api/media-output.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"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