@remotion/media-parser 4.0.298 → 4.0.301
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/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/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
- package/dist/containers/iso-base-media/sample-positions.d.ts +0 -25
- package/dist/containers/iso-base-media/sample-positions.js +0 -37
- package/dist/containers/iso-base-media/turn-sample-positions-into-array.d.ts +0 -19
- package/dist/containers/iso-base-media/turn-sample-positions-into-array.js +0 -73
- package/dist/containers/m3u/iterate-over-segment-files.d.ts +0 -21
- package/dist/containers/m3u/iterate-over-segment-files.js +0 -132
- package/dist/containers/mp3/audio-sample-from-cbr.d.ts +0 -11
- package/dist/containers/mp3/audio-sample-from-cbr.js +0 -35
- package/dist/emit-audio-sample.d.ts +0 -12
- package/dist/emit-audio-sample.js +0 -11
|
@@ -2,9 +2,9 @@ import type { MediaParserController } from './controller/media-parser-controller
|
|
|
2
2
|
import type { PrefetchCache } from './fetch';
|
|
3
3
|
import type { AllOptions, ParseMediaFields } from './fields';
|
|
4
4
|
import type { BufferIterator } from './iterator/buffer-iterator';
|
|
5
|
-
import type {
|
|
5
|
+
import type { MediaParserLogLevel } from './log';
|
|
6
6
|
import type { M3uPlaylistContext, ParseMediaMode, ParseMediaSrc } from './options';
|
|
7
|
-
import type {
|
|
7
|
+
import type { MediaParserReaderInterface } from './readers/reader';
|
|
8
8
|
import type { AacState } from './state/aac-state';
|
|
9
9
|
import type { CurrentReader } from './state/current-reader';
|
|
10
10
|
import type { FlacState } from './state/flac-state';
|
|
@@ -22,14 +22,14 @@ import type { StructureState } from './state/structure';
|
|
|
22
22
|
import type { TransportStreamState } from './state/transport-stream/transport-stream';
|
|
23
23
|
import { type MediaSectionState } from './state/video-section';
|
|
24
24
|
export type WorkOnSeekRequestOptions = {
|
|
25
|
-
logLevel:
|
|
25
|
+
logLevel: MediaParserLogLevel;
|
|
26
26
|
controller: MediaParserController;
|
|
27
27
|
isoState: IsoBaseMediaState;
|
|
28
28
|
iterator: BufferIterator;
|
|
29
29
|
structureState: StructureState;
|
|
30
30
|
src: ParseMediaSrc;
|
|
31
31
|
contentLength: number;
|
|
32
|
-
readerInterface:
|
|
32
|
+
readerInterface: MediaParserReaderInterface;
|
|
33
33
|
mediaSection: MediaSectionState;
|
|
34
34
|
m3uPlaylistContext: M3uPlaylistContext | null;
|
|
35
35
|
transportStream: TransportStreamState;
|
|
@@ -13,49 +13,46 @@ const turnSeekIntoByte = async ({ seek, mediaSectionState, logLevel, iterator, s
|
|
|
13
13
|
type: 'valid-but-must-wait',
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
if (seek
|
|
17
|
-
|
|
18
|
-
throw new Error(`Cannot seek to a negative time: ${JSON.stringify(seek)}`);
|
|
19
|
-
}
|
|
20
|
-
const seekingHints = (0, get_seeking_hints_1.getSeekingHints)({
|
|
21
|
-
riffState,
|
|
22
|
-
samplesObserved,
|
|
23
|
-
structureState,
|
|
24
|
-
mediaSectionState,
|
|
25
|
-
isoState,
|
|
26
|
-
transportStream,
|
|
27
|
-
tracksState,
|
|
28
|
-
keyframesState: keyframes,
|
|
29
|
-
webmState,
|
|
30
|
-
flacState,
|
|
31
|
-
mp3State,
|
|
32
|
-
contentLength,
|
|
33
|
-
aacState,
|
|
34
|
-
m3uPlaylistContext,
|
|
35
|
-
});
|
|
36
|
-
if (!seekingHints) {
|
|
37
|
-
log_1.Log.trace(logLevel, 'No seeking info, cannot seek yet');
|
|
38
|
-
return {
|
|
39
|
-
type: 'valid-but-must-wait',
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
const seekingByte = await (0, get_seeking_byte_1.getSeekingByte)({
|
|
43
|
-
info: seekingHints,
|
|
44
|
-
time: seek.timeInSeconds,
|
|
45
|
-
logLevel,
|
|
46
|
-
currentPosition: iterator.counter.getOffset(),
|
|
47
|
-
isoState,
|
|
48
|
-
transportStream,
|
|
49
|
-
webmState,
|
|
50
|
-
mediaSection: mediaSectionState,
|
|
51
|
-
m3uPlaylistContext,
|
|
52
|
-
structure: structureState,
|
|
53
|
-
riffState,
|
|
54
|
-
m3uState,
|
|
55
|
-
});
|
|
56
|
-
return seekingByte;
|
|
16
|
+
if (seek < 0) {
|
|
17
|
+
throw new Error(`Cannot seek to a negative time: ${JSON.stringify(seek)}`);
|
|
57
18
|
}
|
|
58
|
-
|
|
19
|
+
const seekingHints = (0, get_seeking_hints_1.getSeekingHints)({
|
|
20
|
+
riffState,
|
|
21
|
+
samplesObserved,
|
|
22
|
+
structureState,
|
|
23
|
+
mediaSectionState,
|
|
24
|
+
isoState,
|
|
25
|
+
transportStream,
|
|
26
|
+
tracksState,
|
|
27
|
+
keyframesState: keyframes,
|
|
28
|
+
webmState,
|
|
29
|
+
flacState,
|
|
30
|
+
mp3State,
|
|
31
|
+
contentLength,
|
|
32
|
+
aacState,
|
|
33
|
+
m3uPlaylistContext,
|
|
34
|
+
});
|
|
35
|
+
if (!seekingHints) {
|
|
36
|
+
log_1.Log.trace(logLevel, 'No seeking info, cannot seek yet');
|
|
37
|
+
return {
|
|
38
|
+
type: 'valid-but-must-wait',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const seekingByte = await (0, get_seeking_byte_1.getSeekingByte)({
|
|
42
|
+
info: seekingHints,
|
|
43
|
+
time: seek,
|
|
44
|
+
logLevel,
|
|
45
|
+
currentPosition: iterator.counter.getOffset(),
|
|
46
|
+
isoState,
|
|
47
|
+
transportStream,
|
|
48
|
+
webmState,
|
|
49
|
+
mediaSection: mediaSectionState,
|
|
50
|
+
m3uPlaylistContext,
|
|
51
|
+
structure: structureState,
|
|
52
|
+
riffState,
|
|
53
|
+
m3uState,
|
|
54
|
+
});
|
|
55
|
+
return seekingByte;
|
|
59
56
|
};
|
|
60
57
|
const getWorkOnSeekRequestOptions = (state) => {
|
|
61
58
|
return {
|
|
@@ -91,7 +88,7 @@ exports.getWorkOnSeekRequestOptions = getWorkOnSeekRequestOptions;
|
|
|
91
88
|
const workOnSeekRequest = async (options) => {
|
|
92
89
|
const { logLevel, controller, mediaSection, m3uPlaylistContext, isoState, iterator, structureState, src, contentLength, readerInterface, mode, seekInfiniteLoop, currentReader, discardReadBytes, fields, transportStream, tracksState, webmState, keyframes, flacState, samplesObserved, riffState, mp3State, aacState, prefetchCache, m3uState, } = options;
|
|
93
90
|
const seek = controller._internals.seekSignal.getSeek();
|
|
94
|
-
if (
|
|
91
|
+
if (seek === null) {
|
|
95
92
|
return;
|
|
96
93
|
}
|
|
97
94
|
log_1.Log.trace(logLevel, `Has seek request for ${src}: ${JSON.stringify(seek)}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../log';
|
|
2
2
|
import type { SeekingHints } from '../seeking-hints';
|
|
3
3
|
import type { ResponseError } from './worker-types';
|
|
4
4
|
export declare const serializeError: ({ error, logLevel, seekingHints, }: {
|
|
5
5
|
error: Error;
|
|
6
|
-
logLevel:
|
|
6
|
+
logLevel: MediaParserLogLevel;
|
|
7
7
|
seekingHints: SeekingHints | null;
|
|
8
8
|
}) => ResponseError;
|
|
9
9
|
export declare const deserializeError: (error: ResponseError) => Error;
|
|
@@ -4,25 +4,14 @@ exports.deserializeError = exports.serializeError = void 0;
|
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const log_1 = require("../log");
|
|
6
6
|
const serializeError = ({ error, logLevel, seekingHints, }) => {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f
|
|
8
|
-
if (error instanceof errors_1.IsAGifError) {
|
|
9
|
-
return {
|
|
10
|
-
type: 'response-error',
|
|
11
|
-
errorName: 'IsAGifError',
|
|
12
|
-
errorMessage: error.message,
|
|
13
|
-
errorStack: (_a = error.stack) !== null && _a !== void 0 ? _a : '',
|
|
14
|
-
mimeType: error.mimeType,
|
|
15
|
-
sizeInBytes: error.sizeInBytes,
|
|
16
|
-
fileName: error.fileName,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19
8
|
if (error instanceof errors_1.IsAnImageError) {
|
|
20
9
|
return {
|
|
21
10
|
type: 'response-error',
|
|
22
11
|
errorName: 'IsAnImageError',
|
|
23
12
|
dimensions: error.dimensions,
|
|
24
13
|
errorMessage: error.message,
|
|
25
|
-
errorStack: (
|
|
14
|
+
errorStack: (_a = error.stack) !== null && _a !== void 0 ? _a : '',
|
|
26
15
|
fileName: error.fileName,
|
|
27
16
|
imageType: error.imageType,
|
|
28
17
|
mimeType: error.mimeType,
|
|
@@ -34,7 +23,7 @@ const serializeError = ({ error, logLevel, seekingHints, }) => {
|
|
|
34
23
|
type: 'response-error',
|
|
35
24
|
errorName: 'IsAPdfError',
|
|
36
25
|
errorMessage: error.message,
|
|
37
|
-
errorStack: (
|
|
26
|
+
errorStack: (_b = error.stack) !== null && _b !== void 0 ? _b : '',
|
|
38
27
|
mimeType: error.mimeType,
|
|
39
28
|
sizeInBytes: error.sizeInBytes,
|
|
40
29
|
fileName: error.fileName,
|
|
@@ -45,7 +34,7 @@ const serializeError = ({ error, logLevel, seekingHints, }) => {
|
|
|
45
34
|
type: 'response-error',
|
|
46
35
|
errorName: 'MediaParserAbortError',
|
|
47
36
|
errorMessage: error.message,
|
|
48
|
-
errorStack: (
|
|
37
|
+
errorStack: (_c = error.stack) !== null && _c !== void 0 ? _c : '',
|
|
49
38
|
seekingHints,
|
|
50
39
|
};
|
|
51
40
|
}
|
|
@@ -54,7 +43,7 @@ const serializeError = ({ error, logLevel, seekingHints, }) => {
|
|
|
54
43
|
type: 'response-error',
|
|
55
44
|
errorName: 'AbortError',
|
|
56
45
|
errorMessage: error.message,
|
|
57
|
-
errorStack: (
|
|
46
|
+
errorStack: (_d = error.stack) !== null && _d !== void 0 ? _d : '',
|
|
58
47
|
};
|
|
59
48
|
}
|
|
60
49
|
if (error.name === 'NotReadableError') {
|
|
@@ -62,7 +51,7 @@ const serializeError = ({ error, logLevel, seekingHints, }) => {
|
|
|
62
51
|
type: 'response-error',
|
|
63
52
|
errorName: 'NotReadableError',
|
|
64
53
|
errorMessage: error.message,
|
|
65
|
-
errorStack: (
|
|
54
|
+
errorStack: (_e = error.stack) !== null && _e !== void 0 ? _e : '',
|
|
66
55
|
};
|
|
67
56
|
}
|
|
68
57
|
if (error.name !== 'Error') {
|
|
@@ -72,19 +61,12 @@ const serializeError = ({ error, logLevel, seekingHints, }) => {
|
|
|
72
61
|
type: 'response-error',
|
|
73
62
|
errorName: 'Error',
|
|
74
63
|
errorMessage: error.message,
|
|
75
|
-
errorStack: (
|
|
64
|
+
errorStack: (_f = error.stack) !== null && _f !== void 0 ? _f : '',
|
|
76
65
|
};
|
|
77
66
|
};
|
|
78
67
|
exports.serializeError = serializeError;
|
|
79
68
|
const deserializeError = (error) => {
|
|
80
69
|
switch (error.errorName) {
|
|
81
|
-
case 'IsAGifError':
|
|
82
|
-
return new errors_1.IsAGifError({
|
|
83
|
-
fileName: error.fileName,
|
|
84
|
-
mimeType: error.mimeType,
|
|
85
|
-
sizeInBytes: error.sizeInBytes,
|
|
86
|
-
message: error.errorMessage,
|
|
87
|
-
});
|
|
88
70
|
case 'IsAnImageError':
|
|
89
71
|
return new errors_1.IsAnImageError({
|
|
90
72
|
dimensions: error.dimensions,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { M3uAssociatedPlaylist, M3uStream } from '../containers/m3u/get-streams';
|
|
2
2
|
import type { SelectM3uAssociatedPlaylistsFnOptions, SelectM3uStreamFnOptions } from '../containers/m3u/select-stream';
|
|
3
|
-
import type {
|
|
4
|
-
import type { Dimensions, ImageType } from '../errors';
|
|
3
|
+
import type { ImageType } from '../errors';
|
|
5
4
|
import type { Options, ParseMediaFields } from '../fields';
|
|
5
|
+
import type { MediaParserDimensions } from '../get-dimensions';
|
|
6
6
|
import type { MediaParserLocation } from '../get-location';
|
|
7
|
-
import type { MediaParserAudioCodec, MediaParserVideoCodec } from '../get-tracks';
|
|
7
|
+
import type { MediaParserAudioCodec, MediaParserTrack, MediaParserVideoCodec } from '../get-tracks';
|
|
8
8
|
import type { MediaParserMetadataEntry } from '../metadata/get-metadata';
|
|
9
|
-
import type { MediaParserContainer, MediaParserKeyframe,
|
|
9
|
+
import type { MediaParserContainer, MediaParserKeyframe, ParseMediaProgress, ParseMediaResult, ParseMediaSrc, SerializeableOptionalParseMediaParams } from '../options';
|
|
10
10
|
import type { MediaParserStructureUnstable } from '../parse-result';
|
|
11
11
|
import type { SeekingHints } from '../seeking-hints';
|
|
12
12
|
import type { MediaParserEmbeddedImage } from '../state/images';
|
|
13
13
|
import type { InternalStats } from '../state/parser-state';
|
|
14
|
-
import type {
|
|
14
|
+
import type { MediaParserAudioSample, MediaParserOnAudioTrackParams, MediaParserOnVideoTrackParams, MediaParserVideoSample } from '../webcodec-sample-types';
|
|
15
15
|
export type ParseMediaOnWorkerPayload = {
|
|
16
16
|
type: 'request-worker';
|
|
17
17
|
src: ParseMediaSrc;
|
|
@@ -41,7 +41,7 @@ export type ParseMediaOnWorkerPayload = {
|
|
|
41
41
|
postSlowKeyframes: boolean;
|
|
42
42
|
postSlowNumberOfFrames: boolean;
|
|
43
43
|
postSlowVideoBitrate: boolean;
|
|
44
|
-
|
|
44
|
+
postSlowStructure: boolean;
|
|
45
45
|
postTracks: boolean;
|
|
46
46
|
postDurationInSeconds: boolean;
|
|
47
47
|
postParseProgress: boolean;
|
|
@@ -55,7 +55,7 @@ type RequestPause = {
|
|
|
55
55
|
};
|
|
56
56
|
type RequestSeek = {
|
|
57
57
|
type: 'request-seek';
|
|
58
|
-
payload:
|
|
58
|
+
payload: number;
|
|
59
59
|
};
|
|
60
60
|
type RequestResume = {
|
|
61
61
|
type: 'request-resume';
|
|
@@ -88,16 +88,10 @@ type GenericError = BaseError & {
|
|
|
88
88
|
type NotReadableError = BaseError & {
|
|
89
89
|
errorName: 'NotReadableError';
|
|
90
90
|
};
|
|
91
|
-
type IsAGifError = BaseError & {
|
|
92
|
-
errorName: 'IsAGifError';
|
|
93
|
-
mimeType: string | null;
|
|
94
|
-
sizeInBytes: number | null;
|
|
95
|
-
fileName: string | null;
|
|
96
|
-
};
|
|
97
91
|
type IsAnImageError = BaseError & {
|
|
98
92
|
errorName: 'IsAnImageError';
|
|
99
93
|
imageType: ImageType;
|
|
100
|
-
dimensions:
|
|
94
|
+
dimensions: MediaParserDimensions | null;
|
|
101
95
|
mimeType: string | null;
|
|
102
96
|
sizeInBytes: number | null;
|
|
103
97
|
fileName: string | null;
|
|
@@ -118,7 +112,7 @@ type MediaParserAbortError = BaseError & {
|
|
|
118
112
|
errorName: 'MediaParserAbortError';
|
|
119
113
|
seekingHints: SeekingHints | null;
|
|
120
114
|
};
|
|
121
|
-
type AnyError = GenericError |
|
|
115
|
+
type AnyError = GenericError | IsAnImageError | IsAPdfError | IsAnUnsupportedFileTypeError | MediaParserAbortError | AbortError | NotReadableError;
|
|
122
116
|
export type ResponseError = {
|
|
123
117
|
type: 'response-error';
|
|
124
118
|
} & AnyError;
|
|
@@ -130,10 +124,10 @@ export type ResponseCallbackPayload = {
|
|
|
130
124
|
value: MediaParserContainer;
|
|
131
125
|
} | {
|
|
132
126
|
callbackType: 'dimensions';
|
|
133
|
-
value:
|
|
127
|
+
value: MediaParserDimensions | null;
|
|
134
128
|
} | {
|
|
135
129
|
callbackType: 'unrotated-dimensions';
|
|
136
|
-
value:
|
|
130
|
+
value: MediaParserDimensions | null;
|
|
137
131
|
} | {
|
|
138
132
|
callbackType: 'video-codec';
|
|
139
133
|
value: MediaParserVideoCodec | null;
|
|
@@ -198,14 +192,14 @@ export type ResponseCallbackPayload = {
|
|
|
198
192
|
callbackType: 'slow-video-bitrate';
|
|
199
193
|
value: number | null;
|
|
200
194
|
} | {
|
|
201
|
-
callbackType: 'structure';
|
|
195
|
+
callbackType: 'slow-structure';
|
|
202
196
|
value: MediaParserStructureUnstable;
|
|
203
197
|
} | {
|
|
204
198
|
callbackType: 'tracks';
|
|
205
|
-
value:
|
|
199
|
+
value: MediaParserTrack[];
|
|
206
200
|
} | {
|
|
207
201
|
callbackType: 'unrotated-dimensions';
|
|
208
|
-
value:
|
|
202
|
+
value: MediaParserDimensions | null;
|
|
209
203
|
} | {
|
|
210
204
|
callbackType: 'video-codec';
|
|
211
205
|
value: MediaParserVideoCodec | null;
|
|
@@ -220,13 +214,17 @@ export type ResponseCallbackPayload = {
|
|
|
220
214
|
value: SelectM3uStreamFnOptions;
|
|
221
215
|
} | {
|
|
222
216
|
callbackType: 'on-audio-track';
|
|
223
|
-
value:
|
|
217
|
+
value: MediaParserOnAudioTrackParams;
|
|
224
218
|
} | {
|
|
225
219
|
callbackType: 'on-video-track';
|
|
226
|
-
value:
|
|
220
|
+
value: MediaParserOnVideoTrackParams;
|
|
221
|
+
} | {
|
|
222
|
+
callbackType: 'on-audio-sample';
|
|
223
|
+
value: MediaParserAudioSample;
|
|
224
|
+
trackId: number;
|
|
227
225
|
} | {
|
|
228
|
-
callbackType: 'on-
|
|
229
|
-
value:
|
|
226
|
+
callbackType: 'on-video-sample';
|
|
227
|
+
value: MediaParserVideoSample;
|
|
230
228
|
trackId: number;
|
|
231
229
|
} | {
|
|
232
230
|
callbackType: 'm3u-associated-playlists-selection';
|
package/dist/worker-server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const messageHandler: (message: MessageEvent, readerInterface:
|
|
1
|
+
import type { MediaParserReaderInterface } from './readers/reader';
|
|
2
|
+
export declare const messageHandler: (message: MessageEvent, readerInterface: MediaParserReaderInterface) => void;
|
package/dist/worker-server.js
CHANGED
|
@@ -43,7 +43,7 @@ const executeCallback = (payload) => {
|
|
|
43
43
|
const startParsing = async (message, reader) => {
|
|
44
44
|
const { payload, src } = message;
|
|
45
45
|
const { fields, acknowledgeRemotionLicense, logLevel: userLogLevel, progressIntervalInMs, m3uPlaylistContext, seekingHints, makeSamplesStartAtZero, } = payload;
|
|
46
|
-
const { postAudioCodec, postContainer, postDimensions, postFps, postImages, postInternalStats, postIsHdr, postKeyframes, postLocation, postM3uStreams, postMetadata, postMimeType, postName, postNumberOfAudioChannels, postRotation, postSampleRate, postSlowAudioBitrate, postSlowNumberOfFrames, postSlowFps, postSlowDurationInSeconds, postSlowVideoBitrate,
|
|
46
|
+
const { postAudioCodec, postContainer, postDimensions, postFps, postImages, postInternalStats, postIsHdr, postKeyframes, postLocation, postM3uStreams, postMetadata, postMimeType, postName, postNumberOfAudioChannels, postRotation, postSampleRate, postSlowAudioBitrate, postSlowNumberOfFrames, postSlowFps, postSlowDurationInSeconds, postSlowVideoBitrate, postSlowStructure, postTracks, postUnrotatedDimensions, postVideoCodec, postSize, postSlowKeyframes, postDurationInSeconds, postParseProgress, postM3uStreamSelection, postM3uAssociatedPlaylistsSelection, postOnAudioTrack, postOnVideoTrack, } = message;
|
|
47
47
|
const logLevel = userLogLevel !== null && userLogLevel !== void 0 ? userLogLevel : 'info';
|
|
48
48
|
try {
|
|
49
49
|
const ret = await (0, internal_parse_media_1.internalParseMedia)({
|
|
@@ -240,10 +240,10 @@ const startParsing = async (message, reader) => {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
: null,
|
|
243
|
-
|
|
243
|
+
onSlowStructure: postSlowStructure
|
|
244
244
|
? async (structure) => {
|
|
245
245
|
await executeCallback({
|
|
246
|
-
callbackType: 'structure',
|
|
246
|
+
callbackType: 'slow-structure',
|
|
247
247
|
value: structure,
|
|
248
248
|
});
|
|
249
249
|
}
|
|
@@ -328,7 +328,7 @@ const startParsing = async (message, reader) => {
|
|
|
328
328
|
}
|
|
329
329
|
return async (sample) => {
|
|
330
330
|
await executeCallback({
|
|
331
|
-
callbackType: 'on-audio-
|
|
331
|
+
callbackType: 'on-audio-sample',
|
|
332
332
|
value: sample,
|
|
333
333
|
trackId: params.track.trackId,
|
|
334
334
|
});
|
|
@@ -349,7 +349,7 @@ const startParsing = async (message, reader) => {
|
|
|
349
349
|
}
|
|
350
350
|
return async (sample) => {
|
|
351
351
|
await executeCallback({
|
|
352
|
-
callbackType: 'on-
|
|
352
|
+
callbackType: 'on-video-sample',
|
|
353
353
|
value: sample,
|
|
354
354
|
trackId: params.track.trackId,
|
|
355
355
|
});
|
package/dist/writers/writer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MediaParserLogLevel } from '../log';
|
|
2
2
|
export type Writer = {
|
|
3
3
|
write: (arr: Uint8Array) => Promise<void>;
|
|
4
4
|
finish: () => Promise<void>;
|
|
@@ -10,7 +10,7 @@ export type Writer = {
|
|
|
10
10
|
export type CreateContent = (options: {
|
|
11
11
|
filename: string;
|
|
12
12
|
mimeType: string;
|
|
13
|
-
logLevel:
|
|
13
|
+
logLevel: MediaParserLogLevel;
|
|
14
14
|
}) => Promise<Writer>;
|
|
15
15
|
export type WriterInterface = {
|
|
16
16
|
createContent: CreateContent;
|
package/package.json
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/media-parser"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/media-parser",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.301",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@types/wicg-file-system-access": "2023.10.5",
|
|
11
11
|
"eslint": "9.19.0",
|
|
12
12
|
"@types/bun": "1.2.8",
|
|
13
|
-
"@remotion/example-videos": "4.0.
|
|
14
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
13
|
+
"@remotion/example-videos": "4.0.301",
|
|
14
|
+
"@remotion/eslint-config-internal": "4.0.301"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SamplePosition } from '../../get-sample-positions';
|
|
2
|
-
import type { CttsBox } from './stsd/ctts';
|
|
3
|
-
import type { StcoBox } from './stsd/stco';
|
|
4
|
-
import type { StscBox } from './stsd/stsc';
|
|
5
|
-
import type { StssBox } from './stsd/stss';
|
|
6
|
-
import type { StszBox } from './stsd/stsz';
|
|
7
|
-
import type { SttsBox } from './stsd/stts';
|
|
8
|
-
export type GroupOfSamplePositions = {
|
|
9
|
-
type: 'array';
|
|
10
|
-
boxes: SamplePosition[];
|
|
11
|
-
} | {
|
|
12
|
-
type: 'map';
|
|
13
|
-
boxes: {
|
|
14
|
-
stszBox: StszBox;
|
|
15
|
-
stcoBox: StcoBox;
|
|
16
|
-
stscBox: StscBox;
|
|
17
|
-
sttsBox: SttsBox;
|
|
18
|
-
stssBox: StssBox | null;
|
|
19
|
-
cttsBox: CttsBox | null;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare const hasNoSamplePositions: (samplePositions: GroupOfSamplePositions) => boolean;
|
|
23
|
-
export declare const hasNoSamplePositionsGroup: (samplePositions: GroupOfSamplePositions[]) => boolean;
|
|
24
|
-
export declare const getKeyframesFromGroupOfSamplePositions: (samplePositions: GroupOfSamplePositions) => SamplePosition[];
|
|
25
|
-
export declare const groupGetKeyframesFromGroupOfSamplePositions: (samplePositions: GroupOfSamplePositions[]) => SamplePosition[];
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.groupGetKeyframesFromGroupOfSamplePositions = exports.getKeyframesFromGroupOfSamplePositions = exports.hasNoSamplePositionsGroup = exports.hasNoSamplePositions = void 0;
|
|
4
|
-
const turn_sample_positions_into_array_1 = require("./turn-sample-positions-into-array");
|
|
5
|
-
const hasNoSamplePositions = (samplePositions) => {
|
|
6
|
-
if (samplePositions.type === 'array') {
|
|
7
|
-
return samplePositions.boxes.length === 0;
|
|
8
|
-
}
|
|
9
|
-
return samplePositions.boxes.stcoBox.entryCount === 0;
|
|
10
|
-
};
|
|
11
|
-
exports.hasNoSamplePositions = hasNoSamplePositions;
|
|
12
|
-
const hasNoSamplePositionsGroup = (samplePositions) => {
|
|
13
|
-
return samplePositions.every((s) => (0, exports.hasNoSamplePositions)(s));
|
|
14
|
-
};
|
|
15
|
-
exports.hasNoSamplePositionsGroup = hasNoSamplePositionsGroup;
|
|
16
|
-
const getKeyframesFromGroupOfSamplePositions = (samplePositions) => {
|
|
17
|
-
if (samplePositions.type === 'array') {
|
|
18
|
-
return samplePositions.boxes.filter((s) => s.isKeyframe);
|
|
19
|
-
}
|
|
20
|
-
if (!samplePositions.boxes.stssBox) {
|
|
21
|
-
return (0, turn_sample_positions_into_array_1.turnSamplePositionsIntoArraySlow)({
|
|
22
|
-
...samplePositions.boxes,
|
|
23
|
-
onlyKeyframes: true,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return (0, turn_sample_positions_into_array_1.turnSamplePositionsIntoArraySlow)({
|
|
27
|
-
...samplePositions.boxes,
|
|
28
|
-
onlyKeyframes: false,
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
exports.getKeyframesFromGroupOfSamplePositions = getKeyframesFromGroupOfSamplePositions;
|
|
32
|
-
const groupGetKeyframesFromGroupOfSamplePositions = (samplePositions) => {
|
|
33
|
-
return samplePositions
|
|
34
|
-
.map((s) => (0, exports.getKeyframesFromGroupOfSamplePositions)(s))
|
|
35
|
-
.flat();
|
|
36
|
-
};
|
|
37
|
-
exports.groupGetKeyframesFromGroupOfSamplePositions = groupGetKeyframesFromGroupOfSamplePositions;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { SamplePosition } from '../../get-sample-positions';
|
|
2
|
-
import type { GroupOfSamplePositions } from './sample-positions';
|
|
3
|
-
import type { CttsBox } from './stsd/ctts';
|
|
4
|
-
import type { StcoBox } from './stsd/stco';
|
|
5
|
-
import type { StscBox } from './stsd/stsc';
|
|
6
|
-
import type { StssBox } from './stsd/stss';
|
|
7
|
-
import type { StszBox } from './stsd/stsz';
|
|
8
|
-
import type { SttsBox } from './stsd/stts';
|
|
9
|
-
export declare const turnSamplePositionsIntoArraySlow: ({ stcoBox, stszBox, stscBox, stssBox, sttsBox, cttsBox, onlyKeyframes, }: {
|
|
10
|
-
stcoBox: StcoBox;
|
|
11
|
-
stszBox: StszBox;
|
|
12
|
-
stscBox: StscBox;
|
|
13
|
-
stssBox: StssBox | null;
|
|
14
|
-
sttsBox: SttsBox;
|
|
15
|
-
cttsBox: CttsBox | null;
|
|
16
|
-
onlyKeyframes: boolean;
|
|
17
|
-
}) => SamplePosition[];
|
|
18
|
-
export declare const turnIntoOld: (samplePositions: GroupOfSamplePositions) => SamplePosition[];
|
|
19
|
-
export declare const turnGroupIntoOld: (samplePositions: GroupOfSamplePositions[]) => SamplePosition[];
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.turnGroupIntoOld = exports.turnIntoOld = exports.turnSamplePositionsIntoArraySlow = void 0;
|
|
4
|
-
const turnSamplePositionsIntoArraySlow = ({ stcoBox, stszBox, stscBox, stssBox, sttsBox, cttsBox, onlyKeyframes, }) => {
|
|
5
|
-
var _a;
|
|
6
|
-
const sttsDeltas = [];
|
|
7
|
-
for (const distribution of sttsBox.sampleDistribution) {
|
|
8
|
-
for (let i = 0; i < distribution.sampleCount; i++) {
|
|
9
|
-
sttsDeltas.push(distribution.sampleDelta);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const cttsEntries = [];
|
|
13
|
-
for (const entry of (_a = cttsBox === null || cttsBox === void 0 ? void 0 : cttsBox.entries) !== null && _a !== void 0 ? _a : [
|
|
14
|
-
{ sampleCount: sttsDeltas.length, sampleOffset: 0 },
|
|
15
|
-
]) {
|
|
16
|
-
for (let i = 0; i < entry.sampleCount; i++) {
|
|
17
|
-
cttsEntries.push(entry.sampleOffset);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
let dts = 0;
|
|
21
|
-
const samples = [];
|
|
22
|
-
let samplesPerChunk = 1;
|
|
23
|
-
for (let i = 0; i < stcoBox.entries.length; i++) {
|
|
24
|
-
const hasEntry = stscBox.entries.find((entry) => entry.firstChunk === i + 1);
|
|
25
|
-
if (hasEntry) {
|
|
26
|
-
samplesPerChunk = hasEntry.samplesPerChunk;
|
|
27
|
-
}
|
|
28
|
-
let offsetInThisChunk = 0;
|
|
29
|
-
for (let j = 0; j < samplesPerChunk; j++) {
|
|
30
|
-
const isKeyframe = stssBox
|
|
31
|
-
? stssBox.sampleNumber.includes(samples.length + 1)
|
|
32
|
-
: true;
|
|
33
|
-
if (onlyKeyframes && !isKeyframe) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
const size = stszBox.countType === 'fixed'
|
|
37
|
-
? stszBox.sampleSize
|
|
38
|
-
: stszBox.entries[samples.length];
|
|
39
|
-
const delta = sttsDeltas[samples.length];
|
|
40
|
-
const ctsOffset = cttsEntries[samples.length];
|
|
41
|
-
const cts = dts + ctsOffset;
|
|
42
|
-
samples.push({
|
|
43
|
-
offset: Number(stcoBox.entries[i]) + offsetInThisChunk,
|
|
44
|
-
size,
|
|
45
|
-
isKeyframe,
|
|
46
|
-
dts,
|
|
47
|
-
cts,
|
|
48
|
-
duration: delta,
|
|
49
|
-
chunk: i,
|
|
50
|
-
bigEndian: false,
|
|
51
|
-
chunkSize: null,
|
|
52
|
-
});
|
|
53
|
-
dts += delta;
|
|
54
|
-
offsetInThisChunk += size;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return samples;
|
|
58
|
-
};
|
|
59
|
-
exports.turnSamplePositionsIntoArraySlow = turnSamplePositionsIntoArraySlow;
|
|
60
|
-
const turnIntoOld = (samplePositions) => {
|
|
61
|
-
if (samplePositions.type === 'map') {
|
|
62
|
-
return (0, exports.turnSamplePositionsIntoArraySlow)({
|
|
63
|
-
...samplePositions.boxes,
|
|
64
|
-
onlyKeyframes: false,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return samplePositions.boxes;
|
|
68
|
-
};
|
|
69
|
-
exports.turnIntoOld = turnIntoOld;
|
|
70
|
-
const turnGroupIntoOld = (samplePositions) => {
|
|
71
|
-
return samplePositions.map((s) => (0, exports.turnIntoOld)(s)).flat();
|
|
72
|
-
};
|
|
73
|
-
exports.turnGroupIntoOld = turnGroupIntoOld;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { MediaParserController } from '../../controller/media-parser-controller';
|
|
2
|
-
import type { PrefetchCache } from '../../fetch';
|
|
3
|
-
import type { AudioTrack, VideoTrack } from '../../get-tracks';
|
|
4
|
-
import type { LogLevel } from '../../log';
|
|
5
|
-
import type { ReaderInterface } from '../../readers/reader';
|
|
6
|
-
import type { M3uRun, M3uState } from '../../state/m3u-state';
|
|
7
|
-
import type { OnAudioSample, OnVideoSample } from '../../webcodec-sample-types';
|
|
8
|
-
import type { M3uStructure } from './types';
|
|
9
|
-
export declare const iteratorOverSegmentFiles: ({ structure, onVideoTrack, m3uState, onAudioTrack, onDoneWithTracks, playlistUrl, logLevel, parentController, onInitialProgress, readerInterface, prefetchCache, }: {
|
|
10
|
-
structure: M3uStructure;
|
|
11
|
-
onVideoTrack: null | ((track: VideoTrack) => Promise<OnVideoSample | null>);
|
|
12
|
-
onAudioTrack: null | ((track: AudioTrack) => Promise<OnAudioSample | null>);
|
|
13
|
-
onDoneWithTracks: () => void;
|
|
14
|
-
m3uState: M3uState;
|
|
15
|
-
playlistUrl: string;
|
|
16
|
-
logLevel: LogLevel;
|
|
17
|
-
parentController: MediaParserController;
|
|
18
|
-
onInitialProgress: (run: M3uRun | null) => void;
|
|
19
|
-
readerInterface: ReaderInterface;
|
|
20
|
-
prefetchCache: PrefetchCache;
|
|
21
|
-
}) => Promise<void>;
|