node-av 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -59
- package/dist/api/bitstream-filter.d.ts +183 -123
- package/dist/api/bitstream-filter.js +185 -127
- package/dist/api/bitstream-filter.js.map +1 -1
- package/dist/api/decoder.d.ts +282 -130
- package/dist/api/decoder.js +290 -142
- package/dist/api/decoder.js.map +1 -1
- package/dist/api/encoder.d.ts +249 -160
- package/dist/api/encoder.js +276 -207
- package/dist/api/encoder.js.map +1 -1
- package/dist/api/filter-presets.d.ts +1944 -96
- package/dist/api/filter-presets.js +2059 -105
- package/dist/api/filter-presets.js.map +1 -1
- package/dist/api/filter.d.ts +264 -200
- package/dist/api/filter.js +269 -231
- package/dist/api/filter.js.map +1 -1
- package/dist/api/hardware.d.ts +246 -117
- package/dist/api/hardware.js +440 -217
- package/dist/api/hardware.js.map +1 -1
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/io-stream.d.ts +65 -55
- package/dist/api/io-stream.js +43 -40
- package/dist/api/io-stream.js.map +1 -1
- package/dist/api/media-input.d.ts +242 -139
- package/dist/api/media-input.js +205 -103
- package/dist/api/media-input.js.map +1 -1
- package/dist/api/media-output.d.ts +208 -126
- package/dist/api/media-output.js +212 -126
- package/dist/api/media-output.js.map +1 -1
- package/dist/api/pipeline.d.ts +361 -38
- package/dist/api/pipeline.js +255 -14
- package/dist/api/pipeline.js.map +1 -1
- package/dist/api/types.d.ts +26 -187
- package/dist/api/utilities/audio-sample.d.ts +0 -8
- package/dist/api/utilities/audio-sample.js +0 -8
- package/dist/api/utilities/audio-sample.js.map +1 -1
- package/dist/api/utilities/channel-layout.d.ts +0 -8
- package/dist/api/utilities/channel-layout.js +0 -8
- package/dist/api/utilities/channel-layout.js.map +1 -1
- package/dist/api/utilities/image.d.ts +0 -8
- package/dist/api/utilities/image.js +0 -8
- package/dist/api/utilities/image.js.map +1 -1
- package/dist/api/utilities/index.d.ts +3 -3
- package/dist/api/utilities/index.js +3 -3
- package/dist/api/utilities/index.js.map +1 -1
- package/dist/api/utilities/media-type.d.ts +1 -9
- package/dist/api/utilities/media-type.js +1 -9
- package/dist/api/utilities/media-type.js.map +1 -1
- package/dist/api/utilities/pixel-format.d.ts +1 -9
- package/dist/api/utilities/pixel-format.js +1 -9
- package/dist/api/utilities/pixel-format.js.map +1 -1
- package/dist/api/utilities/sample-format.d.ts +1 -9
- package/dist/api/utilities/sample-format.js +1 -9
- package/dist/api/utilities/sample-format.js.map +1 -1
- package/dist/api/utilities/streaming.d.ts +0 -8
- package/dist/api/utilities/streaming.js +0 -8
- package/dist/api/utilities/streaming.js.map +1 -1
- package/dist/api/utilities/timestamp.d.ts +0 -8
- package/dist/api/utilities/timestamp.js +0 -8
- package/dist/api/utilities/timestamp.js.map +1 -1
- package/dist/api/utils.d.ts +1 -2
- package/dist/api/utils.js +11 -0
- package/dist/api/utils.js.map +1 -1
- package/dist/constants/constants.d.ts +1 -1
- package/dist/constants/constants.js +2 -0
- package/dist/constants/constants.js.map +1 -1
- package/dist/lib/audio-fifo.d.ts +127 -170
- package/dist/lib/audio-fifo.js +130 -173
- package/dist/lib/audio-fifo.js.map +1 -1
- package/dist/lib/binding.d.ts +1 -0
- package/dist/lib/binding.js +7 -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 +68 -54
- package/dist/lib/bitstream-filter.js +68 -54
- package/dist/lib/bitstream-filter.js.map +1 -1
- package/dist/lib/codec-context.d.ts +316 -380
- package/dist/lib/codec-context.js +316 -381
- package/dist/lib/codec-context.js.map +1 -1
- package/dist/lib/codec-parameters.d.ts +160 -170
- package/dist/lib/codec-parameters.js +162 -172
- package/dist/lib/codec-parameters.js.map +1 -1
- package/dist/lib/codec-parser.d.ts +91 -104
- package/dist/lib/codec-parser.js +92 -103
- package/dist/lib/codec-parser.js.map +1 -1
- package/dist/lib/codec.d.ts +266 -283
- package/dist/lib/codec.js +270 -287
- package/dist/lib/codec.js.map +1 -1
- package/dist/lib/dictionary.d.ts +149 -203
- package/dist/lib/dictionary.js +158 -212
- package/dist/lib/dictionary.js.map +1 -1
- package/dist/lib/error.d.ts +96 -130
- package/dist/lib/error.js +98 -128
- package/dist/lib/error.js.map +1 -1
- package/dist/lib/filter-context.d.ts +284 -218
- package/dist/lib/filter-context.js +290 -227
- package/dist/lib/filter-context.js.map +1 -1
- package/dist/lib/filter-graph.d.ts +251 -292
- 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 +93 -111
- package/dist/lib/filter.js.map +1 -1
- package/dist/lib/format-context.d.ts +320 -428
- package/dist/lib/format-context.js +313 -385
- package/dist/lib/format-context.js.map +1 -1
- package/dist/lib/frame.d.ts +262 -405
- package/dist/lib/frame.js +263 -408
- package/dist/lib/frame.js.map +1 -1
- package/dist/lib/hardware-device-context.d.ts +149 -203
- 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 +170 -180
- 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 +3 -2
- package/dist/lib/index.js +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/input-format.d.ts +89 -117
- package/dist/lib/input-format.js +89 -117
- package/dist/lib/input-format.js.map +1 -1
- package/dist/lib/io-context.d.ts +209 -241
- package/dist/lib/io-context.js +220 -252
- package/dist/lib/io-context.js.map +1 -1
- package/dist/lib/log.d.ts +85 -119
- package/dist/lib/log.js +85 -122
- package/dist/lib/log.js.map +1 -1
- package/dist/lib/native-types.d.ts +118 -106
- package/dist/lib/native-types.js +0 -7
- package/dist/lib/native-types.js.map +1 -1
- package/dist/lib/option.d.ts +437 -218
- package/dist/lib/option.js +462 -226
- package/dist/lib/option.js.map +1 -1
- package/dist/lib/output-format.d.ts +77 -101
- package/dist/lib/output-format.js +77 -101
- package/dist/lib/output-format.js.map +1 -1
- package/dist/lib/packet.d.ts +172 -240
- 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 +241 -325
- 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 +129 -173
- package/dist/lib/software-scale-context.js +131 -175
- package/dist/lib/software-scale-context.js.map +1 -1
- package/dist/lib/stream.d.ts +87 -197
- package/dist/lib/stream.js +87 -197
- package/dist/lib/stream.js.map +1 -1
- package/dist/lib/utilities.d.ts +435 -181
- package/dist/lib/utilities.js +438 -182
- package/dist/lib/utilities.js.map +1 -1
- package/install/check.js +0 -1
- package/install/ffmpeg.js +0 -11
- package/package.json +25 -18
- package/release_notes.md +24 -59
- package/CHANGELOG.md +0 -8
package/dist/api/media-output.js
CHANGED
|
@@ -1,67 +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
3
|
import { AVFMT_FLAG_CUSTOM_IO, AVFMT_NOFILE, AVIO_FLAG_WRITE } from '../constants/constants.js';
|
|
15
4
|
import { FFmpegError, FormatContext, IOContext, Rational } from '../lib/index.js';
|
|
16
5
|
import { Encoder } from './encoder.js';
|
|
17
6
|
/**
|
|
18
|
-
*
|
|
7
|
+
* High-level media output for writing and muxing media files.
|
|
19
8
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* 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.
|
|
25
13
|
*
|
|
26
14
|
* @example
|
|
27
15
|
* ```typescript
|
|
28
|
-
* import { MediaOutput
|
|
16
|
+
* import { MediaOutput } from 'node-av/api';
|
|
29
17
|
*
|
|
30
|
-
* //
|
|
31
|
-
*
|
|
18
|
+
* // Create output file
|
|
19
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
32
20
|
*
|
|
33
|
-
* // Add
|
|
34
|
-
* const
|
|
35
|
-
*
|
|
36
|
-
* height: 1080,
|
|
37
|
-
* pixelFormat: AV_PIX_FMT_YUV420P
|
|
38
|
-
* });
|
|
39
|
-
* const streamIdx = output.addStream(encoder);
|
|
21
|
+
* // Add streams from encoders
|
|
22
|
+
* const videoIdx = output.addStream(videoEncoder);
|
|
23
|
+
* const audioIdx = output.addStream(audioEncoder);
|
|
40
24
|
*
|
|
41
|
-
* // Write header
|
|
25
|
+
* // Write header
|
|
42
26
|
* await output.writeHeader();
|
|
43
|
-
*
|
|
27
|
+
*
|
|
28
|
+
* // Write packets
|
|
29
|
+
* await output.writePacket(packet, videoIdx);
|
|
30
|
+
*
|
|
31
|
+
* // Write trailer and close
|
|
44
32
|
* await output.writeTrailer();
|
|
45
|
-
* await output.close();
|
|
46
33
|
* ```
|
|
47
34
|
*
|
|
48
35
|
* @example
|
|
49
36
|
* ```typescript
|
|
50
|
-
* // Stream copy
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* const videoStream = input.video();
|
|
55
|
-
* 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');
|
|
56
40
|
*
|
|
41
|
+
* // Copy stream configuration
|
|
42
|
+
* const videoIdx = output.addStream(input.video());
|
|
57
43
|
* await output.writeHeader();
|
|
44
|
+
*
|
|
58
45
|
* for await (const packet of input.packets()) {
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* }
|
|
46
|
+
* await output.writePacket(packet, videoIdx);
|
|
47
|
+
* packet.free();
|
|
62
48
|
* }
|
|
63
|
-
* await output.writeTrailer();
|
|
64
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
|
|
65
54
|
*/
|
|
66
55
|
export class MediaOutput {
|
|
67
56
|
formatContext;
|
|
@@ -71,50 +60,64 @@ export class MediaOutput {
|
|
|
71
60
|
trailerWritten = false;
|
|
72
61
|
closed = false;
|
|
73
62
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* Initializes the output with a new FormatContext.
|
|
77
|
-
* The actual format setup happens in the static factory method.
|
|
63
|
+
* @internal
|
|
78
64
|
*/
|
|
79
65
|
constructor() {
|
|
80
66
|
this.formatContext = new FormatContext();
|
|
81
67
|
}
|
|
82
68
|
/**
|
|
83
|
-
*
|
|
69
|
+
* Open media output for writing.
|
|
84
70
|
*
|
|
85
|
-
* Creates
|
|
86
|
-
* Automatically
|
|
71
|
+
* Creates and configures output context for muxing.
|
|
72
|
+
* Automatically creates directories for file output.
|
|
73
|
+
* Supports files, URLs, and custom I/O callbacks.
|
|
87
74
|
*
|
|
88
|
-
*
|
|
89
|
-
* Format must be explicitly specified for custom IO.
|
|
75
|
+
* Direct mapping to avformat_alloc_output_context2() and avio_open2().
|
|
90
76
|
*
|
|
91
|
-
*
|
|
77
|
+
* @param target - File path, URL, or I/O callbacks
|
|
78
|
+
* @param options - Output configuration options
|
|
79
|
+
* @returns Opened media output instance
|
|
92
80
|
*
|
|
93
|
-
* @
|
|
94
|
-
* @param options - Optional configuration
|
|
81
|
+
* @throws {Error} If format required for custom I/O
|
|
95
82
|
*
|
|
96
|
-
* @
|
|
97
|
-
*
|
|
98
|
-
* @throws {Error} If format not specified or context allocation fails
|
|
83
|
+
* @throws {FFmpegError} If allocation or opening fails
|
|
99
84
|
*
|
|
100
85
|
* @example
|
|
101
86
|
* ```typescript
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* seek: (offset, whence) => offset
|
|
105
|
-
* };
|
|
106
|
-
* const output = await MediaOutput.open(callbacks, { format: 'mp4' });
|
|
87
|
+
* // Create file output
|
|
88
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
107
89
|
* ```
|
|
108
90
|
*
|
|
109
91
|
* @example
|
|
110
92
|
* ```typescript
|
|
111
|
-
*
|
|
93
|
+
* // Create output with specific format
|
|
94
|
+
* await using output = await MediaOutput.open('output.ts', {
|
|
95
|
+
* format: 'mpegts'
|
|
96
|
+
* });
|
|
112
97
|
* ```
|
|
113
98
|
*
|
|
114
99
|
* @example
|
|
115
100
|
* ```typescript
|
|
116
|
-
*
|
|
101
|
+
* // Custom I/O callbacks
|
|
102
|
+
* const callbacks = {
|
|
103
|
+
* write: async (buffer: Buffer) => {
|
|
104
|
+
* // Write to custom destination
|
|
105
|
+
* return buffer.length;
|
|
106
|
+
* },
|
|
107
|
+
* seek: async (offset: bigint, whence: number) => {
|
|
108
|
+
* // Seek in custom destination
|
|
109
|
+
* return offset;
|
|
110
|
+
* }
|
|
111
|
+
* };
|
|
112
|
+
*
|
|
113
|
+
* await using output = await MediaOutput.open(callbacks, {
|
|
114
|
+
* format: 'mp4',
|
|
115
|
+
* bufferSize: 8192
|
|
116
|
+
* });
|
|
117
117
|
* ```
|
|
118
|
+
*
|
|
119
|
+
* @see {@link MediaOutputOptions} For configuration options
|
|
120
|
+
* @see {@link IOOutputCallbacks} For custom I/O interface
|
|
118
121
|
*/
|
|
119
122
|
static async open(target, options) {
|
|
120
123
|
const output = new MediaOutput();
|
|
@@ -163,7 +166,8 @@ export class MediaOutput {
|
|
|
163
166
|
// Cleanup on error
|
|
164
167
|
if (output.ioContext) {
|
|
165
168
|
try {
|
|
166
|
-
|
|
169
|
+
const isCustomIO = (output.formatContext.flags & AVFMT_FLAG_CUSTOM_IO) !== 0;
|
|
170
|
+
if (isCustomIO) {
|
|
167
171
|
// Clear the pb reference first
|
|
168
172
|
output.formatContext.pb = null;
|
|
169
173
|
// For custom IO with callbacks, free the context
|
|
@@ -190,46 +194,38 @@ export class MediaOutput {
|
|
|
190
194
|
}
|
|
191
195
|
}
|
|
192
196
|
/**
|
|
193
|
-
*
|
|
197
|
+
* Add a stream to the output.
|
|
194
198
|
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
199
|
+
* Configures output stream from encoder or input stream.
|
|
200
|
+
* Must be called before writeHeader().
|
|
201
|
+
* Returns stream index for packet writing.
|
|
197
202
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* @param source - Encoder for transcoding or Stream for copying
|
|
201
|
-
* @param options - Optional stream configuration
|
|
202
|
-
* @param options.timeBase - Custom output timebase for the stream.
|
|
203
|
-
* If not specified, uses the source's timebase.
|
|
204
|
-
* When set, packets will be automatically rescaled
|
|
205
|
-
* from source timebase to this output timebase.
|
|
203
|
+
* Direct mapping to avformat_new_stream() and avcodec_parameters_copy().
|
|
206
204
|
*
|
|
205
|
+
* @param source - Encoder or stream to add
|
|
206
|
+
* @param options - Stream configuration options
|
|
207
|
+
* @param options.timeBase - Optional custom timebase for the stream
|
|
207
208
|
* @returns Stream index for packet writing
|
|
208
209
|
*
|
|
209
|
-
* @throws {Error} If called after header
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* ```typescript
|
|
213
|
-
* // Add encoder stream (transcoding) - uses encoder's timebase
|
|
214
|
-
* const encoder = await Encoder.create('libx264', { width: 1920, height: 1080 });
|
|
215
|
-
* const streamIdx = output.addStream(encoder);
|
|
216
|
-
* ```
|
|
210
|
+
* @throws {Error} If called after header written or output closed
|
|
217
211
|
*
|
|
218
212
|
* @example
|
|
219
213
|
* ```typescript
|
|
220
|
-
* // Add stream
|
|
221
|
-
* const
|
|
222
|
-
* const
|
|
214
|
+
* // Add stream from encoder
|
|
215
|
+
* const videoIdx = output.addStream(videoEncoder);
|
|
216
|
+
* const audioIdx = output.addStream(audioEncoder);
|
|
223
217
|
* ```
|
|
224
218
|
*
|
|
225
219
|
* @example
|
|
226
220
|
* ```typescript
|
|
227
|
-
* //
|
|
228
|
-
* const streamIdx = output.addStream(
|
|
229
|
-
* timeBase: { num: 1, den: 90000 }
|
|
221
|
+
* // Stream copy with custom timebase
|
|
222
|
+
* const streamIdx = output.addStream(input.video(), {
|
|
223
|
+
* timeBase: { num: 1, den: 90000 }
|
|
230
224
|
* });
|
|
231
|
-
* // Packets from encoder will be automatically rescaled to 1/90000
|
|
232
225
|
* ```
|
|
226
|
+
*
|
|
227
|
+
* @see {@link writePacket} For writing packets to streams
|
|
228
|
+
* @see {@link Encoder} For transcoding source
|
|
233
229
|
*/
|
|
234
230
|
addStream(source, options) {
|
|
235
231
|
if (this.closed) {
|
|
@@ -277,26 +273,43 @@ export class MediaOutput {
|
|
|
277
273
|
return stream.index;
|
|
278
274
|
}
|
|
279
275
|
/**
|
|
280
|
-
*
|
|
276
|
+
* Write a packet to the output.
|
|
281
277
|
*
|
|
282
|
-
* Writes
|
|
283
|
-
* Automatically
|
|
278
|
+
* Writes muxed packet to the specified stream.
|
|
279
|
+
* Automatically handles timestamp rescaling.
|
|
280
|
+
* Must be called after writeHeader() and before writeTrailer().
|
|
284
281
|
*
|
|
285
|
-
*
|
|
282
|
+
* Direct mapping to av_interleaved_write_frame().
|
|
286
283
|
*
|
|
287
284
|
* @param packet - Packet to write
|
|
288
285
|
* @param streamIndex - Target stream index
|
|
286
|
+
* @throws {Error} If stream invalid or called at wrong time
|
|
289
287
|
*
|
|
290
|
-
* @throws {
|
|
288
|
+
* @throws {FFmpegError} If write fails
|
|
291
289
|
*
|
|
292
290
|
* @example
|
|
293
291
|
* ```typescript
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
292
|
+
* // Write encoded packet
|
|
293
|
+
* const packet = await encoder.encode(frame);
|
|
294
|
+
* if (packet) {
|
|
295
|
+
* await output.writePacket(packet, videoIdx);
|
|
296
|
+
* packet.free();
|
|
298
297
|
* }
|
|
299
298
|
* ```
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```typescript
|
|
302
|
+
* // Stream copy with packet processing
|
|
303
|
+
* for await (const packet of input.packets()) {
|
|
304
|
+
* if (packet.streamIndex === inputVideoIdx) {
|
|
305
|
+
* await output.writePacket(packet, outputVideoIdx);
|
|
306
|
+
* }
|
|
307
|
+
* packet.free();
|
|
308
|
+
* }
|
|
309
|
+
* ```
|
|
310
|
+
*
|
|
311
|
+
* @see {@link addStream} For adding streams
|
|
312
|
+
* @see {@link writeHeader} Must be called first
|
|
300
313
|
*/
|
|
301
314
|
async writePacket(packet, streamIndex) {
|
|
302
315
|
if (this.closed) {
|
|
@@ -332,21 +345,30 @@ export class MediaOutput {
|
|
|
332
345
|
FFmpegError.throwIfError(ret, 'Failed to write packet');
|
|
333
346
|
}
|
|
334
347
|
/**
|
|
335
|
-
*
|
|
348
|
+
* Write file header.
|
|
336
349
|
*
|
|
337
|
-
* Writes
|
|
338
|
-
* Must be called before writing
|
|
350
|
+
* Writes format header with stream configuration.
|
|
351
|
+
* Must be called after adding all streams and before writing packets.
|
|
352
|
+
* Finalizes stream parameters and initializes muxer.
|
|
339
353
|
*
|
|
340
|
-
*
|
|
354
|
+
* Direct mapping to avformat_write_header().
|
|
341
355
|
*
|
|
342
|
-
* @
|
|
356
|
+
* @throws {Error} If already written or output closed
|
|
343
357
|
*
|
|
344
|
-
* @throws {
|
|
358
|
+
* @throws {FFmpegError} If write fails
|
|
345
359
|
*
|
|
346
360
|
* @example
|
|
347
361
|
* ```typescript
|
|
362
|
+
* // Standard workflow
|
|
363
|
+
* const output = await MediaOutput.open('output.mp4');
|
|
364
|
+
* output.addStream(encoder);
|
|
348
365
|
* await output.writeHeader();
|
|
366
|
+
* // Now ready to write packets
|
|
349
367
|
* ```
|
|
368
|
+
*
|
|
369
|
+
* @see {@link addStream} Must add streams first
|
|
370
|
+
* @see {@link writePacket} Can write packets after
|
|
371
|
+
* @see {@link writeTrailer} Must call at end
|
|
350
372
|
*/
|
|
351
373
|
async writeHeader() {
|
|
352
374
|
if (this.closed) {
|
|
@@ -360,19 +382,27 @@ export class MediaOutput {
|
|
|
360
382
|
this.headerWritten = true;
|
|
361
383
|
}
|
|
362
384
|
/**
|
|
363
|
-
*
|
|
385
|
+
* Write file trailer.
|
|
386
|
+
*
|
|
387
|
+
* Writes format trailer and finalizes the file.
|
|
388
|
+
* Must be called after all packets are written.
|
|
389
|
+
* Flushes any buffered data and updates file headers.
|
|
364
390
|
*
|
|
365
|
-
*
|
|
366
|
-
* Should be called after all packets have been written.
|
|
391
|
+
* Direct mapping to av_write_trailer().
|
|
367
392
|
*
|
|
368
|
-
*
|
|
393
|
+
* @throws {Error} If header not written or already written
|
|
369
394
|
*
|
|
370
|
-
* @throws {
|
|
395
|
+
* @throws {FFmpegError} If write fails
|
|
371
396
|
*
|
|
372
397
|
* @example
|
|
373
398
|
* ```typescript
|
|
399
|
+
* // Finalize output
|
|
374
400
|
* await output.writeTrailer();
|
|
401
|
+
* await output.close();
|
|
375
402
|
* ```
|
|
403
|
+
*
|
|
404
|
+
* @see {@link writeHeader} Must be called first
|
|
405
|
+
* @see {@link close} For cleanup after trailer
|
|
376
406
|
*/
|
|
377
407
|
async writeTrailer() {
|
|
378
408
|
if (this.closed) {
|
|
@@ -389,17 +419,23 @@ export class MediaOutput {
|
|
|
389
419
|
this.trailerWritten = true;
|
|
390
420
|
}
|
|
391
421
|
/**
|
|
392
|
-
*
|
|
422
|
+
* Close media output and free resources.
|
|
393
423
|
*
|
|
394
|
-
* Writes trailer if needed
|
|
424
|
+
* Writes trailer if needed and releases all resources.
|
|
395
425
|
* Safe to call multiple times.
|
|
396
|
-
*
|
|
397
|
-
* Uses av_write_trailer(), avio_closep(), and avformat_free_context() internally.
|
|
426
|
+
* Automatically called by Symbol.asyncDispose.
|
|
398
427
|
*
|
|
399
428
|
* @example
|
|
400
429
|
* ```typescript
|
|
401
|
-
* await output.
|
|
430
|
+
* const output = await MediaOutput.open('output.mp4');
|
|
431
|
+
* try {
|
|
432
|
+
* // Use output
|
|
433
|
+
* } finally {
|
|
434
|
+
* await output.close();
|
|
435
|
+
* }
|
|
402
436
|
* ```
|
|
437
|
+
*
|
|
438
|
+
* @see {@link Symbol.asyncDispose} For automatic cleanup
|
|
403
439
|
*/
|
|
404
440
|
async close() {
|
|
405
441
|
if (this.closed) {
|
|
@@ -419,9 +455,11 @@ export class MediaOutput {
|
|
|
419
455
|
if (this.ioContext) {
|
|
420
456
|
this.formatContext.pb = null;
|
|
421
457
|
}
|
|
458
|
+
// Determine if this is custom IO before freeing format context
|
|
459
|
+
const isCustomIO = (this.formatContext.flags & AVFMT_FLAG_CUSTOM_IO) !== 0;
|
|
422
460
|
// For file-based IO, close the file handle via closep
|
|
423
461
|
// For custom IO, the context will be freed below
|
|
424
|
-
if (this.ioContext && !
|
|
462
|
+
if (this.ioContext && !isCustomIO) {
|
|
425
463
|
try {
|
|
426
464
|
await this.ioContext.closep();
|
|
427
465
|
}
|
|
@@ -439,7 +477,7 @@ export class MediaOutput {
|
|
|
439
477
|
}
|
|
440
478
|
}
|
|
441
479
|
// Now free custom IO context if present
|
|
442
|
-
if (this.ioContext &&
|
|
480
|
+
if (this.ioContext && isCustomIO) {
|
|
443
481
|
try {
|
|
444
482
|
this.ioContext.freeContext();
|
|
445
483
|
}
|
|
@@ -449,47 +487,95 @@ export class MediaOutput {
|
|
|
449
487
|
}
|
|
450
488
|
}
|
|
451
489
|
/**
|
|
452
|
-
*
|
|
490
|
+
* Get stream information.
|
|
491
|
+
*
|
|
492
|
+
* Returns internal stream info for the specified index.
|
|
493
|
+
*
|
|
494
|
+
* @param streamIndex - Stream index
|
|
495
|
+
* @returns Stream info or undefined
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```typescript
|
|
499
|
+
* const info = output.getStreamInfo(0);
|
|
500
|
+
* console.log(`Stream 0 timebase: ${info?.timeBase.num}/${info?.timeBase.den}`);
|
|
501
|
+
* ```
|
|
453
502
|
*/
|
|
454
503
|
getStreamInfo(streamIndex) {
|
|
455
504
|
return this.streams.get(streamIndex);
|
|
456
505
|
}
|
|
457
506
|
/**
|
|
458
|
-
*
|
|
507
|
+
* Get all stream indices.
|
|
508
|
+
*
|
|
509
|
+
* Returns array of all added stream indices.
|
|
510
|
+
*
|
|
511
|
+
* @returns Array of stream indices
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* ```typescript
|
|
515
|
+
* const indices = output.getStreamIndices();
|
|
516
|
+
* console.log(`Output has ${indices.length} streams`);
|
|
517
|
+
* ```
|
|
459
518
|
*/
|
|
460
519
|
getStreamIndices() {
|
|
461
520
|
return Array.from(this.streams.keys());
|
|
462
521
|
}
|
|
463
522
|
/**
|
|
464
|
-
*
|
|
523
|
+
* Check if header has been written.
|
|
524
|
+
*
|
|
525
|
+
* @returns true if header written
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```typescript
|
|
529
|
+
* if (!output.isHeaderWritten()) {
|
|
530
|
+
* await output.writeHeader();
|
|
531
|
+
* }
|
|
532
|
+
* ```
|
|
465
533
|
*/
|
|
466
534
|
isHeaderWritten() {
|
|
467
535
|
return this.headerWritten;
|
|
468
536
|
}
|
|
469
537
|
/**
|
|
470
|
-
*
|
|
538
|
+
* Check if trailer has been written.
|
|
539
|
+
*
|
|
540
|
+
* @returns true if trailer written
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* ```typescript
|
|
544
|
+
* if (!output.isTrailerWritten()) {
|
|
545
|
+
* await output.writeTrailer();
|
|
546
|
+
* }
|
|
547
|
+
* ```
|
|
471
548
|
*/
|
|
472
549
|
isTrailerWritten() {
|
|
473
550
|
return this.trailerWritten;
|
|
474
551
|
}
|
|
475
552
|
/**
|
|
476
|
-
*
|
|
553
|
+
* Get underlying format context.
|
|
477
554
|
*
|
|
478
|
-
*
|
|
555
|
+
* Returns the internal format context for advanced operations.
|
|
556
|
+
*
|
|
557
|
+
* @returns Format context
|
|
558
|
+
*
|
|
559
|
+
* @internal
|
|
479
560
|
*/
|
|
480
561
|
getFormatContext() {
|
|
481
562
|
return this.formatContext;
|
|
482
563
|
}
|
|
483
564
|
/**
|
|
484
|
-
*
|
|
565
|
+
* Dispose of media output.
|
|
485
566
|
*
|
|
486
|
-
*
|
|
567
|
+
* Implements AsyncDisposable interface for automatic cleanup.
|
|
568
|
+
* Equivalent to calling close().
|
|
487
569
|
*
|
|
488
570
|
* @example
|
|
489
571
|
* ```typescript
|
|
490
|
-
*
|
|
491
|
-
*
|
|
572
|
+
* {
|
|
573
|
+
* await using output = await MediaOutput.open('output.mp4');
|
|
574
|
+
* // Use output...
|
|
575
|
+
* } // Automatically closed
|
|
492
576
|
* ```
|
|
577
|
+
*
|
|
578
|
+
* @see {@link close} For manual cleanup
|
|
493
579
|
*/
|
|
494
580
|
async [Symbol.asyncDispose]() {
|
|
495
581
|
await this.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-output.js","sourceRoot":"","sources":["../../src/api/media-output.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"media-output.js","sourceRoot":"","sources":["../../src/api/media-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAYvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,OAAO,WAAW;IACd,aAAa,CAAgB;IAC7B,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IAC/C,SAAS,CAAa;IACtB,aAAa,GAAG,KAAK,CAAC;IACtB,cAAc,GAAG,KAAK,CAAC;IACvB,MAAM,GAAG,KAAK,CAAC;IAEvB;;OAEG;IACH;QACE,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqDG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAkC,EAAE,OAA4B;QAChF,MAAM,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAEjC,IAAI,CAAC;YACH,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC/B,qEAAqE;gBACrE,+DAA+D;gBAC/D,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3D,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CA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