@remotion/media-parser 4.0.208 → 4.0.210
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/buffer.js +2 -0
- package/dist/boxes/iso-base-media/get-sample-positions-from-track.js +1 -1
- package/dist/boxes/iso-base-media/make-track.js +14 -2
- package/dist/boxes/iso-base-media/mdat/mdat.d.ts +2 -1
- package/dist/boxes/iso-base-media/mdat/mdat.js +8 -3
- package/dist/boxes/iso-base-media/moov/moov.d.ts +2 -1
- package/dist/boxes/iso-base-media/moov/moov.js +2 -1
- package/dist/boxes/iso-base-media/process-box.d.ts +6 -3
- package/dist/boxes/iso-base-media/process-box.js +20 -5
- package/dist/boxes/iso-base-media/stsd/avcc.d.ts +1 -1
- package/dist/boxes/iso-base-media/stsd/avcc.js +2 -2
- package/dist/boxes/iso-base-media/stsd/ctts.js +2 -5
- package/dist/boxes/iso-base-media/stsd/hvcc.d.ts +1 -1
- package/dist/boxes/iso-base-media/stsd/hvcc.js +2 -2
- package/dist/boxes/iso-base-media/stsd/mebx.d.ts +2 -1
- package/dist/boxes/iso-base-media/stsd/mebx.js +2 -1
- package/dist/boxes/iso-base-media/stsd/samples.d.ts +4 -2
- package/dist/boxes/iso-base-media/stsd/samples.js +69 -11
- package/dist/boxes/iso-base-media/stsd/stsd.d.ts +2 -1
- package/dist/boxes/iso-base-media/stsd/stsd.js +2 -1
- package/dist/boxes/iso-base-media/trak/trak.d.ts +2 -1
- package/dist/boxes/iso-base-media/trak/trak.js +2 -1
- package/dist/boxes/iso-base-media/traversal.d.ts +44 -0
- package/dist/boxes/iso-base-media/traversal.js +211 -0
- package/dist/boxes/webm/color.d.ts +4 -0
- package/dist/boxes/webm/color.js +120 -0
- package/dist/boxes/webm/description.js +1 -1
- package/dist/boxes/webm/get-ready-tracks.js +3 -3
- package/dist/boxes/webm/get-sample-from-block.js +1 -1
- package/dist/boxes/webm/get-track.js +16 -1
- package/dist/boxes/webm/make-track.d.ts +9 -0
- package/dist/boxes/webm/make-track.js +260 -0
- package/dist/boxes/webm/parse-ebml.js +5 -2
- package/dist/boxes/webm/segments/all-segments.d.ts +36 -3
- package/dist/boxes/webm/segments/all-segments.js +34 -6
- package/dist/boxes/webm/traversal.d.ts +26 -1
- package/dist/boxes/webm/traversal.js +214 -1
- package/dist/buffer-iterator.js +6 -0
- package/dist/create/cluster-segment.d.ts +1 -1
- package/dist/create/cluster-segment.js +3 -5
- package/dist/create/cluster.d.ts +13 -0
- package/dist/create/cluster.js +54 -0
- package/dist/create/create-media.d.ts +4 -2
- package/dist/create/create-media.js +87 -47
- package/dist/create/cues.d.ts +0 -0
- package/dist/create/cues.js +1 -0
- package/dist/create/make-duration-with-padding.d.ts +1 -0
- package/dist/create/make-duration-with-padding.js +15 -0
- package/dist/create/matroska-cues.d.ts +6 -0
- package/dist/create/matroska-cues.js +50 -0
- package/dist/create/matroska-info.d.ts +1 -2
- package/dist/create/matroska-info.js +3 -11
- package/dist/create/matroska-seek.d.ts +6 -0
- package/dist/create/matroska-seek.js +32 -0
- package/dist/create/matroska-segment.d.ts +1 -0
- package/dist/create/matroska-segment.js +3 -2
- package/dist/create/matroska-trackentry.d.ts +9 -14
- package/dist/create/matroska-trackentry.js +79 -94
- package/dist/create/timescale.d.ts +1 -0
- package/dist/create/timescale.js +4 -0
- package/dist/emit-available-info.d.ts +12 -0
- package/dist/emit-available-info.js +133 -0
- package/dist/esm/buffer.mjs +57 -0
- package/dist/esm/from-fetch.mjs +72 -0
- package/dist/esm/from-node.mjs +48 -0
- package/dist/esm/from-web-file.mjs +48 -0
- package/dist/esm/index.mjs +6689 -0
- package/dist/esm/web-fs.mjs +67 -0
- package/dist/get-audio-codec.d.ts +5 -5
- package/dist/get-audio-codec.js +41 -57
- package/dist/get-container.d.ts +4 -0
- package/dist/get-container.js +26 -0
- package/dist/get-duration.js +1 -1
- package/dist/get-fps.js +1 -1
- package/dist/get-sample-aspect-ratio.d.ts +1 -1
- package/dist/get-sample-aspect-ratio.js +19 -19
- package/dist/get-tracks.d.ts +13 -0
- package/dist/get-tracks.js +8 -8
- package/dist/get-video-codec.d.ts +5 -2
- package/dist/get-video-codec.js +111 -21
- package/dist/has-all-info.d.ts +2 -2
- package/dist/has-all-info.js +23 -9
- package/dist/index.d.ts +3 -1
- package/dist/options.d.ts +97 -30
- package/dist/parse-media.js +43 -62
- package/dist/parse-video.d.ts +2 -1
- package/dist/parse-video.js +3 -1
- package/dist/parser-state.js +1 -2
- package/dist/readers/from-fetch.js +24 -4
- package/dist/readers/from-node.js +13 -3
- package/dist/readers/from-web-file.js +14 -2
- package/dist/readers/reader.d.ts +6 -1
- package/dist/samples-from-moof.js +1 -1
- package/dist/traversal.d.ts +0 -21
- package/dist/traversal.js +1 -158
- package/dist/truthy.d.ts +3 -0
- package/dist/truthy.js +7 -0
- package/dist/writers/buffer.d.ts +2 -0
- package/dist/writers/buffer.js +58 -0
- package/dist/writers/web-fs.d.ts +1 -0
- package/dist/writers/web-fs.js +42 -18
- package/dist/writers/writer.d.ts +4 -2
- package/fetch.js +2 -0
- package/node.js +2 -0
- package/package.json +43 -8
- package/web-file.js +2 -0
- package/web-fs.js +2 -0
- package/.eslintrc +0 -8
- package/input.webm +0 -0
- package/src/add-new-matroska-tracks.ts +0 -23
- package/src/boxes/iso-base-media/base-type.ts +0 -4
- package/src/boxes/iso-base-media/esds/decoder-specific-config.ts +0 -68
- package/src/boxes/iso-base-media/esds/esds-descriptors.ts +0 -135
- package/src/boxes/iso-base-media/esds/esds.ts +0 -49
- package/src/boxes/iso-base-media/ftyp.ts +0 -39
- package/src/boxes/iso-base-media/get-sample-positions-from-track.ts +0 -69
- package/src/boxes/iso-base-media/make-track.ts +0 -116
- package/src/boxes/iso-base-media/mdat/mdat.ts +0 -140
- package/src/boxes/iso-base-media/mdhd.ts +0 -59
- package/src/boxes/iso-base-media/moov/moov.ts +0 -43
- package/src/boxes/iso-base-media/mvhd.ts +0 -114
- package/src/boxes/iso-base-media/process-box.ts +0 -748
- package/src/boxes/iso-base-media/stsd/av1c.ts +0 -19
- package/src/boxes/iso-base-media/stsd/avcc.ts +0 -36
- package/src/boxes/iso-base-media/stsd/colr.ts +0 -49
- package/src/boxes/iso-base-media/stsd/ctts.ts +0 -64
- package/src/boxes/iso-base-media/stsd/hvcc.ts +0 -32
- package/src/boxes/iso-base-media/stsd/keys.ts +0 -27
- package/src/boxes/iso-base-media/stsd/mebx.ts +0 -54
- package/src/boxes/iso-base-media/stsd/pasp.ts +0 -32
- package/src/boxes/iso-base-media/stsd/samples.ts +0 -359
- package/src/boxes/iso-base-media/stsd/stco.ts +0 -52
- package/src/boxes/iso-base-media/stsd/stsc.ts +0 -61
- package/src/boxes/iso-base-media/stsd/stsd.ts +0 -55
- package/src/boxes/iso-base-media/stsd/stss.ts +0 -47
- package/src/boxes/iso-base-media/stsd/stsz.ts +0 -75
- package/src/boxes/iso-base-media/stsd/stts.ts +0 -62
- package/src/boxes/iso-base-media/tfdt.ts +0 -37
- package/src/boxes/iso-base-media/tfhd.ts +0 -66
- package/src/boxes/iso-base-media/tkhd.ts +0 -150
- package/src/boxes/iso-base-media/to-date.ts +0 -9
- package/src/boxes/iso-base-media/trak/trak.ts +0 -43
- package/src/boxes/iso-base-media/trun.ts +0 -74
- package/src/boxes/iso-base-media/void-box.ts +0 -4
- package/src/boxes/webm/allowed-partial-segments.ts +0 -1
- package/src/boxes/webm/av1-codec-private.ts +0 -113
- package/src/boxes/webm/description.ts +0 -104
- package/src/boxes/webm/ebml.ts +0 -98
- package/src/boxes/webm/get-ready-tracks.ts +0 -36
- package/src/boxes/webm/get-sample-from-block.ts +0 -125
- package/src/boxes/webm/get-track.ts +0 -257
- package/src/boxes/webm/make-header.ts +0 -253
- package/src/boxes/webm/parse-ebml.ts +0 -255
- package/src/boxes/webm/parse-webm-header.ts +0 -18
- package/src/boxes/webm/segments/all-segments.ts +0 -888
- package/src/boxes/webm/segments/block-simple-block-flags.ts +0 -52
- package/src/boxes/webm/segments/parse-children.ts +0 -144
- package/src/boxes/webm/segments/track-entry.ts +0 -38
- package/src/boxes/webm/segments.ts +0 -147
- package/src/boxes/webm/traversal.ts +0 -45
- package/src/buffer-iterator.ts +0 -548
- package/src/create/cluster-segment.ts +0 -62
- package/src/create/create-media.ts +0 -172
- package/src/create/matroska-header.ts +0 -63
- package/src/create/matroska-info.ts +0 -46
- package/src/create/matroska-segment.ts +0 -10
- package/src/create/matroska-trackentry.ts +0 -325
- package/src/get-audio-codec.ts +0 -270
- package/src/get-dimensions.ts +0 -47
- package/src/get-duration.ts +0 -103
- package/src/get-fps.ts +0 -113
- package/src/get-sample-aspect-ratio.ts +0 -204
- package/src/get-sample-positions.ts +0 -93
- package/src/get-tracks.ts +0 -147
- package/src/get-video-codec.ts +0 -117
- package/src/has-all-info.ts +0 -81
- package/src/index.ts +0 -18
- package/src/make-hvc1-codec-strings.ts +0 -55
- package/src/options.ts +0 -118
- package/src/parse-media.ts +0 -183
- package/src/parse-result.ts +0 -79
- package/src/parse-video.ts +0 -83
- package/src/parser-context.ts +0 -10
- package/src/parser-state.ts +0 -178
- package/src/readers/from-fetch.ts +0 -90
- package/src/readers/from-node.ts +0 -51
- package/src/readers/from-web-file.ts +0 -49
- package/src/readers/reader.ts +0 -15
- package/src/samples-from-moof.ts +0 -102
- package/src/test/aspect-ratio.test.ts +0 -42
- package/src/test/av1.test.ts +0 -108
- package/src/test/create-matroska.test.ts +0 -287
- package/src/test/duration.test.ts +0 -18
- package/src/test/keys.test.ts +0 -47
- package/src/test/matroska.test.ts +0 -463
- package/src/test/mvhd.test.ts +0 -94
- package/src/test/parse-esds.test.ts +0 -98
- package/src/test/parse-stco.test.ts +0 -61
- package/src/test/parse-stsc.test.ts +0 -104
- package/src/test/parse-stsz.test.ts +0 -57
- package/src/test/parse-stts.test.ts +0 -38
- package/src/test/parse-video.test.ts +0 -101
- package/src/test/parse-webm.test.ts +0 -17
- package/src/test/samples-from-moof.test.ts +0 -2496
- package/src/test/stream-local.test.ts +0 -743
- package/src/test/stream-remote.test.ts +0 -59
- package/src/test/stream-samples.test.ts +0 -181
- package/src/test/stsd.test.ts +0 -265
- package/src/test/tkhd.test.ts +0 -87
- package/src/traversal.ts +0 -528
- package/src/webcodec-sample-types.ts +0 -29
- package/src/writers/web-fs.ts +0 -50
- package/src/writers/writer.ts +0 -12
- package/tsconfig.json +0 -14
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import {registerTrack} from '../../add-new-matroska-tracks';
|
|
2
|
-
import {type BufferIterator} from '../../buffer-iterator';
|
|
3
|
-
import type {ParserContext} from '../../parser-context';
|
|
4
|
-
import type {VideoSample} from '../../webcodec-sample-types';
|
|
5
|
-
import {getSampleFromBlock} from './get-sample-from-block';
|
|
6
|
-
import {getTrack} from './get-track';
|
|
7
|
-
import type {PossibleEbml} from './segments/all-segments';
|
|
8
|
-
import {ebmlMap} from './segments/all-segments';
|
|
9
|
-
|
|
10
|
-
export type Prettify<T> = {
|
|
11
|
-
[K in keyof T]: T[K];
|
|
12
|
-
} & {};
|
|
13
|
-
|
|
14
|
-
export const parseEbml = async (
|
|
15
|
-
iterator: BufferIterator,
|
|
16
|
-
parserContext: ParserContext,
|
|
17
|
-
): Promise<Prettify<PossibleEbml>> => {
|
|
18
|
-
const hex = iterator.getMatroskaSegmentId();
|
|
19
|
-
if (hex === null) {
|
|
20
|
-
throw new Error(
|
|
21
|
-
'Not enough bytes left to parse EBML - this should not happen',
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const hasInMap = ebmlMap[hex as keyof typeof ebmlMap];
|
|
26
|
-
if (!hasInMap) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
`Don't know how to parse EBML hex ID ${JSON.stringify(hex)}`,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const off = iterator.counter.getOffset();
|
|
33
|
-
const size = iterator.getVint();
|
|
34
|
-
const minVintWidth = iterator.counter.getOffset() - off;
|
|
35
|
-
|
|
36
|
-
if (size === null) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
'Not enough bytes left to parse EBML - this should not happen',
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (hasInMap.type === 'uint') {
|
|
43
|
-
const beforeUintOffset = iterator.counter.getOffset();
|
|
44
|
-
const value = size === 0 ? 0 : iterator.getUint(size);
|
|
45
|
-
|
|
46
|
-
const {name} = hasInMap;
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
// To work around TS limit
|
|
50
|
-
type: name as 'SeekPosition',
|
|
51
|
-
value: {
|
|
52
|
-
value,
|
|
53
|
-
byteLength: iterator.counter.getOffset() - beforeUintOffset,
|
|
54
|
-
},
|
|
55
|
-
minVintWidth,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (hasInMap.type === 'string') {
|
|
60
|
-
const value = iterator.getByteString(size);
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
type: hasInMap.name,
|
|
64
|
-
value,
|
|
65
|
-
minVintWidth,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (hasInMap.type === 'float') {
|
|
70
|
-
const value =
|
|
71
|
-
size === 0
|
|
72
|
-
? 0.0
|
|
73
|
-
: size === 4
|
|
74
|
-
? iterator.getFloat32()
|
|
75
|
-
: iterator.getFloat64();
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
type: hasInMap.name,
|
|
79
|
-
value: {
|
|
80
|
-
value,
|
|
81
|
-
size: size === 4 ? '32' : '64',
|
|
82
|
-
},
|
|
83
|
-
minVintWidth,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (hasInMap.type === 'hex-string') {
|
|
88
|
-
return {
|
|
89
|
-
type: hasInMap.name,
|
|
90
|
-
value:
|
|
91
|
-
'0x' +
|
|
92
|
-
[...iterator.getSlice(size)]
|
|
93
|
-
.map((b) => b.toString(16).padStart(2, '0'))
|
|
94
|
-
.join(''),
|
|
95
|
-
minVintWidth,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (hasInMap.type === 'uint8array') {
|
|
100
|
-
return {
|
|
101
|
-
type: hasInMap.name,
|
|
102
|
-
value: iterator.getSlice(size),
|
|
103
|
-
minVintWidth,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (hasInMap.type === 'children') {
|
|
108
|
-
const children: PossibleEbml[] = [];
|
|
109
|
-
const startOffset = iterator.counter.getOffset();
|
|
110
|
-
|
|
111
|
-
// eslint-disable-next-line no-constant-condition
|
|
112
|
-
while (true) {
|
|
113
|
-
const offset = iterator.counter.getOffset();
|
|
114
|
-
const value = await parseEbml(iterator, parserContext);
|
|
115
|
-
const remapped = await postprocessEbml({
|
|
116
|
-
offset,
|
|
117
|
-
ebml: value,
|
|
118
|
-
parserContext,
|
|
119
|
-
});
|
|
120
|
-
children.push(remapped);
|
|
121
|
-
|
|
122
|
-
const offsetNow = iterator.counter.getOffset();
|
|
123
|
-
|
|
124
|
-
if (offsetNow - startOffset > size) {
|
|
125
|
-
throw new Error(
|
|
126
|
-
`Offset ${offsetNow - startOffset} is larger than the length of the hex ${size}`,
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (offsetNow - startOffset === size) {
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return {type: hasInMap.name, value: children, minVintWidth};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// @ts-expect-error
|
|
139
|
-
throw new Error(`Unknown segment type ${hasInMap.type}`);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const postprocessEbml = async ({
|
|
143
|
-
offset,
|
|
144
|
-
ebml,
|
|
145
|
-
parserContext,
|
|
146
|
-
}: {
|
|
147
|
-
offset: number;
|
|
148
|
-
ebml: Prettify<PossibleEbml>;
|
|
149
|
-
parserContext: ParserContext;
|
|
150
|
-
}): Promise<Prettify<PossibleEbml>> => {
|
|
151
|
-
if (ebml.type === 'TimestampScale') {
|
|
152
|
-
parserContext.parserState.setTimescale(ebml.value.value);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (ebml.type === 'TrackEntry') {
|
|
156
|
-
parserContext.parserState.onTrackEntrySegment(ebml);
|
|
157
|
-
|
|
158
|
-
const track = getTrack({
|
|
159
|
-
track: ebml,
|
|
160
|
-
timescale: parserContext.parserState.getTimescale(),
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
if (track) {
|
|
164
|
-
await registerTrack({
|
|
165
|
-
state: parserContext.parserState,
|
|
166
|
-
options: parserContext,
|
|
167
|
-
track,
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (ebml.type === 'Timestamp') {
|
|
173
|
-
parserContext.parserState.setTimestampOffset(offset, ebml.value.value);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (ebml.type === 'Block' || ebml.type === 'SimpleBlock') {
|
|
177
|
-
const sample = getSampleFromBlock(ebml, parserContext, offset);
|
|
178
|
-
|
|
179
|
-
if (sample.type === 'video-sample' && parserContext.nullifySamples) {
|
|
180
|
-
await parserContext.parserState.onVideoSample(
|
|
181
|
-
sample.videoSample.trackId,
|
|
182
|
-
sample.videoSample,
|
|
183
|
-
);
|
|
184
|
-
return {
|
|
185
|
-
type: 'Block',
|
|
186
|
-
value: new Uint8Array([]),
|
|
187
|
-
minVintWidth: ebml.minVintWidth,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (sample.type === 'audio-sample' && parserContext.nullifySamples) {
|
|
192
|
-
await parserContext.parserState.onAudioSample(
|
|
193
|
-
sample.audioSample.trackId,
|
|
194
|
-
sample.audioSample,
|
|
195
|
-
);
|
|
196
|
-
return {
|
|
197
|
-
type: 'Block',
|
|
198
|
-
value: new Uint8Array([]),
|
|
199
|
-
minVintWidth: ebml.minVintWidth,
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if (sample.type === 'no-sample' && parserContext.nullifySamples) {
|
|
204
|
-
return {
|
|
205
|
-
type: 'Block',
|
|
206
|
-
value: new Uint8Array([]),
|
|
207
|
-
minVintWidth: ebml.minVintWidth,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (ebml.type === 'BlockGroup') {
|
|
213
|
-
// Blocks don't have information about keyframes.
|
|
214
|
-
// https://ffmpeg.org/pipermail/ffmpeg-devel/2015-June/173825.html
|
|
215
|
-
// "For Blocks, keyframes is
|
|
216
|
-
// inferred by the absence of ReferenceBlock element (as done by matroskadec).""
|
|
217
|
-
|
|
218
|
-
const block = ebml.value.find(
|
|
219
|
-
(c) => c.type === 'SimpleBlock' || c.type === 'Block',
|
|
220
|
-
);
|
|
221
|
-
if (!block || (block.type !== 'SimpleBlock' && block.type !== 'Block')) {
|
|
222
|
-
throw new Error('Expected block segment');
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const hasReferenceBlock = ebml.value.find(
|
|
226
|
-
(c) => c.type === 'ReferenceBlock',
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
const sample =
|
|
230
|
-
block.value.length === 0
|
|
231
|
-
? null
|
|
232
|
-
: getSampleFromBlock(block, parserContext, offset);
|
|
233
|
-
|
|
234
|
-
if (sample && sample.type === 'partial-video-sample') {
|
|
235
|
-
const completeFrame: VideoSample = {
|
|
236
|
-
...sample.partialVideoSample,
|
|
237
|
-
type: hasReferenceBlock ? 'delta' : 'key',
|
|
238
|
-
};
|
|
239
|
-
await parserContext.parserState.onVideoSample(
|
|
240
|
-
sample.partialVideoSample.trackId,
|
|
241
|
-
completeFrame,
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (parserContext.nullifySamples) {
|
|
246
|
-
return {
|
|
247
|
-
type: 'BlockGroup',
|
|
248
|
-
value: [],
|
|
249
|
-
minVintWidth: ebml.minVintWidth,
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return ebml;
|
|
255
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type {BufferIterator} from '../../buffer-iterator';
|
|
2
|
-
import type {ParseResult} from '../../parse-result';
|
|
3
|
-
import type {ParserContext} from '../../parser-context';
|
|
4
|
-
import {expectChildren} from './segments/parse-children';
|
|
5
|
-
|
|
6
|
-
// Parsing according to https://darkcoding.net/software/reading-mediarecorders-webm-opus-output/
|
|
7
|
-
export const parseWebm = (
|
|
8
|
-
counter: BufferIterator,
|
|
9
|
-
parserContext: ParserContext,
|
|
10
|
-
): Promise<ParseResult> => {
|
|
11
|
-
return expectChildren({
|
|
12
|
-
iterator: counter,
|
|
13
|
-
length: Infinity,
|
|
14
|
-
initialChildren: [],
|
|
15
|
-
wrap: null,
|
|
16
|
-
parserContext,
|
|
17
|
-
});
|
|
18
|
-
};
|