mediabunny 1.0.2 → 1.0.4
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 +4 -4
- package/dist/mediabunny.d.ts +4 -2
- package/dist/modules/codec-data.d.ts +95 -0
- package/dist/modules/codec-data.d.ts.map +1 -0
- package/dist/modules/codec-data.js +1103 -0
- package/dist/modules/codec.d.ts +250 -0
- package/dist/modules/codec.d.ts.map +1 -0
- package/dist/modules/codec.js +1100 -0
- package/dist/modules/conversion.d.ts +158 -0
- package/dist/modules/conversion.d.ts.map +1 -0
- package/dist/modules/conversion.js +866 -0
- package/dist/modules/custom-coder.d.ts +119 -0
- package/dist/modules/custom-coder.d.ts.map +1 -0
- package/dist/modules/custom-coder.js +91 -0
- package/dist/modules/demuxer.d.ts +17 -0
- package/dist/modules/demuxer.d.ts.map +1 -0
- package/dist/modules/demuxer.js +12 -0
- package/dist/modules/index.d.ts +25 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +24 -0
- package/dist/modules/input-format.d.ts +121 -0
- package/dist/modules/input-format.d.ts.map +1 -0
- package/dist/modules/input-format.js +333 -0
- package/dist/modules/input-track.d.ts +138 -0
- package/dist/modules/input-track.d.ts.map +1 -0
- package/dist/modules/input-track.js +230 -0
- package/dist/modules/input.d.ts +55 -0
- package/dist/modules/input.d.ts.map +1 -0
- package/dist/modules/input.js +104 -0
- package/dist/modules/isobmff/isobmff-boxes.d.ts +202 -0
- package/dist/modules/isobmff/isobmff-boxes.d.ts.map +1 -0
- package/dist/modules/isobmff/isobmff-boxes.js +1111 -0
- package/dist/modules/isobmff/isobmff-demuxer.d.ts +163 -0
- package/dist/modules/isobmff/isobmff-demuxer.d.ts.map +1 -0
- package/dist/modules/isobmff/isobmff-demuxer.js +2080 -0
- package/dist/modules/isobmff/isobmff-misc.d.ts +14 -0
- package/dist/modules/isobmff/isobmff-misc.d.ts.map +1 -0
- package/dist/modules/isobmff/isobmff-misc.js +20 -0
- package/dist/modules/isobmff/isobmff-muxer.d.ts +142 -0
- package/dist/modules/isobmff/isobmff-muxer.d.ts.map +1 -0
- package/dist/modules/isobmff/isobmff-muxer.js +858 -0
- package/dist/modules/isobmff/isobmff-reader.d.ts +36 -0
- package/dist/modules/isobmff/isobmff-reader.d.ts.map +1 -0
- package/dist/modules/isobmff/isobmff-reader.js +105 -0
- package/dist/modules/matroska/ebml.d.ts +156 -0
- package/dist/modules/matroska/ebml.d.ts.map +1 -0
- package/dist/modules/matroska/ebml.js +529 -0
- package/dist/modules/matroska/matroska-demuxer.d.ts +119 -0
- package/dist/modules/matroska/matroska-demuxer.d.ts.map +1 -0
- package/dist/modules/matroska/matroska-demuxer.js +1330 -0
- package/dist/modules/matroska/matroska-misc.d.ts +14 -0
- package/dist/modules/matroska/matroska-misc.d.ts.map +1 -0
- package/dist/modules/matroska/matroska-misc.js +20 -0
- package/dist/modules/matroska/matroska-muxer.d.ts +71 -0
- package/dist/modules/matroska/matroska-muxer.d.ts.map +1 -0
- package/dist/modules/matroska/matroska-muxer.js +729 -0
- package/dist/modules/media-sink.d.ts +272 -0
- package/dist/modules/media-sink.d.ts.map +1 -0
- package/dist/modules/media-sink.js +1264 -0
- package/dist/modules/media-source.d.ts +230 -0
- package/dist/modules/media-source.d.ts.map +1 -0
- package/dist/modules/media-source.js +1095 -0
- package/dist/modules/misc.d.ts +127 -0
- package/dist/modules/misc.d.ts.map +1 -0
- package/dist/modules/misc.js +462 -0
- package/dist/modules/mp3/mp3-demuxer.d.ts +32 -0
- package/dist/modules/mp3/mp3-demuxer.d.ts.map +1 -0
- package/dist/modules/mp3/mp3-demuxer.js +160 -0
- package/dist/modules/mp3/mp3-misc.d.ts +37 -0
- package/dist/modules/mp3/mp3-misc.d.ts.map +1 -0
- package/dist/modules/mp3/mp3-misc.js +122 -0
- package/dist/modules/mp3/mp3-muxer.d.ts +27 -0
- package/dist/modules/mp3/mp3-muxer.d.ts.map +1 -0
- package/dist/modules/mp3/mp3-muxer.js +112 -0
- package/dist/modules/mp3/mp3-reader.d.ts +25 -0
- package/dist/modules/mp3/mp3-reader.d.ts.map +1 -0
- package/dist/modules/mp3/mp3-reader.js +73 -0
- package/dist/modules/mp3/mp3-writer.d.ts +30 -0
- package/dist/modules/mp3/mp3-writer.d.ts.map +1 -0
- package/dist/modules/mp3/mp3-writer.js +72 -0
- package/dist/modules/muxer.d.ts +32 -0
- package/dist/modules/muxer.d.ts.map +1 -0
- package/dist/modules/muxer.js +50 -0
- package/dist/modules/ogg/ogg-demuxer.d.ts +53 -0
- package/dist/modules/ogg/ogg-demuxer.d.ts.map +1 -0
- package/dist/modules/ogg/ogg-demuxer.js +701 -0
- package/dist/modules/ogg/ogg-misc.d.ts +27 -0
- package/dist/modules/ogg/ogg-misc.d.ts.map +1 -0
- package/dist/modules/ogg/ogg-misc.js +78 -0
- package/dist/modules/ogg/ogg-muxer.d.ts +58 -0
- package/dist/modules/ogg/ogg-muxer.d.ts.map +1 -0
- package/dist/modules/ogg/ogg-muxer.js +345 -0
- package/dist/modules/ogg/ogg-reader.d.ts +37 -0
- package/dist/modules/ogg/ogg-reader.d.ts.map +1 -0
- package/dist/modules/ogg/ogg-reader.js +104 -0
- package/dist/modules/output-format.d.ts +285 -0
- package/dist/modules/output-format.d.ts.map +1 -0
- package/dist/modules/output-format.js +385 -0
- package/dist/modules/output.d.ts +134 -0
- package/dist/modules/output.d.ts.map +1 -0
- package/dist/modules/output.js +269 -0
- package/dist/modules/packet.d.ts +86 -0
- package/dist/modules/packet.d.ts.map +1 -0
- package/dist/modules/packet.js +133 -0
- package/dist/modules/pcm.d.ts +12 -0
- package/dist/modules/pcm.d.ts.map +1 -0
- package/dist/modules/pcm.js +85 -0
- package/dist/modules/reader.d.ts +40 -0
- package/dist/modules/reader.d.ts.map +1 -0
- package/dist/modules/reader.js +153 -0
- package/dist/modules/sample.d.ts +186 -0
- package/dist/modules/sample.d.ts.map +1 -0
- package/dist/modules/sample.js +798 -0
- package/dist/modules/source.d.ts +76 -0
- package/dist/modules/source.d.ts.map +1 -0
- package/dist/modules/source.js +183 -0
- package/dist/modules/subtitles.d.ts +37 -0
- package/dist/modules/subtitles.d.ts.map +1 -0
- package/dist/modules/subtitles.js +89 -0
- package/dist/modules/target.d.ts +58 -0
- package/dist/modules/target.d.ts.map +1 -0
- package/dist/modules/target.js +63 -0
- package/dist/modules/wave/riff-reader.d.ts +19 -0
- package/dist/modules/wave/riff-reader.d.ts.map +1 -0
- package/dist/modules/wave/riff-reader.js +38 -0
- package/dist/modules/wave/riff-writer.d.ts +18 -0
- package/dist/modules/wave/riff-writer.d.ts.map +1 -0
- package/dist/modules/wave/riff-writer.js +25 -0
- package/dist/modules/wave/wave-demuxer.d.ts +42 -0
- package/dist/modules/wave/wave-demuxer.d.ts.map +1 -0
- package/dist/modules/wave/wave-demuxer.js +239 -0
- package/dist/modules/wave/wave-muxer.d.ts +27 -0
- package/dist/modules/wave/wave-muxer.d.ts.map +1 -0
- package/dist/modules/wave/wave-muxer.js +108 -0
- package/dist/modules/writer.d.ts +85 -0
- package/dist/modules/writer.d.ts.map +1 -0
- package/dist/modules/writer.js +347 -0
- package/package.json +14 -10
- package/src/codec-data.ts +1394 -0
- package/src/codec.ts +1392 -0
- package/src/conversion.ts +1199 -0
- package/src/custom-coder.ts +162 -0
- package/src/demuxer.ts +22 -0
- package/src/index.ts +148 -0
- package/src/input-format.ts +386 -0
- package/src/input-track.ts +341 -0
- package/src/input.ts +138 -0
- package/src/isobmff/isobmff-boxes.ts +1365 -0
- package/src/isobmff/isobmff-demuxer.ts +2646 -0
- package/src/isobmff/isobmff-misc.ts +29 -0
- package/src/isobmff/isobmff-muxer.ts +1210 -0
- package/src/isobmff/isobmff-reader.ts +137 -0
- package/src/matroska/ebml.ts +595 -0
- package/src/matroska/matroska-demuxer.ts +1677 -0
- package/src/matroska/matroska-misc.ts +29 -0
- package/src/matroska/matroska-muxer.ts +999 -0
- package/src/media-sink.ts +1577 -0
- package/src/media-source.ts +1406 -0
- package/src/misc.ts +584 -0
- package/src/mp3/mp3-demuxer.ts +228 -0
- package/src/mp3/mp3-misc.ts +154 -0
- package/src/mp3/mp3-muxer.ts +153 -0
- package/src/mp3/mp3-reader.ts +93 -0
- package/src/mp3/mp3-writer.ts +112 -0
- package/src/muxer.ts +88 -0
- package/src/ogg/ogg-demuxer.ts +985 -0
- package/src/ogg/ogg-misc.ts +116 -0
- package/src/ogg/ogg-muxer.ts +480 -0
- package/src/ogg/ogg-reader.ts +143 -0
- package/src/output-format.ts +689 -0
- package/src/output.ts +427 -0
- package/src/packet.ts +180 -0
- package/src/pcm.ts +112 -0
- package/src/reader.ts +205 -0
- package/src/sample.ts +1029 -0
- package/src/source.ts +279 -0
- package/src/subtitles.ts +131 -0
- package/src/target.ts +106 -0
- package/src/tsconfig.json +13 -0
- package/src/wave/riff-reader.ts +48 -0
- package/src/wave/riff-writer.ts +30 -0
- package/src/wave/wave-demuxer.ts +317 -0
- package/src/wave/wave-muxer.ts +145 -0
- package/src/writer.ts +461 -0
- /package/dist/{mediabunny.js → bundles/mediabunny.cjs} +0 -0
- /package/dist/{mediabunny.min.js → bundles/mediabunny.min.cjs} +0 -0
- /package/dist/{mediabunny.min.mjs → bundles/mediabunny.min.mjs} +0 -0
- /package/dist/{mediabunny.mjs → bundles/mediabunny.mjs} +0 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2025-present, Vanilagy and contributors
|
|
3
|
+
*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import { customAudioDecoders, customVideoDecoders } from './custom-coder.js';
|
|
9
|
+
import { EncodedPacketSink } from './media-sink.js';
|
|
10
|
+
import { assert } from './misc.js';
|
|
11
|
+
/**
|
|
12
|
+
* Represents a media track in an input file.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export class InputTrack {
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor(backing) {
|
|
18
|
+
this._backing = backing;
|
|
19
|
+
}
|
|
20
|
+
/** Returns true iff this track is a video track. */
|
|
21
|
+
isVideoTrack() {
|
|
22
|
+
return this instanceof InputVideoTrack;
|
|
23
|
+
}
|
|
24
|
+
/** Returns true iff this track is an audio track. */
|
|
25
|
+
isAudioTrack() {
|
|
26
|
+
return this instanceof InputAudioTrack;
|
|
27
|
+
}
|
|
28
|
+
/** The unique ID of this track in the input file. */
|
|
29
|
+
get id() {
|
|
30
|
+
return this._backing.getId();
|
|
31
|
+
}
|
|
32
|
+
/** The ISO 639-2/T language code for this track. If the language is unknown, this field is 'und' (undetermined). */
|
|
33
|
+
get languageCode() {
|
|
34
|
+
return this._backing.getLanguageCode();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A positive number x such that all timestamps and durations of all packets of this track are
|
|
38
|
+
* integer multiples of 1/x.
|
|
39
|
+
*/
|
|
40
|
+
get timeResolution() {
|
|
41
|
+
return this._backing.getTimeResolution();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Returns the start timestamp of the first packet of this track, in seconds. While often near zero, this value
|
|
45
|
+
* may be positive or even negative. A negative starting timestamp means the track's timing has been offset. Samples
|
|
46
|
+
* with a negative timestamp should not be presented.
|
|
47
|
+
*/
|
|
48
|
+
getFirstTimestamp() {
|
|
49
|
+
return this._backing.getFirstTimestamp();
|
|
50
|
+
}
|
|
51
|
+
/** Returns the end timestamp of the last packet of this track, in seconds. */
|
|
52
|
+
computeDuration() {
|
|
53
|
+
return this._backing.computeDuration();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Computes aggregate packet statistics for this track, such as average packet rate or bitrate.
|
|
57
|
+
*
|
|
58
|
+
* @param targetPacketCount - This optional parameter sets a target for how many packets this method must have
|
|
59
|
+
* looked at before it can return early; this means, you can use it to aggregate only a subset (prefix) of all
|
|
60
|
+
* packets. This is very useful for getting a great estimate of video frame rate without having to scan through the
|
|
61
|
+
* entire file.
|
|
62
|
+
*/
|
|
63
|
+
async computePacketStats(targetPacketCount = Infinity) {
|
|
64
|
+
const sink = new EncodedPacketSink(this);
|
|
65
|
+
let startTimestamp = Infinity;
|
|
66
|
+
let endTimestamp = -Infinity;
|
|
67
|
+
let packetCount = 0;
|
|
68
|
+
let totalPacketBytes = 0;
|
|
69
|
+
for await (const packet of sink.packets(undefined, undefined, { metadataOnly: true })) {
|
|
70
|
+
if (packetCount >= targetPacketCount
|
|
71
|
+
// This additional condition is needed to produce correct results with out-of-presentation-order packets
|
|
72
|
+
&& packet.timestamp >= endTimestamp) {
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
startTimestamp = Math.min(startTimestamp, packet.timestamp);
|
|
76
|
+
endTimestamp = Math.max(endTimestamp, packet.timestamp + packet.duration);
|
|
77
|
+
packetCount++;
|
|
78
|
+
totalPacketBytes += packet.byteLength;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
packetCount,
|
|
82
|
+
averagePacketRate: packetCount
|
|
83
|
+
? Number((packetCount / (endTimestamp - startTimestamp)).toPrecision(16))
|
|
84
|
+
: 0,
|
|
85
|
+
averageBitrate: packetCount
|
|
86
|
+
? Number((8 * totalPacketBytes / (endTimestamp - startTimestamp)).toPrecision(16))
|
|
87
|
+
: 0,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Represents a video track in an input file.
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export class InputVideoTrack extends InputTrack {
|
|
96
|
+
/** @internal */
|
|
97
|
+
constructor(backing) {
|
|
98
|
+
super(backing);
|
|
99
|
+
this._backing = backing;
|
|
100
|
+
}
|
|
101
|
+
get type() {
|
|
102
|
+
return 'video';
|
|
103
|
+
}
|
|
104
|
+
get codec() {
|
|
105
|
+
return this._backing.getCodec();
|
|
106
|
+
}
|
|
107
|
+
/** The width in pixels of the track's coded samples, before any transformations or rotations. */
|
|
108
|
+
get codedWidth() {
|
|
109
|
+
return this._backing.getCodedWidth();
|
|
110
|
+
}
|
|
111
|
+
/** The height in pixels of the track's coded samples, before any transformations or rotations. */
|
|
112
|
+
get codedHeight() {
|
|
113
|
+
return this._backing.getCodedHeight();
|
|
114
|
+
}
|
|
115
|
+
/** The angle in degrees by which the track's frames should be rotated (clockwise). */
|
|
116
|
+
get rotation() {
|
|
117
|
+
return this._backing.getRotation();
|
|
118
|
+
}
|
|
119
|
+
/** The width in pixels of the track's frames after rotation. */
|
|
120
|
+
get displayWidth() {
|
|
121
|
+
const rotation = this._backing.getRotation();
|
|
122
|
+
return rotation % 180 === 0 ? this._backing.getCodedWidth() : this._backing.getCodedHeight();
|
|
123
|
+
}
|
|
124
|
+
/** The height in pixels of the track's frames after rotation. */
|
|
125
|
+
get displayHeight() {
|
|
126
|
+
const rotation = this._backing.getRotation();
|
|
127
|
+
return rotation % 180 === 0 ? this._backing.getCodedHeight() : this._backing.getCodedWidth();
|
|
128
|
+
}
|
|
129
|
+
/** Returns the color space of the track's samples. */
|
|
130
|
+
getColorSpace() {
|
|
131
|
+
return this._backing.getColorSpace();
|
|
132
|
+
}
|
|
133
|
+
/** If this method returns true, the track's samples use a high dynamic range (HDR). */
|
|
134
|
+
async hasHighDynamicRange() {
|
|
135
|
+
const colorSpace = await this._backing.getColorSpace();
|
|
136
|
+
return colorSpace.primaries === 'bt2020' || colorSpace.primaries === 'smpte432'
|
|
137
|
+
|| colorSpace.transfer === 'pg' || colorSpace.transfer === 'hlg'
|
|
138
|
+
|| colorSpace.matrix === 'bt2020-ncl';
|
|
139
|
+
}
|
|
140
|
+
/** Returns the decoder configuration for decoding the track's packets using a VideoDecoder. */
|
|
141
|
+
getDecoderConfig() {
|
|
142
|
+
return this._backing.getDecoderConfig();
|
|
143
|
+
}
|
|
144
|
+
async getCodecParameterString() {
|
|
145
|
+
const decoderConfig = await this._backing.getDecoderConfig();
|
|
146
|
+
return decoderConfig?.codec ?? null;
|
|
147
|
+
}
|
|
148
|
+
async canDecode() {
|
|
149
|
+
try {
|
|
150
|
+
const decoderConfig = await this._backing.getDecoderConfig();
|
|
151
|
+
if (!decoderConfig) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const codec = this._backing.getCodec();
|
|
155
|
+
assert(codec !== null);
|
|
156
|
+
if (customVideoDecoders.some(x => x.supports(codec, decoderConfig))) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
if (typeof VideoDecoder === 'undefined') {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
const support = await VideoDecoder.isConfigSupported(decoderConfig);
|
|
163
|
+
return support.supported === true;
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
console.error('Error during decodability check:', error);
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Represents an audio track in an input file.
|
|
173
|
+
* @public
|
|
174
|
+
*/
|
|
175
|
+
export class InputAudioTrack extends InputTrack {
|
|
176
|
+
/** @internal */
|
|
177
|
+
constructor(backing) {
|
|
178
|
+
super(backing);
|
|
179
|
+
this._backing = backing;
|
|
180
|
+
}
|
|
181
|
+
get type() {
|
|
182
|
+
return 'audio';
|
|
183
|
+
}
|
|
184
|
+
get codec() {
|
|
185
|
+
return this._backing.getCodec();
|
|
186
|
+
}
|
|
187
|
+
/** The number of audio channels in the track. */
|
|
188
|
+
get numberOfChannels() {
|
|
189
|
+
return this._backing.getNumberOfChannels();
|
|
190
|
+
}
|
|
191
|
+
/** The track's audio sample rate in hertz. */
|
|
192
|
+
get sampleRate() {
|
|
193
|
+
return this._backing.getSampleRate();
|
|
194
|
+
}
|
|
195
|
+
/** Returns the decoder configuration for decoding the track's packets using an AudioDecoder. */
|
|
196
|
+
getDecoderConfig() {
|
|
197
|
+
return this._backing.getDecoderConfig();
|
|
198
|
+
}
|
|
199
|
+
async getCodecParameterString() {
|
|
200
|
+
const decoderConfig = await this._backing.getDecoderConfig();
|
|
201
|
+
return decoderConfig?.codec ?? null;
|
|
202
|
+
}
|
|
203
|
+
async canDecode() {
|
|
204
|
+
try {
|
|
205
|
+
const decoderConfig = await this._backing.getDecoderConfig();
|
|
206
|
+
if (!decoderConfig) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
const codec = this._backing.getCodec();
|
|
210
|
+
assert(codec !== null);
|
|
211
|
+
if (customAudioDecoders.some(x => x.supports(codec, decoderConfig))) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
if (decoderConfig.codec.startsWith('pcm-')) {
|
|
215
|
+
return true; // Since we decode it ourselves
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
if (typeof AudioDecoder === 'undefined') {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
const support = await AudioDecoder.isConfigSupported(decoderConfig);
|
|
222
|
+
return support.supported === true;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (error) {
|
|
226
|
+
console.error('Error during decodability check:', error);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2025-present, Vanilagy and contributors
|
|
3
|
+
*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import { InputFormat } from './input-format';
|
|
9
|
+
import { Source } from './source';
|
|
10
|
+
/**
|
|
11
|
+
* The options for creating an Input object.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export type InputOptions<S extends Source = Source> = {
|
|
15
|
+
/** A list of supported formats. If the source file is not of one of these formats, then it cannot be read. */
|
|
16
|
+
formats: InputFormat[];
|
|
17
|
+
/** The source from which data will be read. */
|
|
18
|
+
source: S;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Represents an input media file. This is the root object from which all media read operations start.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare class Input<S extends Source = Source> {
|
|
25
|
+
constructor(options: InputOptions<S>);
|
|
26
|
+
/**
|
|
27
|
+
* Returns the source from which this input file reads its data. This is the same source that was passed to the
|
|
28
|
+
* constructor.
|
|
29
|
+
*/
|
|
30
|
+
get source(): S;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the format of the input file. You can compare this result directly to the InputFormat singletons or use
|
|
33
|
+
* `instanceof` checks for subset-aware logic (for example, `format instanceof MatroskaInputFormat` is true for
|
|
34
|
+
* both MKV and WebM).
|
|
35
|
+
*/
|
|
36
|
+
getFormat(): Promise<InputFormat>;
|
|
37
|
+
/**
|
|
38
|
+
* Computes the duration of the input file, in seconds. More precisely, returns the largest end timestamp among
|
|
39
|
+
* all tracks.
|
|
40
|
+
*/
|
|
41
|
+
computeDuration(): Promise<number>;
|
|
42
|
+
/** Returns the list of all tracks of this input file. */
|
|
43
|
+
getTracks(): Promise<import("./input-track").InputTrack[]>;
|
|
44
|
+
/** Returns the list of all video tracks of this input file. */
|
|
45
|
+
getVideoTracks(): Promise<import("./input-track").InputVideoTrack[]>;
|
|
46
|
+
/** Returns the primary video track of this input file, or null if there are no video tracks. */
|
|
47
|
+
getPrimaryVideoTrack(): Promise<import("./input-track").InputVideoTrack | null>;
|
|
48
|
+
/** Returns the list of all audio tracks of this input file. */
|
|
49
|
+
getAudioTracks(): Promise<import("./input-track").InputAudioTrack[]>;
|
|
50
|
+
/** Returns the primary audio track of this input file, or null if there are no audio tracks. */
|
|
51
|
+
getPrimaryAudioTrack(): Promise<import("./input-track").InputAudioTrack | null>;
|
|
52
|
+
/** Returns the full MIME type of this input file, including track codecs. */
|
|
53
|
+
getMimeType(): Promise<string>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/input.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACrD,8GAA8G;IAC9G,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,+CAA+C;IAC/C,MAAM,EAAE,CAAC,CAAC;CACV,CAAC;AAEF;;;GAGG;AACH,qBAAa,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;gBAY/B,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IAiCpC;;;OAGG;IACH,IAAI,MAAM,MAET;IAED;;;;OAIG;IACG,SAAS;IAMf;;;OAGG;IACG,eAAe;IAKrB,yDAAyD;IACnD,SAAS;IAKf,+DAA+D;IACzD,cAAc;IAKpB,gGAAgG;IAC1F,oBAAoB;IAK1B,+DAA+D;IACzD,cAAc;IAKpB,gGAAgG;IAC1F,oBAAoB;IAK1B,6EAA6E;IACvE,WAAW;CAIjB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2025-present, Vanilagy and contributors
|
|
3
|
+
*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import { InputFormat } from './input-format.js';
|
|
9
|
+
import { assert } from './misc.js';
|
|
10
|
+
import { Reader } from './reader.js';
|
|
11
|
+
import { Source } from './source.js';
|
|
12
|
+
/**
|
|
13
|
+
* Represents an input media file. This is the root object from which all media read operations start.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export class Input {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
/** @internal */
|
|
19
|
+
this._demuxerPromise = null;
|
|
20
|
+
/** @internal */
|
|
21
|
+
this._format = null;
|
|
22
|
+
if (!options || typeof options !== 'object') {
|
|
23
|
+
throw new TypeError('options must be an object.');
|
|
24
|
+
}
|
|
25
|
+
if (!Array.isArray(options.formats) || options.formats.some(x => !(x instanceof InputFormat))) {
|
|
26
|
+
throw new TypeError('options.formats must be an array of InputFormat.');
|
|
27
|
+
}
|
|
28
|
+
if (!(options.source instanceof Source)) {
|
|
29
|
+
throw new TypeError('options.source must be a Source.');
|
|
30
|
+
}
|
|
31
|
+
this._formats = options.formats;
|
|
32
|
+
this._source = options.source;
|
|
33
|
+
this._mainReader = new Reader(options.source);
|
|
34
|
+
}
|
|
35
|
+
/** @internal */
|
|
36
|
+
_getDemuxer() {
|
|
37
|
+
return this._demuxerPromise ??= (async () => {
|
|
38
|
+
await this._mainReader.loadRange(0, 4096); // Load the first 4 kiB so we can determine the format
|
|
39
|
+
for (const format of this._formats) {
|
|
40
|
+
const canRead = await format._canReadInput(this);
|
|
41
|
+
if (canRead) {
|
|
42
|
+
this._format = format;
|
|
43
|
+
return format._createDemuxer(this);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
throw new Error('Input has an unsupported or unrecognizable format.');
|
|
47
|
+
})();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the source from which this input file reads its data. This is the same source that was passed to the
|
|
51
|
+
* constructor.
|
|
52
|
+
*/
|
|
53
|
+
get source() {
|
|
54
|
+
return this._source;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns the format of the input file. You can compare this result directly to the InputFormat singletons or use
|
|
58
|
+
* `instanceof` checks for subset-aware logic (for example, `format instanceof MatroskaInputFormat` is true for
|
|
59
|
+
* both MKV and WebM).
|
|
60
|
+
*/
|
|
61
|
+
async getFormat() {
|
|
62
|
+
await this._getDemuxer();
|
|
63
|
+
assert(this._format);
|
|
64
|
+
return this._format;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Computes the duration of the input file, in seconds. More precisely, returns the largest end timestamp among
|
|
68
|
+
* all tracks.
|
|
69
|
+
*/
|
|
70
|
+
async computeDuration() {
|
|
71
|
+
const demuxer = await this._getDemuxer();
|
|
72
|
+
return demuxer.computeDuration();
|
|
73
|
+
}
|
|
74
|
+
/** Returns the list of all tracks of this input file. */
|
|
75
|
+
async getTracks() {
|
|
76
|
+
const demuxer = await this._getDemuxer();
|
|
77
|
+
return demuxer.getTracks();
|
|
78
|
+
}
|
|
79
|
+
/** Returns the list of all video tracks of this input file. */
|
|
80
|
+
async getVideoTracks() {
|
|
81
|
+
const tracks = await this.getTracks();
|
|
82
|
+
return tracks.filter(x => x.isVideoTrack());
|
|
83
|
+
}
|
|
84
|
+
/** Returns the primary video track of this input file, or null if there are no video tracks. */
|
|
85
|
+
async getPrimaryVideoTrack() {
|
|
86
|
+
const tracks = await this.getTracks();
|
|
87
|
+
return tracks.find(x => x.isVideoTrack()) ?? null;
|
|
88
|
+
}
|
|
89
|
+
/** Returns the list of all audio tracks of this input file. */
|
|
90
|
+
async getAudioTracks() {
|
|
91
|
+
const tracks = await this.getTracks();
|
|
92
|
+
return tracks.filter(x => x.isAudioTrack());
|
|
93
|
+
}
|
|
94
|
+
/** Returns the primary audio track of this input file, or null if there are no audio tracks. */
|
|
95
|
+
async getPrimaryAudioTrack() {
|
|
96
|
+
const tracks = await this.getTracks();
|
|
97
|
+
return tracks.find(x => x.isAudioTrack()) ?? null;
|
|
98
|
+
}
|
|
99
|
+
/** Returns the full MIME type of this input file, including track codecs. */
|
|
100
|
+
async getMimeType() {
|
|
101
|
+
const demuxer = await this._getDemuxer();
|
|
102
|
+
return demuxer.getMimeType();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2025-present, Vanilagy and contributors
|
|
3
|
+
*
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import { Writer } from '../writer';
|
|
9
|
+
import { IsobmffAudioTrackData, IsobmffSubtitleTrackData, IsobmffTrackData, IsobmffVideoTrackData } from './isobmff-muxer';
|
|
10
|
+
export declare class IsobmffBoxWriter {
|
|
11
|
+
private writer;
|
|
12
|
+
private helper;
|
|
13
|
+
private helperView;
|
|
14
|
+
/**
|
|
15
|
+
* Stores the position from the start of the file to where boxes elements have been written. This is used to
|
|
16
|
+
* rewrite/edit elements that were already added before, and to measure sizes of things.
|
|
17
|
+
*/
|
|
18
|
+
offsets: WeakMap<Box, number>;
|
|
19
|
+
constructor(writer: Writer);
|
|
20
|
+
writeU32(value: number): void;
|
|
21
|
+
writeU64(value: number): void;
|
|
22
|
+
writeAscii(text: string): void;
|
|
23
|
+
writeBox(box: Box): void;
|
|
24
|
+
writeBoxHeader(box: Box, size: number): void;
|
|
25
|
+
measureBoxHeader(box: Box): number;
|
|
26
|
+
patchBox(box: Box): void;
|
|
27
|
+
measureBox(box: Box): number;
|
|
28
|
+
}
|
|
29
|
+
export interface Box {
|
|
30
|
+
type: string;
|
|
31
|
+
contents?: Uint8Array;
|
|
32
|
+
children?: (Box | null)[];
|
|
33
|
+
size?: number;
|
|
34
|
+
largeSize?: boolean;
|
|
35
|
+
}
|
|
36
|
+
type NestedNumberArray = (number | NestedNumberArray)[];
|
|
37
|
+
export declare const box: (type: string, contents?: NestedNumberArray, children?: (Box | null)[]) => Box;
|
|
38
|
+
/** A FullBox always starts with a version byte, followed by three flag bytes. */
|
|
39
|
+
export declare const fullBox: (type: string, version: number, flags: number, contents?: NestedNumberArray, children?: Box[]) => Box;
|
|
40
|
+
/**
|
|
41
|
+
* File Type Compatibility Box: Allows the reader to determine whether this is a type of file that the
|
|
42
|
+
* reader understands.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ftyp: (details: {
|
|
45
|
+
isQuickTime: boolean;
|
|
46
|
+
holdsAvc: boolean;
|
|
47
|
+
fragmented: boolean;
|
|
48
|
+
}) => Box;
|
|
49
|
+
/** Movie Sample Data Box. Contains the actual frames/samples of the media. */
|
|
50
|
+
export declare const mdat: (reserveLargeSize: boolean) => Box;
|
|
51
|
+
/**
|
|
52
|
+
* Movie Box: Used to specify the information that defines a movie - that is, the information that allows
|
|
53
|
+
* an application to interpret the sample data that is stored elsewhere.
|
|
54
|
+
*/
|
|
55
|
+
export declare const moov: (trackDatas: IsobmffTrackData[], creationTime: number, fragmented?: boolean) => Box;
|
|
56
|
+
/** Movie Header Box: Used to specify the characteristics of the entire movie, such as timescale and duration. */
|
|
57
|
+
export declare const mvhd: (creationTime: number, trackDatas: IsobmffTrackData[]) => Box;
|
|
58
|
+
/**
|
|
59
|
+
* Track Box: Defines a single track of a movie. A movie may consist of one or more tracks. Each track is
|
|
60
|
+
* independent of the other tracks in the movie and carries its own temporal and spatial information. Each Track Box
|
|
61
|
+
* contains its associated Media Box.
|
|
62
|
+
*/
|
|
63
|
+
export declare const trak: (trackData: IsobmffTrackData, creationTime: number) => Box;
|
|
64
|
+
/** Track Header Box: Specifies the characteristics of a single track within a movie. */
|
|
65
|
+
export declare const tkhd: (trackData: IsobmffTrackData, creationTime: number) => Box;
|
|
66
|
+
/** Media Box: Describes and define a track's media type and sample data. */
|
|
67
|
+
export declare const mdia: (trackData: IsobmffTrackData, creationTime: number) => Box;
|
|
68
|
+
/** Media Header Box: Specifies the characteristics of a media, including timescale and duration. */
|
|
69
|
+
export declare const mdhd: (trackData: IsobmffTrackData, creationTime: number) => Box;
|
|
70
|
+
/** Handler Reference Box: Specifies the media handler component that is to be used to interpret the media's data. */
|
|
71
|
+
export declare const hdlr: (trackData: IsobmffTrackData) => Box;
|
|
72
|
+
/**
|
|
73
|
+
* Media Information Box: Stores handler-specific information for a track's media data. The media handler uses this
|
|
74
|
+
* information to map from media time to media data and to process the media data.
|
|
75
|
+
*/
|
|
76
|
+
export declare const minf: (trackData: IsobmffTrackData) => Box;
|
|
77
|
+
/** Video Media Information Header Box: Defines specific color and graphics mode information. */
|
|
78
|
+
export declare const vmhd: () => Box;
|
|
79
|
+
/** Sound Media Information Header Box: Stores the sound media's control information, such as balance. */
|
|
80
|
+
export declare const smhd: () => Box;
|
|
81
|
+
/** Null Media Header Box. */
|
|
82
|
+
export declare const nmhd: () => Box;
|
|
83
|
+
/**
|
|
84
|
+
* Data Information Box: Contains information specifying the data handler component that provides access to the
|
|
85
|
+
* media data. The data handler component uses the Data Information Box to interpret the media's data.
|
|
86
|
+
*/
|
|
87
|
+
export declare const dinf: () => Box;
|
|
88
|
+
/**
|
|
89
|
+
* Data Reference Box: Contains tabular data that instructs the data handler component how to access the media's data.
|
|
90
|
+
*/
|
|
91
|
+
export declare const dref: () => Box;
|
|
92
|
+
export declare const url: () => Box;
|
|
93
|
+
/**
|
|
94
|
+
* Sample Table Box: Contains information for converting from media time to sample number to sample location. This box
|
|
95
|
+
* also indicates how to interpret the sample (for example, whether to decompress the video data and, if so, how).
|
|
96
|
+
*/
|
|
97
|
+
export declare const stbl: (trackData: IsobmffTrackData) => Box;
|
|
98
|
+
/**
|
|
99
|
+
* Sample Description Box: Stores information that allows you to decode samples in the media. The data stored in the
|
|
100
|
+
* sample description varies, depending on the media type.
|
|
101
|
+
*/
|
|
102
|
+
export declare const stsd: (trackData: IsobmffTrackData) => Box;
|
|
103
|
+
/** Video Sample Description Box: Contains information that defines how to interpret video media data. */
|
|
104
|
+
export declare const videoSampleDescription: (compressionType: string, trackData: IsobmffVideoTrackData) => Box;
|
|
105
|
+
/** Colour Information Box: Specifies the color space of the video. */
|
|
106
|
+
export declare const colr: (trackData: IsobmffVideoTrackData) => Box;
|
|
107
|
+
/** AVC Configuration Box: Provides additional information to the decoder. */
|
|
108
|
+
export declare const avcC: (trackData: IsobmffVideoTrackData) => Box;
|
|
109
|
+
/** HEVC Configuration Box: Provides additional information to the decoder. */
|
|
110
|
+
export declare const hvcC: (trackData: IsobmffVideoTrackData) => Box;
|
|
111
|
+
/** VP Configuration Box: Provides additional information to the decoder. */
|
|
112
|
+
export declare const vpcC: (trackData: IsobmffVideoTrackData) => Box | null;
|
|
113
|
+
/** AV1 Configuration Box: Provides additional information to the decoder. */
|
|
114
|
+
export declare const av1C: (trackData: IsobmffVideoTrackData) => Box;
|
|
115
|
+
/** Sound Sample Description Box: Contains information that defines how to interpret sound media data. */
|
|
116
|
+
export declare const soundSampleDescription: (compressionType: string, trackData: IsobmffAudioTrackData) => Box;
|
|
117
|
+
/** MPEG-4 Elementary Stream Descriptor Box. */
|
|
118
|
+
export declare const esds: (trackData: IsobmffAudioTrackData) => Box;
|
|
119
|
+
export declare const wave: (trackData: IsobmffAudioTrackData) => Box;
|
|
120
|
+
export declare const frma: (trackData: IsobmffAudioTrackData) => Box;
|
|
121
|
+
export declare const enda: (trackData: IsobmffAudioTrackData) => Box;
|
|
122
|
+
/** Opus Specific Box. */
|
|
123
|
+
export declare const dOps: (trackData: IsobmffAudioTrackData) => Box;
|
|
124
|
+
/** FLAC specific box. */
|
|
125
|
+
export declare const dfLa: (trackData: IsobmffAudioTrackData) => Box;
|
|
126
|
+
export declare const subtitleSampleDescription: (compressionType: string, trackData: IsobmffSubtitleTrackData) => Box;
|
|
127
|
+
export declare const vttC: (trackData: IsobmffSubtitleTrackData) => Box;
|
|
128
|
+
export declare const txtC: (textConfig: Uint8Array) => Box;
|
|
129
|
+
/**
|
|
130
|
+
* Time-To-Sample Box: Stores duration information for a media's samples, providing a mapping from a time in a media
|
|
131
|
+
* to the corresponding data sample. The table is compact, meaning that consecutive samples with the same time delta
|
|
132
|
+
* will be grouped.
|
|
133
|
+
*/
|
|
134
|
+
export declare const stts: (trackData: IsobmffTrackData) => Box;
|
|
135
|
+
/** Sync Sample Box: Identifies the key frames in the media, marking the random access points within a stream. */
|
|
136
|
+
export declare const stss: (trackData: IsobmffTrackData) => Box | null;
|
|
137
|
+
/**
|
|
138
|
+
* Sample-To-Chunk Box: As samples are added to a media, they are collected into chunks that allow optimized data
|
|
139
|
+
* access. A chunk contains one or more samples. Chunks in a media may have different sizes, and the samples within a
|
|
140
|
+
* chunk may have different sizes. The Sample-To-Chunk Box stores chunk information for the samples in a media, stored
|
|
141
|
+
* in a compactly-coded fashion.
|
|
142
|
+
*/
|
|
143
|
+
export declare const stsc: (trackData: IsobmffTrackData) => Box;
|
|
144
|
+
/** Sample Size Box: Specifies the byte size of each sample in the media. */
|
|
145
|
+
export declare const stsz: (trackData: IsobmffTrackData) => Box;
|
|
146
|
+
/** Chunk Offset Box: Identifies the location of each chunk of data in the media's data stream, relative to the file. */
|
|
147
|
+
export declare const stco: (trackData: IsobmffTrackData) => Box;
|
|
148
|
+
/**
|
|
149
|
+
* Composition Time to Sample Box: Stores composition time offset information (PTS-DTS) for a
|
|
150
|
+
* media's samples. The table is compact, meaning that consecutive samples with the same time
|
|
151
|
+
* composition time offset will be grouped.
|
|
152
|
+
*/
|
|
153
|
+
export declare const ctts: (trackData: IsobmffTrackData) => Box;
|
|
154
|
+
/**
|
|
155
|
+
* Composition to Decode Box: Stores information about the composition and display times of the media samples.
|
|
156
|
+
*/
|
|
157
|
+
export declare const cslg: (trackData: IsobmffTrackData) => Box | null;
|
|
158
|
+
/**
|
|
159
|
+
* Movie Extends Box: This box signals to readers that the file is fragmented. Contains a single Track Extends Box
|
|
160
|
+
* for each track in the movie.
|
|
161
|
+
*/
|
|
162
|
+
export declare const mvex: (trackDatas: IsobmffTrackData[]) => Box;
|
|
163
|
+
/** Track Extends Box: Contains the default values used by the movie fragments. */
|
|
164
|
+
export declare const trex: (trackData: IsobmffTrackData) => Box;
|
|
165
|
+
/**
|
|
166
|
+
* Movie Fragment Box: The movie fragments extend the presentation in time. They provide the information that would
|
|
167
|
+
* previously have been in the Movie Box.
|
|
168
|
+
*/
|
|
169
|
+
export declare const moof: (sequenceNumber: number, trackDatas: IsobmffTrackData[]) => Box;
|
|
170
|
+
/** Movie Fragment Header Box: Contains a sequence number as a safety check. */
|
|
171
|
+
export declare const mfhd: (sequenceNumber: number) => Box;
|
|
172
|
+
/** Track Fragment Box */
|
|
173
|
+
export declare const traf: (trackData: IsobmffTrackData) => Box;
|
|
174
|
+
/** Track Fragment Header Box: Provides a reference to the extended track, and flags. */
|
|
175
|
+
export declare const tfhd: (trackData: IsobmffTrackData) => Box;
|
|
176
|
+
/**
|
|
177
|
+
* Track Fragment Decode Time Box: Provides the absolute decode time of the first sample of the fragment. This is
|
|
178
|
+
* useful for performing random access on the media file.
|
|
179
|
+
*/
|
|
180
|
+
export declare const tfdt: (trackData: IsobmffTrackData) => Box;
|
|
181
|
+
/** Track Run Box: Specifies a run of contiguous samples for a given track. */
|
|
182
|
+
export declare const trun: (trackData: IsobmffTrackData) => Box;
|
|
183
|
+
/**
|
|
184
|
+
* Movie Fragment Random Access Box: For each track, provides pointers to sync samples within the file
|
|
185
|
+
* for random access.
|
|
186
|
+
*/
|
|
187
|
+
export declare const mfra: (trackDatas: IsobmffTrackData[]) => Box;
|
|
188
|
+
/** Track Fragment Random Access Box: Provides pointers to sync samples within the file for random access. */
|
|
189
|
+
export declare const tfra: (trackData: IsobmffTrackData, trackIndex: number) => Box;
|
|
190
|
+
/**
|
|
191
|
+
* Movie Fragment Random Access Offset Box: Provides the size of the enclosing mfra box. This box can be used by readers
|
|
192
|
+
* to quickly locate the mfra box by searching from the end of the file.
|
|
193
|
+
*/
|
|
194
|
+
export declare const mfro: () => Box;
|
|
195
|
+
/** VTT Empty Cue Box */
|
|
196
|
+
export declare const vtte: () => Box;
|
|
197
|
+
/** VTT Cue Box */
|
|
198
|
+
export declare const vttc: (payload: string, timestamp: number | null, identifier: string | null, settings: string | null, sourceId: number | null) => Box;
|
|
199
|
+
/** VTT Additional Text Box */
|
|
200
|
+
export declare const vtta: (notes: string) => Box;
|
|
201
|
+
export {};
|
|
202
|
+
//# sourceMappingURL=isobmff-boxes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isobmff-boxes.d.ts","sourceRoot":"","sources":["../../../src/isobmff/isobmff-boxes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAGN,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EAErB,MAAM,iBAAiB,CAAC;AAGzB,qBAAa,gBAAgB;IAUhB,OAAO,CAAC,MAAM;IAT1B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,UAAU,CAAoC;IAEtD;;;OAGG;IACH,OAAO,uBAA8B;gBAEjB,MAAM,EAAE,MAAM;IAElC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAKtB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,UAAU,CAAC,IAAI,EAAE,MAAM;IAWvB,QAAQ,CAAC,GAAG,EAAE,GAAG;IAqBjB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM;IAMrC,gBAAgB,CAAC,GAAG,EAAE,GAAG;IAIzB,QAAQ,CAAC,GAAG,EAAE,GAAG;IAUjB,UAAU,CAAC,GAAG,EAAE,GAAG;CAYnB;AAwHD,MAAM,WAAW,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,iBAAiB,GAAG,CAAC,MAAM,GA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