@remotion/media-parser 4.0.298 → 4.0.300
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/dist/add-avc-profile-to-track.d.ts +2 -2
- package/dist/add-avc-profile-to-track.js +7 -1
- package/dist/codec-data.d.ts +29 -0
- package/dist/codec-data.js +2 -0
- package/dist/containers/aac/parse-aac.js +2 -3
- package/dist/containers/avc/color.d.ts +6 -6
- package/dist/containers/avc/color.js +53 -27
- package/dist/containers/avc/create-avc-decoder-configuration-record.d.ts +2 -0
- package/dist/containers/avc/create-avc-decoder-configuration-record.js +35 -0
- package/dist/containers/avc/interpret-sps.d.ts +2 -2
- package/dist/containers/avc/interpret-sps.js +2 -2
- package/dist/containers/flac/parse-streaminfo.js +2 -3
- package/dist/containers/iso-base-media/collect-sample-positions-from-moof-boxes.d.ts +1 -1
- package/dist/containers/iso-base-media/color-to-webcodecs-colors.d.ts +2 -0
- package/dist/containers/iso-base-media/color-to-webcodecs-colors.js +12 -0
- package/dist/containers/iso-base-media/find-keyframe-before-time.d.ts +2 -2
- package/dist/containers/iso-base-media/find-track-to-seek.d.ts +5 -5
- package/dist/containers/iso-base-media/find-track-to-seek.js +18 -2
- package/dist/containers/iso-base-media/get-actual-number-of-channels.d.ts +3 -2
- package/dist/containers/iso-base-media/get-actual-number-of-channels.js +14 -3
- package/dist/containers/iso-base-media/get-children.d.ts +2 -2
- package/dist/containers/iso-base-media/get-keyframes.js +11 -2
- package/dist/containers/iso-base-media/get-mfra-seeking-box.d.ts +4 -4
- package/dist/containers/iso-base-media/get-moov-atom.js +1 -1
- package/dist/containers/iso-base-media/get-seeking-byte-from-fragmented-mp4.d.ts +9 -5
- package/dist/containers/iso-base-media/get-seeking-byte-from-fragmented-mp4.js +17 -4
- package/dist/containers/iso-base-media/get-seeking-byte.d.ts +2 -2
- package/dist/containers/iso-base-media/get-seeking-byte.js +5 -8
- package/dist/containers/iso-base-media/make-track.d.ts +2 -2
- package/dist/containers/iso-base-media/make-track.js +18 -17
- package/dist/containers/iso-base-media/mfra/find-best-segment-from-tfra.d.ts +2 -2
- package/dist/containers/iso-base-media/mfra/get-mfra-atom.d.ts +4 -4
- package/dist/containers/iso-base-media/mfra/get-mfro-atom.d.ts +4 -4
- package/dist/containers/iso-base-media/moov/moov.d.ts +2 -2
- package/dist/containers/iso-base-media/process-box.d.ts +5 -5
- package/dist/containers/iso-base-media/stsd/mebx.d.ts +2 -2
- package/dist/containers/iso-base-media/stsd/samples.d.ts +3 -3
- package/dist/containers/iso-base-media/stsd/stsd.d.ts +2 -2
- package/dist/containers/iso-base-media/trak/trak.d.ts +2 -2
- package/dist/containers/iso-base-media/traversal.d.ts +1 -0
- package/dist/containers/iso-base-media/traversal.js +13 -1
- package/dist/containers/m3u/after-manifest-fetch.d.ts +6 -6
- package/dist/containers/m3u/after-manifest-fetch.js +1 -1
- package/dist/containers/m3u/fetch-m3u8-stream.d.ts +2 -2
- package/dist/containers/m3u/first-sample-in-m3u-chunk.d.ts +3 -3
- package/dist/containers/m3u/first-sample-in-m3u-chunk.js +2 -8
- package/dist/containers/m3u/get-seeking-byte.d.ts +3 -3
- package/dist/containers/m3u/get-streams.d.ts +6 -6
- package/dist/containers/m3u/get-streams.js +9 -9
- package/dist/containers/m3u/parse-stream-inf.js +3 -3
- package/dist/containers/m3u/process-m3u-chunk.js +3 -3
- package/dist/containers/m3u/run-over-m3u.d.ts +2 -2
- package/dist/containers/m3u/sample-sorter.d.ts +7 -7
- package/dist/containers/m3u/types.d.ts +3 -3
- package/dist/containers/mp3/parse-mpeg-header.js +2 -3
- package/dist/containers/mp3/seek/audio-sample-from-cbr.d.ts +2 -2
- package/dist/containers/riff/get-tracks-from-avi.d.ts +4 -9
- package/dist/containers/riff/get-tracks-from-avi.js +19 -20
- package/dist/containers/riff/parse-video-section.js +1 -1
- package/dist/containers/riff/seek/fetch-idx1.d.ts +4 -4
- package/dist/containers/transport-stream/get-tracks.d.ts +2 -2
- package/dist/containers/transport-stream/get-tracks.js +1 -5
- package/dist/containers/transport-stream/handle-aac-packet.d.ts +4 -4
- package/dist/containers/transport-stream/handle-aac-packet.js +5 -4
- package/dist/containers/transport-stream/handle-avc-packet.d.ts +4 -4
- package/dist/containers/transport-stream/handle-avc-packet.js +10 -4
- package/dist/containers/transport-stream/process-audio.d.ts +5 -5
- package/dist/containers/transport-stream/process-stream-buffers.d.ts +8 -8
- package/dist/containers/transport-stream/process-video.d.ts +5 -5
- package/dist/containers/wav/parse-fmt.js +2 -3
- package/dist/containers/webm/color.d.ts +2 -2
- package/dist/containers/webm/color.js +6 -25
- package/dist/containers/webm/get-ready-tracks.d.ts +3 -3
- package/dist/containers/webm/get-sample-from-block.d.ts +7 -7
- package/dist/containers/webm/make-track.d.ts +3 -3
- package/dist/containers/webm/make-track.js +53 -21
- package/dist/containers/webm/parse-webm-header.js +5 -0
- package/dist/containers/webm/seek/fetch-web-cues.d.ts +4 -4
- package/dist/containers/webm/seek/get-seeking-byte.d.ts +2 -2
- package/dist/containers/webm/segments.d.ts +2 -2
- package/dist/containers/webm/segments.js +1 -1
- package/dist/containers/webm/state-for-processing.d.ts +5 -5
- package/dist/containers/webm/traversal.js +2 -1
- package/dist/controller/emitter.d.ts +2 -3
- package/dist/controller/seek-signal.d.ts +3 -9
- package/dist/controller/seek-signal.js +2 -2
- package/dist/convert-audio-or-video-sample.d.ts +4 -4
- package/dist/download-and-parse-media.js +1 -1
- package/dist/emit-available-info.js +9 -9
- package/dist/errors.d.ts +4 -18
- package/dist/errors.js +1 -15
- package/dist/esm/index.mjs +654 -544
- package/dist/esm/node.mjs +63 -51
- package/dist/esm/server-worker.mjs +13 -34
- package/dist/esm/universal.mjs +63 -51
- package/dist/esm/worker-server-entry.mjs +500 -388
- package/dist/esm/worker-web-entry.mjs +437 -337
- package/dist/esm/worker.mjs +14 -35
- package/dist/fields.d.ts +2 -2
- package/dist/file-types/bmp.d.ts +2 -2
- package/dist/file-types/detect-file-type.d.ts +2 -1
- package/dist/file-types/detect-file-type.js +1 -6
- package/dist/file-types/gif.d.ts +2 -0
- package/dist/file-types/gif.js +18 -0
- package/dist/file-types/index.js +4 -2
- package/dist/file-types/png.d.ts +2 -2
- package/dist/file-types/webp.d.ts +2 -2
- package/dist/get-audio-codec.d.ts +3 -4
- package/dist/get-audio-codec.js +44 -23
- package/dist/get-dimensions.d.ts +2 -2
- package/dist/get-dimensions.js +6 -3
- package/dist/get-duration.js +6 -7
- package/dist/get-fields-from-callbacks.js +1 -1
- package/dist/get-is-hdr.js +6 -5
- package/dist/get-sample-aspect-ratio.d.ts +5 -5
- package/dist/get-seeking-byte.d.ts +2 -2
- package/dist/get-tracks.d.ts +34 -44
- package/dist/get-tracks.js +6 -46
- package/dist/get-video-codec.d.ts +4 -3
- package/dist/get-video-codec.js +6 -6
- package/dist/has-all-info.js +1 -1
- package/dist/index.d.ts +114 -55
- package/dist/index.js +6 -4
- package/dist/init-video.js +4 -11
- package/dist/internal-parse-media.js +1 -1
- package/dist/log.d.ts +6 -6
- package/dist/metadata/get-metadata.js +6 -4
- package/dist/options.d.ts +19 -23
- package/dist/parse-loop.js +2 -2
- package/dist/parse-media-on-worker-entry.js +13 -5
- package/dist/parse-media.js +1 -1
- package/dist/perform-seek.d.ts +4 -4
- package/dist/readers/from-fetch.d.ts +2 -2
- package/dist/readers/from-node.d.ts +2 -2
- package/dist/readers/from-node.js +64 -55
- package/dist/readers/from-web-file.d.ts +2 -2
- package/dist/readers/reader.d.ts +5 -5
- package/dist/readers/universal.d.ts +2 -2
- package/dist/readers/web.d.ts +2 -2
- package/dist/register-track.d.ts +12 -12
- package/dist/remotion-license-acknowledge.d.ts +2 -2
- package/dist/seek-backwards.d.ts +4 -4
- package/dist/seek-forwards.d.ts +4 -4
- package/dist/server-worker.module.d.ts +2 -0
- package/dist/server-worker.module.js +12 -0
- package/dist/state/can-skip-tracks.js +1 -1
- package/dist/state/emitted-fields.js +1 -1
- package/dist/state/has-tracks-section.d.ts +5 -5
- package/dist/state/iso-base-media/cached-sample-positions.d.ts +3 -3
- package/dist/state/iso-base-media/cached-sample-positions.js +16 -7
- package/dist/state/iso-base-media/iso-state.d.ts +4 -4
- package/dist/state/iso-base-media/lazy-mfra-load.d.ts +4 -4
- package/dist/state/m3u-state.d.ts +11 -11
- package/dist/state/matroska/lazy-cues-fetch.d.ts +4 -4
- package/dist/state/matroska/webm.d.ts +4 -4
- package/dist/state/matroska/webm.js +1 -1
- package/dist/state/may-skip-video-data.d.ts +1 -0
- package/dist/state/may-skip-video-data.js +23 -2
- package/dist/state/need-samples-for-fields.js +1 -1
- package/dist/state/parser-state.d.ts +67 -38
- package/dist/state/riff/lazy-idx1-fetch.d.ts +4 -4
- package/dist/state/riff/sample-counter.d.ts +3 -3
- package/dist/state/riff.d.ts +6 -6
- package/dist/state/sample-callbacks.d.ts +12 -12
- package/dist/state/sample-callbacks.js +2 -2
- package/dist/state/samples-observed/slow-duration-fps.d.ts +3 -3
- package/dist/state/transport-stream/last-emitted-sample.d.ts +3 -3
- package/dist/state/transport-stream/transport-stream.d.ts +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webcodec-sample-types.d.ts +21 -10
- package/dist/work-on-seek-request.d.ts +4 -4
- package/dist/work-on-seek-request.js +40 -43
- package/dist/worker/serialize-error.d.ts +2 -2
- package/dist/worker/serialize-error.js +7 -25
- package/dist/worker/worker-types.d.ts +22 -24
- package/dist/worker-server.d.ts +2 -2
- package/dist/worker-server.js +5 -5
- package/dist/writers/writer.d.ts +2 -2
- package/package.json +3 -3
|
@@ -21,14 +21,13 @@ const makeAviAudioTrack = ({ strf, index, }) => {
|
|
|
21
21
|
return {
|
|
22
22
|
type: 'audio',
|
|
23
23
|
codec: 'mp4a.40.2', // According to Claude 3.5 Sonnet
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
codecData: { type: 'aac-config', data: new Uint8Array([18, 16]) },
|
|
25
|
+
codecEnum: 'aac',
|
|
26
26
|
description: new Uint8Array([18, 16]),
|
|
27
27
|
numberOfChannels: strf.numberOfChannels,
|
|
28
28
|
sampleRate: strf.sampleRate,
|
|
29
29
|
timescale: timescale_1.MEDIA_PARSER_RIFF_TIMESCALE,
|
|
30
30
|
trackId: index,
|
|
31
|
-
trakBox: null,
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
exports.makeAviAudioTrack = makeAviAudioTrack;
|
|
@@ -37,9 +36,9 @@ const makeAviVideoTrack = ({ strh, strf, index, }) => {
|
|
|
37
36
|
throw new Error(`Unsupported video codec ${strh.handler}`);
|
|
38
37
|
}
|
|
39
38
|
return {
|
|
40
|
-
|
|
39
|
+
codecData: null,
|
|
41
40
|
codec: exports.TO_BE_OVERRIDDEN_LATER,
|
|
42
|
-
|
|
41
|
+
codecEnum: 'h264',
|
|
43
42
|
codedHeight: strf.height,
|
|
44
43
|
codedWidth: strf.width,
|
|
45
44
|
width: strf.width,
|
|
@@ -50,14 +49,19 @@ const makeAviVideoTrack = ({ strh, strf, index, }) => {
|
|
|
50
49
|
description: undefined,
|
|
51
50
|
m3uStreamFormat: null,
|
|
52
51
|
trackId: index,
|
|
53
|
-
|
|
52
|
+
colorSpace: {
|
|
54
53
|
fullRange: null,
|
|
55
|
-
|
|
54
|
+
matrix: null,
|
|
56
55
|
primaries: null,
|
|
57
|
-
|
|
56
|
+
transfer: null,
|
|
57
|
+
},
|
|
58
|
+
advancedColor: {
|
|
59
|
+
fullRange: null,
|
|
60
|
+
matrix: null,
|
|
61
|
+
primaries: null,
|
|
62
|
+
transfer: null,
|
|
58
63
|
},
|
|
59
64
|
displayAspectWidth: strf.width,
|
|
60
|
-
trakBox: null,
|
|
61
65
|
rotation: 0,
|
|
62
66
|
sampleAspectRatio: {
|
|
63
67
|
numerator: 1,
|
|
@@ -68,9 +72,7 @@ const makeAviVideoTrack = ({ strh, strf, index, }) => {
|
|
|
68
72
|
};
|
|
69
73
|
exports.makeAviVideoTrack = makeAviVideoTrack;
|
|
70
74
|
const getTracksFromAvi = (structure, state) => {
|
|
71
|
-
const
|
|
72
|
-
const audioTracks = [];
|
|
73
|
-
const otherTracks = [];
|
|
75
|
+
const tracks = [];
|
|
74
76
|
const boxes = (0, traversal_1.getStrlBoxes)(structure);
|
|
75
77
|
let i = 0;
|
|
76
78
|
for (const box of boxes) {
|
|
@@ -80,17 +82,17 @@ const getTracksFromAvi = (structure, state) => {
|
|
|
80
82
|
}
|
|
81
83
|
const { strf } = strh;
|
|
82
84
|
if (strf.type === 'strf-box-video') {
|
|
83
|
-
|
|
85
|
+
tracks.push((0, add_avc_profile_to_track_1.addAvcProfileToTrack)((0, exports.makeAviVideoTrack)({ strh, strf, index: i }), state.riff.getAvcProfile()));
|
|
84
86
|
}
|
|
85
87
|
else if (strh.fccType === 'auds') {
|
|
86
|
-
|
|
88
|
+
tracks.push((0, exports.makeAviAudioTrack)({ strf, index: i }));
|
|
87
89
|
}
|
|
88
90
|
else {
|
|
89
91
|
throw new Error(`Unsupported track type ${strh.fccType}`);
|
|
90
92
|
}
|
|
91
93
|
i++;
|
|
92
94
|
}
|
|
93
|
-
return
|
|
95
|
+
return tracks;
|
|
94
96
|
};
|
|
95
97
|
exports.getTracksFromAvi = getTracksFromAvi;
|
|
96
98
|
const hasAllTracksFromAvi = (state) => {
|
|
@@ -98,11 +100,8 @@ const hasAllTracksFromAvi = (state) => {
|
|
|
98
100
|
const structure = state.structure.getRiffStructure();
|
|
99
101
|
const numberOfTracks = (0, exports.getNumberOfTracks)(structure);
|
|
100
102
|
const tracks = (0, exports.getTracksFromAvi)(structure, state);
|
|
101
|
-
return (tracks.
|
|
102
|
-
tracks.
|
|
103
|
-
tracks.otherTracks.length ===
|
|
104
|
-
numberOfTracks &&
|
|
105
|
-
!tracks.videoTracks.find((t) => t.codec === exports.TO_BE_OVERRIDDEN_LATER));
|
|
103
|
+
return (tracks.length === numberOfTracks &&
|
|
104
|
+
!tracks.find((t) => t.type === 'video' && t.codec === exports.TO_BE_OVERRIDDEN_LATER));
|
|
106
105
|
}
|
|
107
106
|
catch (_a) {
|
|
108
107
|
return false;
|
|
@@ -9,7 +9,7 @@ const parseMediaSection = async (state) => {
|
|
|
9
9
|
state,
|
|
10
10
|
});
|
|
11
11
|
const tracks = (0, get_tracks_1.getTracks)(state, false);
|
|
12
|
-
if (!tracks.
|
|
12
|
+
if (!tracks.some((t) => t.type === 'video' && t.codec === get_tracks_from_avi_1.TO_BE_OVERRIDDEN_LATER) &&
|
|
13
13
|
!state.callbacks.tracks.getIsDone()) {
|
|
14
14
|
state.callbacks.tracks.setIsDone(state.logLevel);
|
|
15
15
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { MediaParserController } from '../../../controller/media-parser-controller';
|
|
2
2
|
import type { PrefetchCache } from '../../../fetch';
|
|
3
|
-
import { type
|
|
3
|
+
import { type MediaParserLogLevel } from '../../../log';
|
|
4
4
|
import type { ParseMediaSrc } from '../../../options';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MediaParserReaderInterface } from '../../../readers/reader';
|
|
6
6
|
export declare const fetchIdx1: ({ src, readerInterface, controller, position, logLevel, prefetchCache, }: {
|
|
7
7
|
src: ParseMediaSrc;
|
|
8
|
-
readerInterface:
|
|
8
|
+
readerInterface: MediaParserReaderInterface;
|
|
9
9
|
controller: MediaParserController;
|
|
10
10
|
position: number;
|
|
11
|
-
logLevel:
|
|
11
|
+
logLevel: MediaParserLogLevel;
|
|
12
12
|
prefetchCache: PrefetchCache;
|
|
13
13
|
}) => Promise<{
|
|
14
14
|
entries: import("../riff-box").Idx1Entry[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { MediaParserTrack } from '../../get-tracks';
|
|
1
2
|
import type { ParserState } from '../../state/parser-state';
|
|
2
|
-
import type { AllTracks } from '../riff/get-tracks-from-avi';
|
|
3
3
|
import type { TransportStreamEntry } from './parse-pmt';
|
|
4
4
|
export declare const filterStreamsBySupportedTypes: (streams: TransportStreamEntry[]) => TransportStreamEntry[];
|
|
5
|
-
export declare const getTracksFromTransportStream: (parserState: ParserState) =>
|
|
5
|
+
export declare const getTracksFromTransportStream: (parserState: ParserState) => MediaParserTrack[];
|
|
6
6
|
export declare const hasAllTracksFromTransportStream: (parserState: ParserState) => boolean;
|
|
@@ -20,11 +20,7 @@ const getTracksFromTransportStream = (parserState) => {
|
|
|
20
20
|
(0, exports.filterStreamsBySupportedTypes)(programMapTable.streams).length) {
|
|
21
21
|
throw new Error('Not all tracks found');
|
|
22
22
|
}
|
|
23
|
-
return
|
|
24
|
-
videoTracks: mapped.filter((track) => track.type === 'video'),
|
|
25
|
-
audioTracks: mapped.filter((track) => track.type === 'audio'),
|
|
26
|
-
otherTracks: [],
|
|
27
|
-
};
|
|
23
|
+
return mapped;
|
|
28
24
|
};
|
|
29
25
|
exports.getTracksFromTransportStream = getTracksFromTransportStream;
|
|
30
26
|
const hasAllTracksFromTransportStream = (parserState) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../../log';
|
|
2
2
|
import type { CallbacksState } from '../../state/sample-callbacks';
|
|
3
3
|
import type { TransportStreamState } from '../../state/transport-stream/transport-stream';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MediaParserOnAudioTrack } from '../../webcodec-sample-types';
|
|
5
5
|
import type { TransportStreamPacketBuffer } from './process-stream-buffers';
|
|
6
6
|
export declare const handleAacPacket: ({ streamBuffer, programId, offset, sampleCallbacks, logLevel, onAudioTrack, transportStream, makeSamplesStartAtZero, }: {
|
|
7
7
|
streamBuffer: TransportStreamPacketBuffer;
|
|
8
8
|
programId: number;
|
|
9
9
|
offset: number;
|
|
10
10
|
sampleCallbacks: CallbacksState;
|
|
11
|
-
logLevel:
|
|
12
|
-
onAudioTrack:
|
|
11
|
+
logLevel: MediaParserLogLevel;
|
|
12
|
+
onAudioTrack: MediaParserOnAudioTrack | null;
|
|
13
13
|
transportStream: TransportStreamState;
|
|
14
14
|
makeSamplesStartAtZero: boolean;
|
|
15
15
|
}) => Promise<void>;
|
|
@@ -26,14 +26,15 @@ const handleAacPacket = async ({ streamBuffer, programId, offset, sampleCallback
|
|
|
26
26
|
});
|
|
27
27
|
const track = {
|
|
28
28
|
type: 'audio',
|
|
29
|
-
codecPrivate,
|
|
29
|
+
codecData: { type: 'aac-config', data: codecPrivate },
|
|
30
30
|
trackId: programId,
|
|
31
|
-
trakBox: null,
|
|
32
31
|
timescale: handle_avc_packet_1.MPEG_TIMESCALE,
|
|
33
|
-
|
|
32
|
+
codecEnum: 'aac',
|
|
34
33
|
codec: (0, aac_codecprivate_1.mapAudioObjectTypeToCodecString)(audioObjectType),
|
|
35
34
|
// https://www.w3.org/TR/webcodecs-aac-codec-registration/
|
|
36
|
-
description
|
|
35
|
+
// WebCodecs spec says that description should be given for AAC format
|
|
36
|
+
// ChatGPT says that Transport Streams are always AAC, not ADTS
|
|
37
|
+
description: codecPrivate,
|
|
37
38
|
numberOfChannels: channelConfiguration,
|
|
38
39
|
sampleRate,
|
|
39
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../../log';
|
|
2
2
|
import type { CallbacksState } from '../../state/sample-callbacks';
|
|
3
3
|
import type { TransportStreamState } from '../../state/transport-stream/transport-stream';
|
|
4
|
-
import type {
|
|
4
|
+
import type { MediaParserOnVideoTrack } from '../../webcodec-sample-types';
|
|
5
5
|
import type { TransportStreamPacketBuffer } from './process-stream-buffers';
|
|
6
6
|
export declare const MPEG_TIMESCALE = 90000;
|
|
7
7
|
export declare const handleAvcPacket: ({ streamBuffer, programId, offset, sampleCallbacks, logLevel, onVideoTrack, transportStream, makeSamplesStartAtZero, }: {
|
|
@@ -9,8 +9,8 @@ export declare const handleAvcPacket: ({ streamBuffer, programId, offset, sample
|
|
|
9
9
|
programId: number;
|
|
10
10
|
offset: number;
|
|
11
11
|
sampleCallbacks: CallbacksState;
|
|
12
|
-
logLevel:
|
|
13
|
-
onVideoTrack:
|
|
12
|
+
logLevel: MediaParserLogLevel;
|
|
13
|
+
onVideoTrack: MediaParserOnVideoTrack | null;
|
|
14
14
|
transportStream: TransportStreamState;
|
|
15
15
|
makeSamplesStartAtZero: boolean;
|
|
16
16
|
}) => Promise<void>;
|
|
@@ -9,6 +9,7 @@ const interpret_sps_1 = require("../avc/interpret-sps");
|
|
|
9
9
|
const key_1 = require("../avc/key");
|
|
10
10
|
const parse_avc_1 = require("../avc/parse-avc");
|
|
11
11
|
const sps_and_pps_1 = require("../avc/sps-and-pps");
|
|
12
|
+
const color_to_webcodecs_colors_1 = require("../iso-base-media/color-to-webcodecs-colors");
|
|
12
13
|
exports.MPEG_TIMESCALE = 90000;
|
|
13
14
|
const handleAvcPacket = async ({ streamBuffer, programId, offset, sampleCallbacks, logLevel, onVideoTrack, transportStream, makeSamplesStartAtZero, }) => {
|
|
14
15
|
var _a, _b;
|
|
@@ -27,6 +28,8 @@ const handleAvcPacket = async ({ streamBuffer, programId, offset, sampleCallback
|
|
|
27
28
|
trackId: programId,
|
|
28
29
|
newOffset: startOffset,
|
|
29
30
|
});
|
|
31
|
+
const codecPrivate = (0, create_sps_pps_data_1.createSpsPpsData)(spsAndPps);
|
|
32
|
+
const advancedColor = (0, interpret_sps_1.getVideoColorFromSps)(spsAndPps.sps.spsData);
|
|
30
33
|
const track = {
|
|
31
34
|
m3uStreamFormat: null,
|
|
32
35
|
rotation: 0,
|
|
@@ -34,7 +37,7 @@ const handleAvcPacket = async ({ streamBuffer, programId, offset, sampleCallback
|
|
|
34
37
|
type: 'video',
|
|
35
38
|
timescale: exports.MPEG_TIMESCALE,
|
|
36
39
|
codec: (0, codec_string_1.getCodecStringFromSpsAndPps)(spsAndPps.sps),
|
|
37
|
-
|
|
40
|
+
codecData: { type: 'avc-sps-pps', data: codecPrivate },
|
|
38
41
|
fps: null,
|
|
39
42
|
codedWidth: dimensions.width,
|
|
40
43
|
codedHeight: dimensions.height,
|
|
@@ -42,14 +45,17 @@ const handleAvcPacket = async ({ streamBuffer, programId, offset, sampleCallback
|
|
|
42
45
|
width: dimensions.width,
|
|
43
46
|
displayAspectWidth: dimensions.width,
|
|
44
47
|
displayAspectHeight: dimensions.height,
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
codecEnum: 'h264',
|
|
49
|
+
// ChatGPT: In a transport stream (.ts), H.264 video is always stored in Annex B format
|
|
50
|
+
// WebCodecs spec says that description must be undefined for Annex B format
|
|
51
|
+
// https://www.w3.org/TR/webcodecs-avc-codec-registration/#videodecoderconfig-description
|
|
47
52
|
description: undefined,
|
|
48
53
|
sampleAspectRatio: {
|
|
49
54
|
denominator: sampleAspectRatio.height,
|
|
50
55
|
numerator: sampleAspectRatio.width,
|
|
51
56
|
},
|
|
52
|
-
|
|
57
|
+
colorSpace: (0, color_to_webcodecs_colors_1.mediaParserAdvancedColorToWebCodecsColor)(advancedColor),
|
|
58
|
+
advancedColor,
|
|
53
59
|
};
|
|
54
60
|
await (0, register_track_1.registerVideoTrack)({
|
|
55
61
|
track,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../../log';
|
|
2
2
|
import type { TransportStreamStructure } from '../../parse-result';
|
|
3
3
|
import type { CallbacksState } from '../../state/sample-callbacks';
|
|
4
4
|
import type { TransportStreamState } from '../../state/transport-stream/transport-stream';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MediaParserOnAudioTrack, MediaParserOnVideoTrack } from '../../webcodec-sample-types';
|
|
6
6
|
import type { TransportStreamEntry } from './parse-pmt';
|
|
7
7
|
import type { TransportStreamPacketBuffer } from './process-stream-buffers';
|
|
8
8
|
export declare const canProcessAudio: ({ streamBuffer, }: {
|
|
@@ -12,9 +12,9 @@ export declare const processAudio: ({ transportStreamEntry, structure, offset, s
|
|
|
12
12
|
transportStreamEntry: TransportStreamEntry;
|
|
13
13
|
structure: TransportStreamStructure;
|
|
14
14
|
sampleCallbacks: CallbacksState;
|
|
15
|
-
logLevel:
|
|
16
|
-
onAudioTrack:
|
|
17
|
-
onVideoTrack:
|
|
15
|
+
logLevel: MediaParserLogLevel;
|
|
16
|
+
onAudioTrack: MediaParserOnAudioTrack | null;
|
|
17
|
+
onVideoTrack: MediaParserOnVideoTrack | null;
|
|
18
18
|
transportStream: TransportStreamState;
|
|
19
19
|
offset: number;
|
|
20
20
|
makeSamplesStartAtZero: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../../log';
|
|
2
2
|
import type { TransportStreamStructure } from '../../parse-result';
|
|
3
3
|
import type { CallbacksState } from '../../state/sample-callbacks';
|
|
4
4
|
import type { TransportStreamState } from '../../state/transport-stream/transport-stream';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MediaParserOnAudioTrack, MediaParserOnVideoTrack } from '../../webcodec-sample-types';
|
|
6
6
|
import type { PacketPes } from './parse-pes';
|
|
7
7
|
export type TransportStreamPacketBuffer = {
|
|
8
8
|
pesHeader: PacketPes;
|
|
@@ -22,18 +22,18 @@ export declare const processStreamBuffer: ({ streamBuffer, programId, structure,
|
|
|
22
22
|
programId: number;
|
|
23
23
|
structure: TransportStreamStructure;
|
|
24
24
|
sampleCallbacks: CallbacksState;
|
|
25
|
-
logLevel:
|
|
26
|
-
onAudioTrack:
|
|
27
|
-
onVideoTrack:
|
|
25
|
+
logLevel: MediaParserLogLevel;
|
|
26
|
+
onAudioTrack: MediaParserOnAudioTrack | null;
|
|
27
|
+
onVideoTrack: MediaParserOnVideoTrack | null;
|
|
28
28
|
transportStream: TransportStreamState;
|
|
29
29
|
makeSamplesStartAtZero: boolean;
|
|
30
30
|
}) => Promise<void>;
|
|
31
31
|
export declare const processFinalStreamBuffers: ({ structure, sampleCallbacks, logLevel, onAudioTrack, onVideoTrack, transportStream, makeSamplesStartAtZero, }: {
|
|
32
32
|
structure: TransportStreamStructure;
|
|
33
33
|
sampleCallbacks: CallbacksState;
|
|
34
|
-
logLevel:
|
|
35
|
-
onAudioTrack:
|
|
36
|
-
onVideoTrack:
|
|
34
|
+
logLevel: MediaParserLogLevel;
|
|
35
|
+
onAudioTrack: MediaParserOnAudioTrack | null;
|
|
36
|
+
onVideoTrack: MediaParserOnVideoTrack | null;
|
|
37
37
|
transportStream: TransportStreamState;
|
|
38
38
|
makeSamplesStartAtZero: boolean;
|
|
39
39
|
}) => Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../../log';
|
|
2
2
|
import type { TransportStreamStructure } from '../../parse-result';
|
|
3
3
|
import type { CallbacksState } from '../../state/sample-callbacks';
|
|
4
4
|
import type { TransportStreamState } from '../../state/transport-stream/transport-stream';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MediaParserOnAudioTrack, MediaParserOnVideoTrack } from '../../webcodec-sample-types';
|
|
6
6
|
import type { TransportStreamPacketBuffer } from './process-stream-buffers';
|
|
7
7
|
export declare const canProcessVideo: ({ streamBuffer, }: {
|
|
8
8
|
streamBuffer: TransportStreamPacketBuffer;
|
|
@@ -12,9 +12,9 @@ export declare const processVideo: ({ programId, structure, streamBuffer, sample
|
|
|
12
12
|
structure: TransportStreamStructure;
|
|
13
13
|
streamBuffer: TransportStreamPacketBuffer;
|
|
14
14
|
sampleCallbacks: CallbacksState;
|
|
15
|
-
logLevel:
|
|
16
|
-
onAudioTrack:
|
|
17
|
-
onVideoTrack:
|
|
15
|
+
logLevel: MediaParserLogLevel;
|
|
16
|
+
onAudioTrack: MediaParserOnAudioTrack | null;
|
|
17
|
+
onVideoTrack: MediaParserOnVideoTrack | null;
|
|
18
18
|
transportStream: TransportStreamState;
|
|
19
19
|
makeSamplesStartAtZero: boolean;
|
|
20
20
|
}) => Promise<Uint8Array>;
|
|
@@ -38,14 +38,13 @@ const parseFmt = async ({ state, }) => {
|
|
|
38
38
|
track: {
|
|
39
39
|
type: 'audio',
|
|
40
40
|
codec: format,
|
|
41
|
-
|
|
41
|
+
codecData: null,
|
|
42
42
|
description: undefined,
|
|
43
|
-
|
|
43
|
+
codecEnum: format,
|
|
44
44
|
numberOfChannels,
|
|
45
45
|
sampleRate,
|
|
46
46
|
timescale: 1000000,
|
|
47
47
|
trackId: 0,
|
|
48
|
-
trakBox: null,
|
|
49
48
|
},
|
|
50
49
|
container: 'wav',
|
|
51
50
|
registerAudioSampleCallback: state.callbacks.registerAudioSampleCallback,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserAdvancedColor } from '../../get-tracks';
|
|
2
2
|
import type { ColourSegment } from './segments/all-segments';
|
|
3
|
-
export declare const parseColorSegment: (colourSegment: ColourSegment) =>
|
|
3
|
+
export declare const parseColorSegment: (colourSegment: ColourSegment) => MediaParserAdvancedColor;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseColorSegment = void 0;
|
|
4
|
+
const color_1 = require("../avc/color");
|
|
4
5
|
const traversal_1 = require("./traversal");
|
|
5
6
|
const parseColorSegment = (colourSegment) => {
|
|
6
7
|
const transferCharacteristics = (0, traversal_1.getTransferCharacteristicsSegment)(colourSegment);
|
|
@@ -8,33 +9,13 @@ const parseColorSegment = (colourSegment) => {
|
|
|
8
9
|
const primaries = (0, traversal_1.getPrimariesSegment)(colourSegment);
|
|
9
10
|
const range = (0, traversal_1.getRangeSegment)(colourSegment);
|
|
10
11
|
return {
|
|
11
|
-
|
|
12
|
-
? transferCharacteristics.value.value
|
|
13
|
-
? 'bt709'
|
|
14
|
-
: transferCharacteristics.value.value === 6
|
|
15
|
-
? 'smpte170m'
|
|
16
|
-
: transferCharacteristics.value.value === 13
|
|
17
|
-
? 'iec61966-2-1'
|
|
18
|
-
: null
|
|
12
|
+
transfer: transferCharacteristics
|
|
13
|
+
? (0, color_1.getTransferCharacteristicsFromIndex)(transferCharacteristics.value.value)
|
|
19
14
|
: null,
|
|
20
|
-
|
|
21
|
-
? matrixCoefficients.value.value
|
|
22
|
-
? 'bt709'
|
|
23
|
-
: matrixCoefficients.value.value === 6
|
|
24
|
-
? 'smpte170m'
|
|
25
|
-
: matrixCoefficients.value.value === 5
|
|
26
|
-
? 'bt470bg'
|
|
27
|
-
: null
|
|
28
|
-
: null,
|
|
29
|
-
primaries: primaries
|
|
30
|
-
? primaries.value.value === 1
|
|
31
|
-
? 'bt709'
|
|
32
|
-
: primaries.value.value === 6
|
|
33
|
-
? 'smpte170m'
|
|
34
|
-
: primaries.value.value === 5
|
|
35
|
-
? 'bt470bg'
|
|
36
|
-
: null
|
|
15
|
+
matrix: matrixCoefficients
|
|
16
|
+
? (0, color_1.getMatrixCoefficientsFromIndex)(matrixCoefficients.value.value)
|
|
37
17
|
: null,
|
|
18
|
+
primaries: primaries ? (0, color_1.getPrimariesFromIndex)(primaries.value.value) : null,
|
|
38
19
|
fullRange: (transferCharacteristics === null || transferCharacteristics === void 0 ? void 0 : transferCharacteristics.value.value) && (matrixCoefficients === null || matrixCoefficients === void 0 ? void 0 : matrixCoefficients.value.value)
|
|
39
20
|
? null
|
|
40
21
|
: range
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserTrack } from '../../get-tracks';
|
|
2
2
|
import type { WebmState } from '../../state/matroska/webm';
|
|
3
3
|
import type { StructureState } from '../../state/structure';
|
|
4
4
|
export type ResolvedAndUnresolvedTracks = {
|
|
5
|
-
resolved:
|
|
6
|
-
missingInfo:
|
|
5
|
+
resolved: MediaParserTrack[];
|
|
6
|
+
missingInfo: MediaParserTrack[];
|
|
7
7
|
};
|
|
8
8
|
export declare const getTracksFromMatroska: ({ structureState, webmState, }: {
|
|
9
9
|
structureState: StructureState;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../../log';
|
|
2
2
|
import type { WebmState } from '../../state/matroska/webm';
|
|
3
3
|
import type { CallbacksState } from '../../state/sample-callbacks';
|
|
4
4
|
import type { StructureState } from '../../state/structure';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MediaParserAudioSample, MediaParserOnVideoTrack, MediaParserVideoSample } from '../../webcodec-sample-types';
|
|
6
6
|
import type { BlockSegment, SimpleBlockSegment } from './segments/all-segments';
|
|
7
7
|
type SampleResult = {
|
|
8
8
|
type: 'video-sample';
|
|
9
|
-
videoSample:
|
|
9
|
+
videoSample: MediaParserVideoSample;
|
|
10
10
|
} | {
|
|
11
11
|
type: 'audio-sample';
|
|
12
|
-
audioSample:
|
|
12
|
+
audioSample: MediaParserAudioSample;
|
|
13
13
|
} | {
|
|
14
14
|
type: 'partial-video-sample';
|
|
15
|
-
partialVideoSample: Omit<
|
|
15
|
+
partialVideoSample: Omit<MediaParserVideoSample, 'type'>;
|
|
16
16
|
} | {
|
|
17
17
|
type: 'no-sample';
|
|
18
18
|
};
|
|
@@ -22,7 +22,7 @@ export declare const getSampleFromBlock: ({ ebml, webmState, offset, structureSt
|
|
|
22
22
|
offset: number;
|
|
23
23
|
structureState: StructureState;
|
|
24
24
|
callbacks: CallbacksState;
|
|
25
|
-
logLevel:
|
|
26
|
-
onVideoTrack:
|
|
25
|
+
logLevel: MediaParserLogLevel;
|
|
26
|
+
onVideoTrack: MediaParserOnVideoTrack | null;
|
|
27
27
|
}) => Promise<SampleResult>;
|
|
28
28
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserAudioCodec, MediaParserAudioTrack, MediaParserVideoTrack } from '../../get-tracks';
|
|
2
2
|
import type { TrackEntry } from './segments/all-segments';
|
|
3
3
|
export declare const NO_CODEC_PRIVATE_SHOULD_BE_DERIVED_FROM_SPS = "no-codec-private-should-be-derived-from-sps";
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getMatroskaAudioCodecEnum: ({ track, }: {
|
|
5
5
|
track: TrackEntry;
|
|
6
6
|
}) => MediaParserAudioCodec;
|
|
7
7
|
export declare const getTrack: ({ timescale, track, }: {
|
|
8
8
|
timescale: number;
|
|
9
9
|
track: TrackEntry;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => MediaParserVideoTrack | MediaParserAudioTrack | null;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTrack = exports.
|
|
3
|
+
exports.getTrack = exports.getMatroskaAudioCodecEnum = exports.NO_CODEC_PRIVATE_SHOULD_BE_DERIVED_FROM_SPS = void 0;
|
|
4
4
|
const buffer_iterator_1 = require("../../iterator/buffer-iterator");
|
|
5
5
|
const make_hvc1_codec_strings_1 = require("../../make-hvc1-codec-strings");
|
|
6
|
+
const color_to_webcodecs_colors_1 = require("../iso-base-media/color-to-webcodecs-colors");
|
|
6
7
|
const av1_codec_private_1 = require("./av1-codec-private");
|
|
7
8
|
const color_1 = require("./color");
|
|
8
9
|
const description_1 = require("./description");
|
|
@@ -22,7 +23,7 @@ const getDescription = (track) => {
|
|
|
22
23
|
}
|
|
23
24
|
return undefined;
|
|
24
25
|
};
|
|
25
|
-
const
|
|
26
|
+
const getMatroskaVideoCodecEnum = ({ codecSegment: codec, }) => {
|
|
26
27
|
if (codec.value === 'V_VP8') {
|
|
27
28
|
return 'vp8';
|
|
28
29
|
}
|
|
@@ -72,7 +73,7 @@ const getMatroskaVideoCodecString = ({ track, codecSegment: codec, }) => {
|
|
|
72
73
|
}
|
|
73
74
|
throw new Error(`Unknown codec: ${codec.value}`);
|
|
74
75
|
};
|
|
75
|
-
const
|
|
76
|
+
const getMatroskaAudioCodecEnum = ({ track, }) => {
|
|
76
77
|
const codec = (0, traversal_1.getCodecSegment)(track);
|
|
77
78
|
if (!codec) {
|
|
78
79
|
throw new Error('Expected codec segment');
|
|
@@ -109,7 +110,7 @@ const getMatroskaAudioCodecWithoutConfigString = ({ track, }) => {
|
|
|
109
110
|
}
|
|
110
111
|
throw new Error(`Unknown codec: ${codec.value}`);
|
|
111
112
|
};
|
|
112
|
-
exports.
|
|
113
|
+
exports.getMatroskaAudioCodecEnum = getMatroskaAudioCodecEnum;
|
|
113
114
|
const getMatroskaAudioCodecString = (track) => {
|
|
114
115
|
const codec = (0, traversal_1.getCodecSegment)(track);
|
|
115
116
|
if (!codec) {
|
|
@@ -198,6 +199,42 @@ const getTrack = ({ timescale, track, }) => {
|
|
|
198
199
|
if (!codecString) {
|
|
199
200
|
return null;
|
|
200
201
|
}
|
|
202
|
+
const codecEnum = getMatroskaVideoCodecEnum({
|
|
203
|
+
codecSegment: codec,
|
|
204
|
+
});
|
|
205
|
+
const codecData = codecPrivate === null
|
|
206
|
+
? null
|
|
207
|
+
: codecEnum === 'h264'
|
|
208
|
+
? { type: 'avc-sps-pps', data: codecPrivate }
|
|
209
|
+
: codecEnum === 'av1'
|
|
210
|
+
? {
|
|
211
|
+
type: 'av1c-data',
|
|
212
|
+
data: codecPrivate,
|
|
213
|
+
}
|
|
214
|
+
: codecEnum === 'h265'
|
|
215
|
+
? {
|
|
216
|
+
type: 'hvcc-data',
|
|
217
|
+
data: codecPrivate,
|
|
218
|
+
}
|
|
219
|
+
: codecEnum === 'vp8'
|
|
220
|
+
? {
|
|
221
|
+
type: 'unknown-data',
|
|
222
|
+
data: codecPrivate,
|
|
223
|
+
}
|
|
224
|
+
: codecEnum === 'vp9'
|
|
225
|
+
? {
|
|
226
|
+
type: 'unknown-data',
|
|
227
|
+
data: codecPrivate,
|
|
228
|
+
}
|
|
229
|
+
: null;
|
|
230
|
+
const advancedColor = colour
|
|
231
|
+
? (0, color_1.parseColorSegment)(colour)
|
|
232
|
+
: {
|
|
233
|
+
fullRange: null,
|
|
234
|
+
matrix: null,
|
|
235
|
+
primaries: null,
|
|
236
|
+
transfer: null,
|
|
237
|
+
};
|
|
201
238
|
return {
|
|
202
239
|
m3uStreamFormat: null,
|
|
203
240
|
type: 'video',
|
|
@@ -220,19 +257,10 @@ const getTrack = ({ timescale, track, }) => {
|
|
|
220
257
|
? displayWidth.value.value
|
|
221
258
|
: width.value.value,
|
|
222
259
|
rotation: 0,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
: {
|
|
228
|
-
fullRange: null,
|
|
229
|
-
matrixCoefficients: null,
|
|
230
|
-
primaries: null,
|
|
231
|
-
transferCharacteristics: null,
|
|
232
|
-
},
|
|
233
|
-
codecWithoutConfig: getMatroskaVideoCodecWithoutConfigString({
|
|
234
|
-
codecSegment: codec,
|
|
235
|
-
}),
|
|
260
|
+
codecData,
|
|
261
|
+
colorSpace: (0, color_to_webcodecs_colors_1.mediaParserAdvancedColorToWebCodecsColor)(advancedColor),
|
|
262
|
+
advancedColor,
|
|
263
|
+
codecEnum,
|
|
236
264
|
fps: null,
|
|
237
265
|
};
|
|
238
266
|
}
|
|
@@ -243,17 +271,21 @@ const getTrack = ({ timescale, track, }) => {
|
|
|
243
271
|
if (sampleRate === null) {
|
|
244
272
|
throw new Error('Could not find sample rate or number of channels');
|
|
245
273
|
}
|
|
274
|
+
const codecString = getMatroskaAudioCodecString(track);
|
|
246
275
|
return {
|
|
247
276
|
type: 'audio',
|
|
248
277
|
trackId,
|
|
249
|
-
codec:
|
|
278
|
+
codec: codecString,
|
|
250
279
|
timescale,
|
|
251
280
|
numberOfChannels,
|
|
252
281
|
sampleRate,
|
|
253
282
|
description: (0, description_1.getAudioDescription)(track),
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
283
|
+
codecData: codecPrivate
|
|
284
|
+
? codecString === 'opus'
|
|
285
|
+
? { type: 'ogg-identification', data: codecPrivate }
|
|
286
|
+
: { type: 'unknown-data', data: codecPrivate }
|
|
287
|
+
: null,
|
|
288
|
+
codecEnum: (0, exports.getMatroskaAudioCodecEnum)({
|
|
257
289
|
track,
|
|
258
290
|
}),
|
|
259
291
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseWebm = void 0;
|
|
4
|
+
const skip_1 = require("../../skip");
|
|
5
|
+
const may_skip_video_data_1 = require("../../state/may-skip-video-data");
|
|
4
6
|
const get_byte_for_cues_1 = require("./get-byte-for-cues");
|
|
5
7
|
const segments_1 = require("./segments");
|
|
6
8
|
const state_for_processing_1 = require("./state-for-processing");
|
|
@@ -28,6 +30,9 @@ const parseWebm = async (state) => {
|
|
|
28
30
|
return null;
|
|
29
31
|
}
|
|
30
32
|
if (isInsideCluster) {
|
|
33
|
+
if ((0, may_skip_video_data_1.maySkipVideoData)({ state })) {
|
|
34
|
+
return (0, skip_1.makeSkip)(Math.min(state.contentLength, isInsideCluster.size + isInsideCluster.start));
|
|
35
|
+
}
|
|
31
36
|
const segments = structure.boxes.filter((box) => box.type === 'Segment');
|
|
32
37
|
const segment = segments[isInsideCluster.segment];
|
|
33
38
|
if (!segment) {
|