@remotion/media-parser 4.0.276 → 4.0.278
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/aac-codecprivate.js +13 -6
- package/dist/add-avc-profile-to-track.js +9 -5
- package/dist/buffer-iterator.js +13 -8
- package/dist/combine-uint8-arrays.js +5 -1
- package/dist/containers/aac/parse-aac.js +13 -9
- package/dist/containers/aac/types.js +2 -1
- package/dist/containers/avc/codec-string.js +5 -1
- package/dist/containers/avc/color.js +9 -3
- package/dist/containers/avc/create-sps-pps-data.js +9 -5
- package/dist/containers/avc/interpret-sps.js +13 -7
- package/dist/containers/avc/key.js +5 -1
- package/dist/containers/avc/parse-avc.js +7 -3
- package/dist/containers/avc/sps-and-pps.js +5 -1
- package/dist/containers/flac/get-block-size.js +5 -1
- package/dist/containers/flac/get-channel-count.js +5 -1
- package/dist/containers/flac/get-duration-from-flac.js +5 -1
- package/dist/containers/flac/get-metadata-from-flac.js +5 -1
- package/dist/containers/flac/get-sample-rate.js +5 -1
- package/dist/containers/flac/parse-flac-frame.js +19 -14
- package/dist/containers/flac/parse-flac.js +19 -15
- package/dist/containers/flac/parse-header.js +5 -1
- package/dist/containers/flac/parse-metadata.js +5 -1
- package/dist/containers/flac/parse-streaminfo.js +7 -3
- package/dist/containers/flac/parse-unknown-block.js +5 -1
- package/dist/containers/flac/types.js +2 -1
- package/dist/containers/iso-base-media/base-media-box.js +2 -1
- package/dist/containers/iso-base-media/base-type.js +2 -1
- package/dist/containers/iso-base-media/esds/decoder-specific-config.js +5 -1
- package/dist/containers/iso-base-media/esds/esds-descriptors.js +10 -5
- package/dist/containers/iso-base-media/esds/esds.js +7 -3
- package/dist/containers/iso-base-media/ftyp.js +5 -1
- package/dist/containers/iso-base-media/get-actual-number-of-channels.js +8 -4
- package/dist/containers/iso-base-media/get-children.js +7 -3
- package/dist/containers/iso-base-media/get-keyframes.js +11 -7
- package/dist/containers/iso-base-media/get-moov-atom.js +17 -13
- package/dist/containers/iso-base-media/get-sample-positions-from-track.js +24 -20
- package/dist/containers/iso-base-media/get-video-codec-from-iso-track.js +7 -3
- package/dist/containers/iso-base-media/make-track.js +34 -30
- package/dist/containers/iso-base-media/mdat/mdat.js +20 -16
- package/dist/containers/iso-base-media/mdhd.js +5 -1
- package/dist/containers/iso-base-media/meta/hdlr.js +5 -1
- package/dist/containers/iso-base-media/meta/ilst.js +5 -1
- package/dist/containers/iso-base-media/moov/moov.js +7 -3
- package/dist/containers/iso-base-media/mvhd.js +11 -7
- package/dist/containers/iso-base-media/parse-boxes.js +9 -5
- package/dist/containers/iso-base-media/parse-icc-profile.js +8 -4
- package/dist/containers/iso-base-media/process-box.js +67 -63
- package/dist/containers/iso-base-media/stsd/av1c.js +5 -1
- package/dist/containers/iso-base-media/stsd/avcc.js +5 -1
- package/dist/containers/iso-base-media/stsd/colr.js +7 -3
- package/dist/containers/iso-base-media/stsd/ctts.js +5 -1
- package/dist/containers/iso-base-media/stsd/hvcc.js +7 -3
- package/dist/containers/iso-base-media/stsd/keys.js +5 -1
- package/dist/containers/iso-base-media/stsd/mebx.js +7 -3
- package/dist/containers/iso-base-media/stsd/pasp.js +5 -1
- package/dist/containers/iso-base-media/stsd/samples.js +13 -8
- package/dist/containers/iso-base-media/stsd/stco.js +5 -1
- package/dist/containers/iso-base-media/stsd/stsc.js +5 -1
- package/dist/containers/iso-base-media/stsd/stsd.js +7 -3
- package/dist/containers/iso-base-media/stsd/stss.js +5 -1
- package/dist/containers/iso-base-media/stsd/stsz.js +5 -1
- package/dist/containers/iso-base-media/stsd/stts.js +5 -1
- package/dist/containers/iso-base-media/tfdt.js +5 -1
- package/dist/containers/iso-base-media/tfhd.js +5 -1
- package/dist/containers/iso-base-media/tkhd.js +8 -4
- package/dist/containers/iso-base-media/to-date.js +5 -1
- package/dist/containers/iso-base-media/trak/trak.js +7 -3
- package/dist/containers/iso-base-media/traversal.js +57 -33
- package/dist/containers/iso-base-media/trun.js +5 -1
- package/dist/containers/iso-base-media/void-box.js +2 -1
- package/dist/containers/m3u/after-manifest-fetch.js +15 -11
- package/dist/containers/m3u/fetch-m3u8-stream.js +7 -3
- package/dist/containers/m3u/get-chunks.js +5 -1
- package/dist/containers/m3u/get-duration-from-m3u.js +8 -4
- package/dist/containers/m3u/get-playlist.js +12 -6
- package/dist/containers/m3u/get-streams.js +9 -3
- package/dist/containers/m3u/iterate-over-segment-files.js +15 -11
- package/dist/containers/m3u/parse-directive.js +10 -6
- package/dist/containers/m3u/parse-m3u-manifest.js +7 -3
- package/dist/containers/m3u/parse-m3u-media-directive.js +10 -5
- package/dist/containers/m3u/parse-m3u.js +11 -7
- package/dist/containers/m3u/parse-m3u8-text.js +7 -3
- package/dist/containers/m3u/parse-stream-inf.js +7 -2
- package/dist/containers/m3u/run-over-m3u.js +13 -9
- package/dist/containers/m3u/sample-sorter.js +8 -4
- package/dist/containers/m3u/select-stream.js +11 -4
- package/dist/containers/m3u/types.js +2 -1
- package/dist/containers/mp3/get-duration.js +9 -5
- package/dist/containers/mp3/get-frame-length.js +7 -2
- package/dist/containers/mp3/get-metadata-from-mp3.js +5 -1
- package/dist/containers/mp3/id3-v1.js +5 -1
- package/dist/containers/mp3/id3.js +5 -1
- package/dist/containers/mp3/parse-mp3.js +11 -7
- package/dist/containers/mp3/parse-mpeg-header.js +14 -10
- package/dist/containers/mp3/samples-per-mpeg-file.js +5 -1
- package/dist/containers/riff/expect-riff-box.js +15 -11
- package/dist/containers/riff/get-duration.js +12 -7
- package/dist/containers/riff/get-tracks-from-avi.js +28 -20
- package/dist/containers/riff/is-movi.js +5 -1
- package/dist/containers/riff/parse-avih.js +5 -1
- package/dist/containers/riff/parse-isft.js +5 -1
- package/dist/containers/riff/parse-list-box.js +7 -3
- package/dist/containers/riff/parse-movi.js +18 -13
- package/dist/containers/riff/parse-riff-body.js +13 -9
- package/dist/containers/riff/parse-riff-box.js +13 -9
- package/dist/containers/riff/parse-riff-header.js +5 -1
- package/dist/containers/riff/parse-riff.js +9 -5
- package/dist/containers/riff/parse-strf.js +5 -1
- package/dist/containers/riff/parse-strh.js +7 -3
- package/dist/containers/riff/parse-video-section.js +11 -7
- package/dist/containers/riff/riff-box.js +2 -1
- package/dist/containers/riff/timescale.js +4 -1
- package/dist/containers/riff/traversal.js +15 -7
- package/dist/containers/transport-stream/adts-header.js +10 -6
- package/dist/containers/transport-stream/boxes.js +2 -1
- package/dist/containers/transport-stream/discard-rest-of-packet.js +7 -2
- package/dist/containers/transport-stream/find-separator.js +4 -1
- package/dist/containers/transport-stream/get-tracks.js +16 -10
- package/dist/containers/transport-stream/handle-aac-packet.js +16 -12
- package/dist/containers/transport-stream/handle-avc-packet.js +26 -22
- package/dist/containers/transport-stream/next-pes-header-store.js +5 -1
- package/dist/containers/transport-stream/parse-packet.js +17 -13
- package/dist/containers/transport-stream/parse-pat.js +10 -5
- package/dist/containers/transport-stream/parse-pes.js +5 -1
- package/dist/containers/transport-stream/parse-pmt.js +7 -3
- package/dist/containers/transport-stream/parse-stream-packet.js +17 -13
- package/dist/containers/transport-stream/parse-transport-stream.js +9 -5
- package/dist/containers/transport-stream/process-stream-buffers.js +17 -12
- package/dist/containers/transport-stream/traversal.js +10 -4
- package/dist/containers/wav/get-duration-from-wav.js +8 -3
- package/dist/containers/wav/get-metadata-from-wav.js +5 -1
- package/dist/containers/wav/parse-data.js +9 -5
- package/dist/containers/wav/parse-fmt.js +7 -3
- package/dist/containers/wav/parse-header.js +5 -1
- package/dist/containers/wav/parse-id3.js +5 -1
- package/dist/containers/wav/parse-list.js +5 -1
- package/dist/containers/wav/parse-video-section.js +7 -3
- package/dist/containers/wav/parse-wav.js +19 -15
- package/dist/containers/wav/types.js +2 -1
- package/dist/containers/webm/allowed-partial-segments.js +4 -1
- package/dist/containers/webm/av1-codec-private.js +7 -3
- package/dist/containers/webm/color.js +10 -6
- package/dist/containers/webm/description.js +10 -6
- package/dist/containers/webm/get-ready-tracks.js +18 -13
- package/dist/containers/webm/get-sample-from-block.js +16 -12
- package/dist/containers/webm/make-track.js +48 -43
- package/dist/containers/webm/parse-ebml.js +19 -14
- package/dist/containers/webm/parse-webm-header.js +7 -3
- package/dist/containers/webm/segments/all-segments.js +173 -168
- package/dist/containers/webm/segments/block-simple-block-flags.js +8 -4
- package/dist/containers/webm/segments/track-entry.js +5 -1
- package/dist/containers/webm/segments.js +13 -9
- package/dist/containers/webm/traversal.js +67 -37
- package/dist/convert-audio-or-video-sample.js +5 -1
- package/dist/download-and-parse-media.js +14 -10
- package/dist/emit-available-info.js +38 -34
- package/dist/emitter.js +5 -1
- package/dist/errors.js +15 -6
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/worker.mjs +4 -5
- package/dist/fetch.js +17 -1
- package/dist/file-types/bmp.js +7 -3
- package/dist/file-types/detect-file-type.js +38 -24
- package/dist/file-types/index.js +26 -22
- package/dist/file-types/jpeg.js +9 -4
- package/dist/file-types/pdf.js +7 -3
- package/dist/file-types/png.js +9 -4
- package/dist/file-types/webp.js +7 -3
- package/dist/forward-controller.js +5 -1
- package/dist/get-audio-codec.js +38 -25
- package/dist/get-container.js +10 -5
- package/dist/get-dimensions.js +13 -8
- package/dist/get-duration.js +34 -27
- package/dist/get-fields-from-callbacks.js +5 -1
- package/dist/get-fps.js +34 -24
- package/dist/get-is-hdr.js +10 -5
- package/dist/get-keyframes.js +11 -6
- package/dist/get-location.js +9 -4
- package/dist/get-number-of-audio-channels.js +7 -2
- package/dist/get-sample-aspect-ratio.js +30 -17
- package/dist/get-sample-positions-from-lpcm.js +9 -5
- package/dist/get-sample-positions.js +5 -1
- package/dist/get-sample-rate.js +7 -2
- package/dist/get-tracks.js +40 -29
- package/dist/get-video-codec.js +34 -26
- package/dist/has-all-info.js +38 -33
- package/dist/index.js +47 -32
- package/dist/init-video.js +28 -24
- package/dist/internal-parse-media.js +39 -35
- package/dist/is-audio-structure.js +5 -1
- package/dist/log.js +12 -8
- package/dist/make-hvc1-codec-strings.js +5 -1
- package/dist/media-parser-controller.js +11 -7
- package/dist/metadata/get-metadata.js +22 -17
- package/dist/metadata/metadata-from-iso.js +17 -12
- package/dist/metadata/metadata-from-matroska.js +7 -3
- package/dist/metadata/metadata-from-riff.js +7 -3
- package/dist/node-writer.js +17 -1
- package/dist/node.js +17 -1
- package/dist/options.js +2 -1
- package/dist/parse-media-on-worker-entry.js +7 -3
- package/dist/parse-media.js +12 -8
- package/dist/parse-result.js +2 -1
- package/dist/pause-signal.js +5 -1
- package/dist/perform-seek.js +10 -6
- package/dist/readers/fetch/get-body-and-reader.js +5 -1
- package/dist/readers/fetch/resolve-url.js +5 -1
- package/dist/readers/from-fetch.js +21 -14
- package/dist/readers/from-node.js +23 -17
- package/dist/readers/from-web-file.js +13 -7
- package/dist/readers/reader.js +2 -1
- package/dist/readers/universal.js +16 -13
- package/dist/readers/web.js +12 -9
- package/dist/register-track.js +15 -9
- package/dist/remotion-license-acknowledge.js +8 -4
- package/dist/run-parse-iteration.js +25 -21
- package/dist/samples-from-moof.js +10 -6
- package/dist/skip.js +5 -1
- package/dist/state/aac-state.js +5 -1
- package/dist/state/can-skip-tracks.js +8 -3
- package/dist/state/emitted-fields.js +5 -1
- package/dist/state/flac-state.js +5 -1
- package/dist/state/has-tracks-section.js +7 -3
- package/dist/state/images.js +5 -1
- package/dist/state/iso-base-media/cached-sample-positions.js +13 -8
- package/dist/state/iso-base-media/iso-state.js +9 -5
- package/dist/state/iso-base-media/moov-box.js +5 -1
- package/dist/state/keyframes.js +5 -1
- package/dist/state/m3u-state.js +9 -5
- package/dist/state/may-skip-video-data.js +7 -3
- package/dist/state/mp3.js +5 -1
- package/dist/state/need-samples-for-fields.js +5 -1
- package/dist/state/parser-state.js +39 -35
- package/dist/state/riff.js +5 -1
- package/dist/state/sample-callbacks.js +12 -8
- package/dist/state/slow-duration-fps.js +5 -1
- package/dist/state/structure.js +5 -1
- package/dist/state/transport-stream.js +7 -3
- package/dist/state/video-section.js +5 -1
- package/dist/state/webm.js +9 -5
- package/dist/throttled-progress.js +5 -1
- package/dist/truthy.js +4 -1
- package/dist/universal.js +5 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +4 -1
- package/dist/web.js +5 -1
- package/dist/webcodec-sample-types.js +2 -1
- package/dist/worker/forward-controller.js +7 -3
- package/dist/worker/serialize-error.js +19 -14
- package/dist/worker/worker-types.js +2 -1
- package/dist/worker-server-entry.js +5 -3
- package/dist/worker-server.js +16 -12
- package/dist/worker-web-entry.js +5 -3
- package/dist/worker.d.ts +3 -2
- package/dist/worker.js +11 -2
- package/dist/worker.module.d.ts +4 -0
- package/dist/worker.module.js +16 -0
- package/dist/writers/node.js +23 -16
- package/dist/writers/writer.js +2 -1
- package/package.json +3 -3
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeTracksSectionState = void 0;
|
|
4
|
+
const log_1 = require("../log");
|
|
5
|
+
const makeTracksSectionState = (canSkipTracksState, src) => {
|
|
3
6
|
const tracks = [];
|
|
4
7
|
let doneWithTracks = false;
|
|
5
8
|
return {
|
|
@@ -9,7 +12,7 @@ export const makeTracksSectionState = (canSkipTracksState, src) => {
|
|
|
9
12
|
if (doneWithTracks) {
|
|
10
13
|
throw new Error('Error in Media Parser: Tracks have already been parsed');
|
|
11
14
|
}
|
|
12
|
-
Log.verbose(logLevel, 'All tracks have been parsed');
|
|
15
|
+
log_1.Log.verbose(logLevel, 'All tracks have been parsed');
|
|
13
16
|
doneWithTracks = true;
|
|
14
17
|
},
|
|
15
18
|
addTrack: (track) => {
|
|
@@ -31,3 +34,4 @@ export const makeTracksSectionState = (canSkipTracksState, src) => {
|
|
|
31
34
|
},
|
|
32
35
|
};
|
|
33
36
|
};
|
|
37
|
+
exports.makeTracksSectionState = makeTracksSectionState;
|
package/dist/state/images.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imagesState = void 0;
|
|
4
|
+
const imagesState = () => {
|
|
2
5
|
const images = [];
|
|
3
6
|
const addImage = (image) => {
|
|
4
7
|
images.push(image);
|
|
@@ -8,3 +11,4 @@ export const imagesState = () => {
|
|
|
8
11
|
addImage,
|
|
9
12
|
};
|
|
10
13
|
};
|
|
14
|
+
exports.imagesState = imagesState;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cachedSamplePositionsState = exports.calculateFlatSamples = void 0;
|
|
4
|
+
const get_sample_positions_from_track_1 = require("../../containers/iso-base-media/get-sample-positions-from-track");
|
|
5
|
+
const traversal_1 = require("../../containers/iso-base-media/traversal");
|
|
6
|
+
const get_tracks_1 = require("../../get-tracks");
|
|
7
|
+
const calculateFlatSamples = (state) => {
|
|
8
|
+
const tracks = (0, get_tracks_1.getTracks)(state);
|
|
6
9
|
const allTracks = [
|
|
7
10
|
...tracks.videoTracks,
|
|
8
11
|
...tracks.audioTracks,
|
|
@@ -10,9 +13,9 @@ export const calculateFlatSamples = (state) => {
|
|
|
10
13
|
];
|
|
11
14
|
const flatSamples = allTracks
|
|
12
15
|
.map((track) => {
|
|
13
|
-
const samplePositions = getSamplePositionsFromTrack({
|
|
16
|
+
const samplePositions = (0, get_sample_positions_from_track_1.getSamplePositionsFromTrack)({
|
|
14
17
|
trakBox: track.trakBox,
|
|
15
|
-
moofBoxes: getMoofBoxes(state.getIsoStructure().boxes),
|
|
18
|
+
moofBoxes: (0, traversal_1.getMoofBoxes)(state.getIsoStructure().boxes),
|
|
16
19
|
});
|
|
17
20
|
if (!samplePositions) {
|
|
18
21
|
throw new Error('No sample positions');
|
|
@@ -27,7 +30,8 @@ export const calculateFlatSamples = (state) => {
|
|
|
27
30
|
.flat(1);
|
|
28
31
|
return flatSamples;
|
|
29
32
|
};
|
|
30
|
-
|
|
33
|
+
exports.calculateFlatSamples = calculateFlatSamples;
|
|
34
|
+
const cachedSamplePositionsState = () => {
|
|
31
35
|
const cachedForMdatStar = {};
|
|
32
36
|
return {
|
|
33
37
|
getSamples: (mdatStart) => {
|
|
@@ -41,3 +45,4 @@ export const cachedSamplePositionsState = () => {
|
|
|
41
45
|
},
|
|
42
46
|
};
|
|
43
47
|
};
|
|
48
|
+
exports.cachedSamplePositionsState = cachedSamplePositionsState;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isoBaseMediaState = void 0;
|
|
4
|
+
const cached_sample_positions_1 = require("./cached-sample-positions");
|
|
5
|
+
const moov_box_1 = require("./moov-box");
|
|
6
|
+
const isoBaseMediaState = () => {
|
|
4
7
|
return {
|
|
5
|
-
flatSamples: cachedSamplePositionsState(),
|
|
6
|
-
moov: moovState(),
|
|
8
|
+
flatSamples: (0, cached_sample_positions_1.cachedSamplePositionsState)(),
|
|
9
|
+
moov: (0, moov_box_1.moovState)(),
|
|
7
10
|
};
|
|
8
11
|
};
|
|
12
|
+
exports.isoBaseMediaState = isoBaseMediaState;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.moovState = void 0;
|
|
4
|
+
const moovState = () => {
|
|
2
5
|
let moovBox = null;
|
|
3
6
|
return {
|
|
4
7
|
setMoovBox: (moov) => {
|
|
@@ -7,3 +10,4 @@ export const moovState = () => {
|
|
|
7
10
|
getMoovBox: () => moovBox,
|
|
8
11
|
};
|
|
9
12
|
};
|
|
13
|
+
exports.moovState = moovState;
|
package/dist/state/keyframes.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.keyframesState = void 0;
|
|
4
|
+
const keyframesState = () => {
|
|
2
5
|
const keyframes = [];
|
|
3
6
|
return {
|
|
4
7
|
addKeyframe: (keyframe) => {
|
|
@@ -9,3 +12,4 @@ export const keyframesState = () => {
|
|
|
9
12
|
},
|
|
10
13
|
};
|
|
11
14
|
};
|
|
15
|
+
exports.keyframesState = keyframesState;
|
package/dist/state/m3u-state.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.m3uState = void 0;
|
|
4
|
+
const sample_sorter_1 = require("../containers/m3u/sample-sorter");
|
|
5
|
+
const log_1 = require("../log");
|
|
6
|
+
const m3uState = (logLevel) => {
|
|
4
7
|
let selectedMainPlaylist = null;
|
|
5
8
|
let associatedPlaylists = null;
|
|
6
9
|
const hasEmittedVideoTrack = {};
|
|
@@ -103,7 +106,7 @@ export const m3uState = (logLevel) => {
|
|
|
103
106
|
if (values.length === 0) {
|
|
104
107
|
return;
|
|
105
108
|
}
|
|
106
|
-
Log.trace(logLevel, `Aborting ${values.length} M3U stream runs`);
|
|
109
|
+
log_1.Log.trace(logLevel, `Aborting ${values.length} M3U stream runs`);
|
|
107
110
|
values.forEach((run) => {
|
|
108
111
|
run.abort();
|
|
109
112
|
});
|
|
@@ -113,8 +116,9 @@ export const m3uState = (logLevel) => {
|
|
|
113
116
|
},
|
|
114
117
|
getAssociatedPlaylists: () => associatedPlaylists,
|
|
115
118
|
getSelectedPlaylists,
|
|
116
|
-
sampleSorter: sampleSorter({ logLevel, getAllChunksProcessedForPlaylist }),
|
|
119
|
+
sampleSorter: (0, sample_sorter_1.sampleSorter)({ logLevel, getAllChunksProcessedForPlaylist }),
|
|
117
120
|
setMp4HeaderSegment,
|
|
118
121
|
getMp4HeaderSegment,
|
|
119
122
|
};
|
|
120
123
|
};
|
|
124
|
+
exports.m3uState = m3uState;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maySkipVideoData = void 0;
|
|
4
|
+
const need_samples_for_fields_1 = require("./need-samples-for-fields");
|
|
5
|
+
const maySkipVideoData = ({ state }) => {
|
|
3
6
|
const hasAllTracksAndNoCallbacks = state.callbacks.tracks.hasAllTracks() &&
|
|
4
7
|
Object.values(state.callbacks.videoSampleCallbacks).length === 0 &&
|
|
5
8
|
Object.values(state.callbacks.audioSampleCallbacks).length === 0;
|
|
@@ -7,8 +10,9 @@ export const maySkipVideoData = ({ state }) => {
|
|
|
7
10
|
!state.callbacks.hasVideoTrackHandlers;
|
|
8
11
|
const noCallbacksNeeded = hasNoTrackHandlers || hasAllTracksAndNoCallbacks;
|
|
9
12
|
return (noCallbacksNeeded &&
|
|
10
|
-
!needsToIterateOverSamples({
|
|
13
|
+
!(0, need_samples_for_fields_1.needsToIterateOverSamples)({
|
|
11
14
|
emittedFields: state.emittedFields,
|
|
12
15
|
fields: state.fields,
|
|
13
16
|
}));
|
|
14
17
|
};
|
|
18
|
+
exports.maySkipVideoData = maySkipVideoData;
|
package/dist/state/mp3.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMp3State = void 0;
|
|
4
|
+
const makeMp3State = () => {
|
|
2
5
|
let mp3Info = null;
|
|
3
6
|
// cbr = constant bit rate
|
|
4
7
|
let cbrMp3Info = null;
|
|
@@ -13,3 +16,4 @@ export const makeMp3State = () => {
|
|
|
13
16
|
},
|
|
14
17
|
};
|
|
15
18
|
};
|
|
19
|
+
exports.makeMp3State = makeMp3State;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.needsToIterateOverSamples = void 0;
|
|
1
4
|
const needsSamples = {
|
|
2
5
|
slowDurationInSeconds: true,
|
|
3
6
|
slowFps: true,
|
|
@@ -28,8 +31,9 @@ const needsSamples = {
|
|
|
28
31
|
slowVideoBitrate: true,
|
|
29
32
|
m3uStreams: false,
|
|
30
33
|
};
|
|
31
|
-
|
|
34
|
+
const needsToIterateOverSamples = ({ fields, emittedFields, }) => {
|
|
32
35
|
const keys = Object.keys(fields !== null && fields !== void 0 ? fields : {});
|
|
33
36
|
const selectedKeys = keys.filter((k) => fields[k]);
|
|
34
37
|
return selectedKeys.some((k) => needsSamples[k] && !emittedFields[k]);
|
|
35
38
|
};
|
|
39
|
+
exports.needsToIterateOverSamples = needsToIterateOverSamples;
|
|
@@ -1,51 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeParserState = void 0;
|
|
4
|
+
const buffer_iterator_1 = require("../buffer-iterator");
|
|
5
|
+
const log_1 = require("../log");
|
|
6
|
+
const aac_state_1 = require("./aac-state");
|
|
7
|
+
const emitted_fields_1 = require("./emitted-fields");
|
|
8
|
+
const flac_state_1 = require("./flac-state");
|
|
9
|
+
const images_1 = require("./images");
|
|
10
|
+
const iso_state_1 = require("./iso-base-media/iso-state");
|
|
11
|
+
const keyframes_1 = require("./keyframes");
|
|
12
|
+
const m3u_state_1 = require("./m3u-state");
|
|
13
|
+
const mp3_1 = require("./mp3");
|
|
14
|
+
const riff_1 = require("./riff");
|
|
15
|
+
const sample_callbacks_1 = require("./sample-callbacks");
|
|
16
|
+
const slow_duration_fps_1 = require("./slow-duration-fps");
|
|
17
|
+
const structure_1 = require("./structure");
|
|
18
|
+
const transport_stream_1 = require("./transport-stream");
|
|
19
|
+
const video_section_1 = require("./video-section");
|
|
20
|
+
const webm_1 = require("./webm");
|
|
21
|
+
const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers, controller, fields, onAudioTrack, onVideoTrack, contentLength, logLevel, mode, src, readerInterface, onDiscardedData, selectM3uStreamFn, selectM3uAssociatedPlaylistsFn, mp4HeaderSegment, }) => {
|
|
19
22
|
let skippedBytes = 0;
|
|
20
|
-
const iterator = getArrayBufferIterator(new Uint8Array([]), contentLength);
|
|
23
|
+
const iterator = (0, buffer_iterator_1.getArrayBufferIterator)(new Uint8Array([]), contentLength);
|
|
21
24
|
const increaseSkippedBytes = (bytes) => {
|
|
22
25
|
skippedBytes += bytes;
|
|
23
26
|
};
|
|
24
|
-
const structure = structureState();
|
|
25
|
-
const keyframes = keyframesState();
|
|
26
|
-
const emittedFields = emittedState();
|
|
27
|
-
const slowDurationAndFps = slowDurationAndFpsState();
|
|
28
|
-
const mp3Info = makeMp3State();
|
|
29
|
-
const images = imagesState();
|
|
27
|
+
const structure = (0, structure_1.structureState)();
|
|
28
|
+
const keyframes = (0, keyframes_1.keyframesState)();
|
|
29
|
+
const emittedFields = (0, emitted_fields_1.emittedState)();
|
|
30
|
+
const slowDurationAndFps = (0, slow_duration_fps_1.slowDurationAndFpsState)();
|
|
31
|
+
const mp3Info = (0, mp3_1.makeMp3State)();
|
|
32
|
+
const images = (0, images_1.imagesState)();
|
|
30
33
|
const discardReadBytes = async (force) => {
|
|
31
34
|
const { bytesRemoved, removedData } = iterator.removeBytesRead(force, mode);
|
|
32
35
|
if (bytesRemoved) {
|
|
33
|
-
Log.verbose(logLevel, `Freed ${bytesRemoved} bytes`);
|
|
36
|
+
log_1.Log.verbose(logLevel, `Freed ${bytesRemoved} bytes`);
|
|
34
37
|
}
|
|
35
38
|
if (removedData && onDiscardedData) {
|
|
36
39
|
await onDiscardedData(removedData);
|
|
37
40
|
}
|
|
38
41
|
};
|
|
39
42
|
return {
|
|
40
|
-
riff: riffSpecificState(),
|
|
41
|
-
transportStream: transportStreamState(),
|
|
42
|
-
webm: webmState(),
|
|
43
|
-
iso: isoBaseMediaState(),
|
|
43
|
+
riff: (0, riff_1.riffSpecificState)(),
|
|
44
|
+
transportStream: (0, transport_stream_1.transportStreamState)(),
|
|
45
|
+
webm: (0, webm_1.webmState)(),
|
|
46
|
+
iso: (0, iso_state_1.isoBaseMediaState)(),
|
|
44
47
|
mp3Info,
|
|
45
|
-
aac: aacState(),
|
|
46
|
-
flac: flacState(),
|
|
47
|
-
m3u: m3uState(logLevel),
|
|
48
|
-
callbacks: sampleCallback({
|
|
48
|
+
aac: (0, aac_state_1.aacState)(),
|
|
49
|
+
flac: (0, flac_state_1.flacState)(),
|
|
50
|
+
m3u: (0, m3u_state_1.m3uState)(logLevel),
|
|
51
|
+
callbacks: (0, sample_callbacks_1.sampleCallback)({
|
|
49
52
|
controller,
|
|
50
53
|
hasAudioTrackHandlers,
|
|
51
54
|
hasVideoTrackHandlers,
|
|
@@ -74,7 +77,7 @@ export const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers,
|
|
|
74
77
|
slowDurationAndFps,
|
|
75
78
|
contentLength,
|
|
76
79
|
images,
|
|
77
|
-
videoSection: videoSectionState(),
|
|
80
|
+
videoSection: (0, video_section_1.videoSectionState)(),
|
|
78
81
|
logLevel,
|
|
79
82
|
iterator,
|
|
80
83
|
controller,
|
|
@@ -87,3 +90,4 @@ export const makeParserState = ({ hasAudioTrackHandlers, hasVideoTrackHandlers,
|
|
|
87
90
|
mp4HeaderSegment,
|
|
88
91
|
};
|
|
89
92
|
};
|
|
93
|
+
exports.makeParserState = makeParserState;
|
package/dist/state/riff.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.riffSpecificState = void 0;
|
|
4
|
+
const riffSpecificState = () => {
|
|
2
5
|
let avcProfile = null;
|
|
3
6
|
let nextTrackIndex = 0;
|
|
4
7
|
const profileCallbacks = [];
|
|
@@ -26,3 +29,4 @@ export const riffSpecificState = () => {
|
|
|
26
29
|
},
|
|
27
30
|
};
|
|
28
31
|
};
|
|
32
|
+
exports.riffSpecificState = riffSpecificState;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sampleCallback = void 0;
|
|
4
|
+
const can_skip_tracks_1 = require("./can-skip-tracks");
|
|
5
|
+
const has_tracks_section_1 = require("./has-tracks-section");
|
|
6
|
+
const need_samples_for_fields_1 = require("./need-samples-for-fields");
|
|
7
|
+
const sampleCallback = ({ controller, hasAudioTrackHandlers, hasVideoTrackHandlers, fields, keyframes, emittedFields, slowDurationAndFpsState, structure, src, }) => {
|
|
5
8
|
const videoSampleCallbacks = {};
|
|
6
9
|
const audioSampleCallbacks = {};
|
|
7
10
|
const queuedAudioSamples = {};
|
|
8
11
|
const queuedVideoSamples = {};
|
|
9
|
-
const canSkipTracksState = makeCanSkipTracksState({
|
|
12
|
+
const canSkipTracksState = (0, can_skip_tracks_1.makeCanSkipTracksState)({
|
|
10
13
|
hasAudioTrackHandlers,
|
|
11
14
|
fields,
|
|
12
15
|
hasVideoTrackHandlers,
|
|
13
16
|
structure,
|
|
14
17
|
});
|
|
15
|
-
const tracksState = makeTracksSectionState(canSkipTracksState, src);
|
|
18
|
+
const tracksState = (0, has_tracks_section_1.makeTracksSectionState)(canSkipTracksState, src);
|
|
16
19
|
const samplesForTrack = {};
|
|
17
20
|
return {
|
|
18
21
|
registerVideoSampleCallback: async (id, callback) => {
|
|
@@ -42,7 +45,7 @@ export const sampleCallback = ({ controller, hasAudioTrackHandlers, hasVideoTrac
|
|
|
42
45
|
await callback(audioSample);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
|
-
if (needsToIterateOverSamples({ emittedFields, fields })) {
|
|
48
|
+
if ((0, need_samples_for_fields_1.needsToIterateOverSamples)({ emittedFields, fields })) {
|
|
46
49
|
slowDurationAndFpsState.addAudioSample(audioSample);
|
|
47
50
|
}
|
|
48
51
|
},
|
|
@@ -65,7 +68,7 @@ export const sampleCallback = ({ controller, hasAudioTrackHandlers, hasVideoTrac
|
|
|
65
68
|
await callback(videoSample);
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
|
-
if (needsToIterateOverSamples({
|
|
71
|
+
if ((0, need_samples_for_fields_1.needsToIterateOverSamples)({
|
|
69
72
|
fields,
|
|
70
73
|
emittedFields,
|
|
71
74
|
})) {
|
|
@@ -101,3 +104,4 @@ export const sampleCallback = ({ controller, hasAudioTrackHandlers, hasVideoTrac
|
|
|
101
104
|
hasVideoTrackHandlers,
|
|
102
105
|
};
|
|
103
106
|
};
|
|
107
|
+
exports.sampleCallback = sampleCallback;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.slowDurationAndFpsState = void 0;
|
|
4
|
+
const slowDurationAndFpsState = () => {
|
|
2
5
|
let smallestVideoSample;
|
|
3
6
|
let largestVideoSample;
|
|
4
7
|
let smallestAudioSample;
|
|
@@ -82,3 +85,4 @@ export const slowDurationAndFpsState = () => {
|
|
|
82
85
|
},
|
|
83
86
|
};
|
|
84
87
|
};
|
|
88
|
+
exports.slowDurationAndFpsState = slowDurationAndFpsState;
|
package/dist/state/structure.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.structureState = void 0;
|
|
4
|
+
const structureState = () => {
|
|
2
5
|
let structure = null;
|
|
3
6
|
const getStructure = () => {
|
|
4
7
|
if (structure === null) {
|
|
@@ -72,3 +75,4 @@ export const structureState = () => {
|
|
|
72
75
|
},
|
|
73
76
|
};
|
|
74
77
|
};
|
|
78
|
+
exports.structureState = structureState;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transportStreamState = void 0;
|
|
4
|
+
const next_pes_header_store_1 = require("../containers/transport-stream/next-pes-header-store");
|
|
5
|
+
const transportStreamState = () => {
|
|
3
6
|
return {
|
|
4
|
-
nextPesHeaderStore: makeNextPesHeaderStore(),
|
|
7
|
+
nextPesHeaderStore: (0, next_pes_header_store_1.makeNextPesHeaderStore)(),
|
|
5
8
|
streamBuffers: new Map(),
|
|
6
9
|
};
|
|
7
10
|
};
|
|
11
|
+
exports.transportStreamState = transportStreamState;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Keeps track of in which section of the file the video is playing
|
|
3
4
|
* Usually this section is in a different format and it is the only section
|
|
4
5
|
* that can be read partially
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.videoSectionState = void 0;
|
|
9
|
+
const videoSectionState = () => {
|
|
7
10
|
let videoSection = null;
|
|
8
11
|
const setVideoSection = (section) => {
|
|
9
12
|
videoSection = section;
|
|
@@ -31,3 +34,4 @@ export const videoSectionState = () => {
|
|
|
31
34
|
isInVideoSectionState,
|
|
32
35
|
};
|
|
33
36
|
};
|
|
37
|
+
exports.videoSectionState = videoSectionState;
|
package/dist/state/webm.js
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webmState = void 0;
|
|
4
|
+
const traversal_1 = require("../containers/webm/traversal");
|
|
5
|
+
const webmState = () => {
|
|
3
6
|
const trackEntries = {};
|
|
4
7
|
const onTrackEntrySegment = (trackEntry) => {
|
|
5
8
|
var _a;
|
|
6
|
-
const trackId = getTrackId(trackEntry);
|
|
9
|
+
const trackId = (0, traversal_1.getTrackId)(trackEntry);
|
|
7
10
|
if (!trackId) {
|
|
8
11
|
throw new Error('Expected track id');
|
|
9
12
|
}
|
|
10
13
|
if (trackEntries[trackId]) {
|
|
11
14
|
return;
|
|
12
15
|
}
|
|
13
|
-
const codec = getTrackCodec(trackEntry);
|
|
16
|
+
const codec = (0, traversal_1.getTrackCodec)(trackEntry);
|
|
14
17
|
if (!codec) {
|
|
15
18
|
throw new Error('Expected codec');
|
|
16
19
|
}
|
|
17
|
-
const trackTimescale = getTrackTimestampScale(trackEntry);
|
|
20
|
+
const trackTimescale = (0, traversal_1.getTrackTimestampScale)(trackEntry);
|
|
18
21
|
trackEntries[trackId] = {
|
|
19
22
|
codec: codec.value,
|
|
20
23
|
trackTimescale: (_a = trackTimescale === null || trackTimescale === void 0 ? void 0 : trackTimescale.value) !== null && _a !== void 0 ? _a : null,
|
|
@@ -103,3 +106,4 @@ export const webmState = () => {
|
|
|
103
106
|
getAvcProfileForTrackNumber,
|
|
104
107
|
};
|
|
105
108
|
};
|
|
109
|
+
exports.webmState = webmState;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throttledStateUpdate = void 0;
|
|
4
|
+
const throttledStateUpdate = ({ updateFn, everyMilliseconds, controller, }) => {
|
|
2
5
|
let currentState = {
|
|
3
6
|
bytes: 0,
|
|
4
7
|
percentage: null,
|
|
@@ -49,3 +52,4 @@ export const throttledStateUpdate = ({ updateFn, everyMilliseconds, controller,
|
|
|
49
52
|
},
|
|
50
53
|
};
|
|
51
54
|
};
|
|
55
|
+
exports.throttledStateUpdate = throttledStateUpdate;
|
package/dist/truthy.js
CHANGED
package/dist/universal.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.universalReader = void 0;
|
|
4
|
+
var universal_1 = require("./readers/universal");
|
|
5
|
+
Object.defineProperty(exports, "universalReader", { enumerable: true, get: function () { return universal_1.universalReader; } });
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.278";
|
package/dist/version.js
CHANGED
package/dist/web.js
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.webReader = void 0;
|
|
4
|
+
var web_1 = require("./readers/web");
|
|
5
|
+
Object.defineProperty(exports, "webReader", { enumerable: true, get: function () { return web_1.webReader; } });
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.forwardMediaParserControllerToWorker = void 0;
|
|
4
|
+
const log_1 = require("../log");
|
|
5
|
+
const forwardMediaParserControllerToWorker = (controller) => {
|
|
3
6
|
return (message) => {
|
|
4
7
|
if (message.type === 'request-pause') {
|
|
5
8
|
controller.pause();
|
|
@@ -14,7 +17,8 @@ export const forwardMediaParserControllerToWorker = (controller) => {
|
|
|
14
17
|
return;
|
|
15
18
|
}
|
|
16
19
|
const msg = `Unknown message type: ${message.type}`;
|
|
17
|
-
Log.error(msg);
|
|
20
|
+
log_1.Log.error(msg);
|
|
18
21
|
throw new Error(msg);
|
|
19
22
|
};
|
|
20
23
|
};
|
|
24
|
+
exports.forwardMediaParserControllerToWorker = forwardMediaParserControllerToWorker;
|