@remotion/media-parser 4.0.305 → 4.0.306
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/containers/mp3/seek/audio-sample-from-cbr.js +4 -2
- package/dist/containers/mp3/seek/audio-sample-from-vbr.js +2 -2
- package/dist/containers/riff/parse-movi.js +1 -1
- package/dist/containers/riff/seek/fetch-idx1.d.ts +2 -1
- package/dist/containers/riff/seek/fetch-idx1.js +2 -2
- package/dist/esm/index.mjs +19 -13
- package/dist/esm/worker-server-entry.mjs +18 -12
- package/dist/esm/worker-web-entry.mjs +18 -12
- package/dist/state/defer-sample-release.d.ts +7 -0
- package/dist/state/defer-sample-release.js +23 -0
- package/dist/state/parser-state.js +1 -0
- package/dist/state/riff/lazy-idx1-fetch.d.ts +2 -1
- package/dist/state/riff/lazy-idx1-fetch.js +2 -1
- package/dist/state/riff.d.ts +2 -1
- package/dist/state/riff.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -18,8 +18,10 @@ const getAudioSampleFromCbr = ({ bitrateInKbit, initialOffset, layer, sampleRate
|
|
|
18
18
|
avgLength);
|
|
19
19
|
const durationInSeconds = samplesPerFrame / sampleRate;
|
|
20
20
|
const timeInSeconds = (nthFrame * samplesPerFrame) / sampleRate;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
// Important that we round down, otherwise WebCodecs might stall, e.g.
|
|
22
|
+
// Last input = 30570667 Last output = 30570666 -> stuck
|
|
23
|
+
const timestamp = Math.floor(timeInSeconds * webcodecs_timescale_1.WEBCODECS_TIMESCALE);
|
|
24
|
+
const duration = Math.floor(durationInSeconds * webcodecs_timescale_1.WEBCODECS_TIMESCALE);
|
|
23
25
|
const audioSample = {
|
|
24
26
|
data,
|
|
25
27
|
decodingTimestamp: timestamp,
|
|
@@ -30,8 +30,8 @@ const getAudioSampleFromVbr = ({ info, position, mp3Info, data, }) => {
|
|
|
30
30
|
tableOfContents: info.xingData.tableOfContents,
|
|
31
31
|
});
|
|
32
32
|
const durationInSeconds = samplesPerFrame / info.xingData.sampleRate;
|
|
33
|
-
const timestamp = Math.
|
|
34
|
-
const duration = Math.
|
|
33
|
+
const timestamp = Math.floor(timeInSeconds * webcodecs_timescale_1.WEBCODECS_TIMESCALE);
|
|
34
|
+
const duration = Math.floor(durationInSeconds * webcodecs_timescale_1.WEBCODECS_TIMESCALE);
|
|
35
35
|
const audioSample = {
|
|
36
36
|
data,
|
|
37
37
|
decodingTimestamp: timestamp,
|
|
@@ -86,7 +86,7 @@ const handleChunk = async ({ state, ckId, ckSize, }) => {
|
|
|
86
86
|
trackId,
|
|
87
87
|
});
|
|
88
88
|
const timeInSec = nthSample / samplesPerSecond;
|
|
89
|
-
const timestamp = Math.
|
|
89
|
+
const timestamp = Math.floor(timeInSec * webcodecs_timescale_1.WEBCODECS_TIMESCALE);
|
|
90
90
|
const data = iterator.getSlice(ckSize);
|
|
91
91
|
const audioSample = {
|
|
92
92
|
decodingTimestamp: timestamp,
|
|
@@ -3,13 +3,14 @@ import type { PrefetchCache } from '../../../fetch';
|
|
|
3
3
|
import { type MediaParserLogLevel } from '../../../log';
|
|
4
4
|
import type { ParseMediaSrc } from '../../../options';
|
|
5
5
|
import type { MediaParserReaderInterface } from '../../../readers/reader';
|
|
6
|
-
export declare const fetchIdx1: ({ src, readerInterface, controller, position, logLevel, prefetchCache, }: {
|
|
6
|
+
export declare const fetchIdx1: ({ src, readerInterface, controller, position, logLevel, prefetchCache, contentLength, }: {
|
|
7
7
|
src: ParseMediaSrc;
|
|
8
8
|
readerInterface: MediaParserReaderInterface;
|
|
9
9
|
controller: MediaParserController;
|
|
10
10
|
position: number;
|
|
11
11
|
logLevel: MediaParserLogLevel;
|
|
12
12
|
prefetchCache: PrefetchCache;
|
|
13
|
+
contentLength: number;
|
|
13
14
|
}) => Promise<{
|
|
14
15
|
entries: import("../riff-box").Idx1Entry[];
|
|
15
16
|
videoTrackIndex: number | null;
|
|
@@ -4,7 +4,7 @@ exports.fetchIdx1 = void 0;
|
|
|
4
4
|
const buffer_iterator_1 = require("../../../iterator/buffer-iterator");
|
|
5
5
|
const log_1 = require("../../../log");
|
|
6
6
|
const expect_riff_box_1 = require("../expect-riff-box");
|
|
7
|
-
const fetchIdx1 = async ({ src, readerInterface, controller, position, logLevel, prefetchCache, }) => {
|
|
7
|
+
const fetchIdx1 = async ({ src, readerInterface, controller, position, logLevel, prefetchCache, contentLength, }) => {
|
|
8
8
|
log_1.Log.verbose(logLevel, 'Making request to fetch idx1 from ', src, 'position', position);
|
|
9
9
|
const result = await readerInterface.read({
|
|
10
10
|
controller,
|
|
@@ -16,7 +16,7 @@ const fetchIdx1 = async ({ src, readerInterface, controller, position, logLevel,
|
|
|
16
16
|
if (result.contentLength === null) {
|
|
17
17
|
throw new Error('Content length is null');
|
|
18
18
|
}
|
|
19
|
-
const iterator = (0, buffer_iterator_1.getArrayBufferIterator)(new Uint8Array(),
|
|
19
|
+
const iterator = (0, buffer_iterator_1.getArrayBufferIterator)(new Uint8Array(), contentLength - position + 1);
|
|
20
20
|
while (true) {
|
|
21
21
|
const res = await result.reader.reader.read();
|
|
22
22
|
if (res.value) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -13251,8 +13251,8 @@ var getAudioSampleFromCbr = ({
|
|
|
13251
13251
|
const nthFrame = Math.round((initialOffset - state.mediaSection.getMediaSectionAssertOnlyOne().start) / avgLength);
|
|
13252
13252
|
const durationInSeconds = samplesPerFrame / sampleRate;
|
|
13253
13253
|
const timeInSeconds = nthFrame * samplesPerFrame / sampleRate;
|
|
13254
|
-
const timestamp = Math.
|
|
13255
|
-
const duration2 = Math.
|
|
13254
|
+
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
|
|
13255
|
+
const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
|
|
13256
13256
|
const audioSample = {
|
|
13257
13257
|
data,
|
|
13258
13258
|
decodingTimestamp: timestamp,
|
|
@@ -13295,8 +13295,8 @@ var getAudioSampleFromVbr = ({
|
|
|
13295
13295
|
tableOfContents: info.xingData.tableOfContents
|
|
13296
13296
|
});
|
|
13297
13297
|
const durationInSeconds = samplesPerFrame / info.xingData.sampleRate;
|
|
13298
|
-
const timestamp = Math.
|
|
13299
|
-
const duration2 = Math.
|
|
13298
|
+
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
|
|
13299
|
+
const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
|
|
13300
13300
|
const audioSample = {
|
|
13301
13301
|
data,
|
|
13302
13302
|
decodingTimestamp: timestamp,
|
|
@@ -14007,7 +14007,7 @@ var handleChunk = async ({
|
|
|
14007
14007
|
trackId
|
|
14008
14008
|
});
|
|
14009
14009
|
const timeInSec = nthSample / samplesPerSecond;
|
|
14010
|
-
const timestamp = Math.
|
|
14010
|
+
const timestamp = Math.floor(timeInSec * WEBCODECS_TIMESCALE);
|
|
14011
14011
|
const data = iterator.getSlice(ckSize);
|
|
14012
14012
|
const audioSample = {
|
|
14013
14013
|
decodingTimestamp: timestamp,
|
|
@@ -16688,7 +16688,8 @@ var fetchIdx1 = async ({
|
|
|
16688
16688
|
controller,
|
|
16689
16689
|
position,
|
|
16690
16690
|
logLevel,
|
|
16691
|
-
prefetchCache
|
|
16691
|
+
prefetchCache,
|
|
16692
|
+
contentLength
|
|
16692
16693
|
}) => {
|
|
16693
16694
|
Log.verbose(logLevel, "Making request to fetch idx1 from ", src, "position", position);
|
|
16694
16695
|
const result = await readerInterface.read({
|
|
@@ -16701,7 +16702,7 @@ var fetchIdx1 = async ({
|
|
|
16701
16702
|
if (result.contentLength === null) {
|
|
16702
16703
|
throw new Error("Content length is null");
|
|
16703
16704
|
}
|
|
16704
|
-
const iterator = getArrayBufferIterator(new Uint8Array,
|
|
16705
|
+
const iterator = getArrayBufferIterator(new Uint8Array, contentLength - position + 1);
|
|
16705
16706
|
while (true) {
|
|
16706
16707
|
const res = await result.reader.reader.read();
|
|
16707
16708
|
if (res.value) {
|
|
@@ -16731,7 +16732,8 @@ var lazyIdx1Fetch = ({
|
|
|
16731
16732
|
logLevel,
|
|
16732
16733
|
readerInterface,
|
|
16733
16734
|
src,
|
|
16734
|
-
prefetchCache
|
|
16735
|
+
prefetchCache,
|
|
16736
|
+
contentLength
|
|
16735
16737
|
}) => {
|
|
16736
16738
|
let prom = null;
|
|
16737
16739
|
let result = null;
|
|
@@ -16748,7 +16750,8 @@ var lazyIdx1Fetch = ({
|
|
|
16748
16750
|
position,
|
|
16749
16751
|
readerInterface,
|
|
16750
16752
|
src,
|
|
16751
|
-
prefetchCache
|
|
16753
|
+
prefetchCache,
|
|
16754
|
+
contentLength
|
|
16752
16755
|
}).then((entries) => {
|
|
16753
16756
|
prom = null;
|
|
16754
16757
|
result = entries;
|
|
@@ -16944,7 +16947,8 @@ var riffSpecificState = ({
|
|
|
16944
16947
|
logLevel,
|
|
16945
16948
|
readerInterface,
|
|
16946
16949
|
src,
|
|
16947
|
-
prefetchCache
|
|
16950
|
+
prefetchCache,
|
|
16951
|
+
contentLength
|
|
16948
16952
|
}) => {
|
|
16949
16953
|
let avcProfile = null;
|
|
16950
16954
|
let nextTrackIndex = 0;
|
|
@@ -16964,7 +16968,8 @@ var riffSpecificState = ({
|
|
|
16964
16968
|
logLevel,
|
|
16965
16969
|
readerInterface,
|
|
16966
16970
|
src,
|
|
16967
|
-
prefetchCache
|
|
16971
|
+
prefetchCache,
|
|
16972
|
+
contentLength
|
|
16968
16973
|
});
|
|
16969
16974
|
const sampleCounter = riffSampleCounter();
|
|
16970
16975
|
const queuedBFrames = queuedBFramesState();
|
|
@@ -17345,7 +17350,8 @@ var makeParserState = ({
|
|
|
17345
17350
|
logLevel,
|
|
17346
17351
|
readerInterface,
|
|
17347
17352
|
src,
|
|
17348
|
-
prefetchCache
|
|
17353
|
+
prefetchCache,
|
|
17354
|
+
contentLength
|
|
17349
17355
|
}),
|
|
17350
17356
|
transportStream: transportStreamState(),
|
|
17351
17357
|
webm: webmState({
|
|
@@ -17679,7 +17685,7 @@ var downloadAndParseMedia = async (options) => {
|
|
|
17679
17685
|
return returnValue;
|
|
17680
17686
|
};
|
|
17681
17687
|
// src/version.ts
|
|
17682
|
-
var VERSION = "4.0.
|
|
17688
|
+
var VERSION = "4.0.306";
|
|
17683
17689
|
|
|
17684
17690
|
// src/index.ts
|
|
17685
17691
|
var MediaParserInternals = {
|
|
@@ -12990,8 +12990,8 @@ var getAudioSampleFromCbr = ({
|
|
|
12990
12990
|
const nthFrame = Math.round((initialOffset - state.mediaSection.getMediaSectionAssertOnlyOne().start) / avgLength);
|
|
12991
12991
|
const durationInSeconds = samplesPerFrame / sampleRate;
|
|
12992
12992
|
const timeInSeconds = nthFrame * samplesPerFrame / sampleRate;
|
|
12993
|
-
const timestamp = Math.
|
|
12994
|
-
const duration2 = Math.
|
|
12993
|
+
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
|
|
12994
|
+
const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
|
|
12995
12995
|
const audioSample = {
|
|
12996
12996
|
data,
|
|
12997
12997
|
decodingTimestamp: timestamp,
|
|
@@ -13034,8 +13034,8 @@ var getAudioSampleFromVbr = ({
|
|
|
13034
13034
|
tableOfContents: info.xingData.tableOfContents
|
|
13035
13035
|
});
|
|
13036
13036
|
const durationInSeconds = samplesPerFrame / info.xingData.sampleRate;
|
|
13037
|
-
const timestamp = Math.
|
|
13038
|
-
const duration2 = Math.
|
|
13037
|
+
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
|
|
13038
|
+
const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
|
|
13039
13039
|
const audioSample = {
|
|
13040
13040
|
data,
|
|
13041
13041
|
decodingTimestamp: timestamp,
|
|
@@ -13746,7 +13746,7 @@ var handleChunk = async ({
|
|
|
13746
13746
|
trackId
|
|
13747
13747
|
});
|
|
13748
13748
|
const timeInSec = nthSample / samplesPerSecond;
|
|
13749
|
-
const timestamp = Math.
|
|
13749
|
+
const timestamp = Math.floor(timeInSec * WEBCODECS_TIMESCALE);
|
|
13750
13750
|
const data = iterator.getSlice(ckSize);
|
|
13751
13751
|
const audioSample = {
|
|
13752
13752
|
decodingTimestamp: timestamp,
|
|
@@ -16816,7 +16816,8 @@ var fetchIdx1 = async ({
|
|
|
16816
16816
|
controller,
|
|
16817
16817
|
position,
|
|
16818
16818
|
logLevel,
|
|
16819
|
-
prefetchCache
|
|
16819
|
+
prefetchCache,
|
|
16820
|
+
contentLength
|
|
16820
16821
|
}) => {
|
|
16821
16822
|
Log.verbose(logLevel, "Making request to fetch idx1 from ", src, "position", position);
|
|
16822
16823
|
const result = await readerInterface.read({
|
|
@@ -16829,7 +16830,7 @@ var fetchIdx1 = async ({
|
|
|
16829
16830
|
if (result.contentLength === null) {
|
|
16830
16831
|
throw new Error("Content length is null");
|
|
16831
16832
|
}
|
|
16832
|
-
const iterator = getArrayBufferIterator(new Uint8Array,
|
|
16833
|
+
const iterator = getArrayBufferIterator(new Uint8Array, contentLength - position + 1);
|
|
16833
16834
|
while (true) {
|
|
16834
16835
|
const res = await result.reader.reader.read();
|
|
16835
16836
|
if (res.value) {
|
|
@@ -16859,7 +16860,8 @@ var lazyIdx1Fetch = ({
|
|
|
16859
16860
|
logLevel,
|
|
16860
16861
|
readerInterface,
|
|
16861
16862
|
src,
|
|
16862
|
-
prefetchCache
|
|
16863
|
+
prefetchCache,
|
|
16864
|
+
contentLength
|
|
16863
16865
|
}) => {
|
|
16864
16866
|
let prom = null;
|
|
16865
16867
|
let result = null;
|
|
@@ -16876,7 +16878,8 @@ var lazyIdx1Fetch = ({
|
|
|
16876
16878
|
position,
|
|
16877
16879
|
readerInterface,
|
|
16878
16880
|
src,
|
|
16879
|
-
prefetchCache
|
|
16881
|
+
prefetchCache,
|
|
16882
|
+
contentLength
|
|
16880
16883
|
}).then((entries) => {
|
|
16881
16884
|
prom = null;
|
|
16882
16885
|
result = entries;
|
|
@@ -17072,7 +17075,8 @@ var riffSpecificState = ({
|
|
|
17072
17075
|
logLevel,
|
|
17073
17076
|
readerInterface,
|
|
17074
17077
|
src,
|
|
17075
|
-
prefetchCache
|
|
17078
|
+
prefetchCache,
|
|
17079
|
+
contentLength
|
|
17076
17080
|
}) => {
|
|
17077
17081
|
let avcProfile = null;
|
|
17078
17082
|
let nextTrackIndex = 0;
|
|
@@ -17092,7 +17096,8 @@ var riffSpecificState = ({
|
|
|
17092
17096
|
logLevel,
|
|
17093
17097
|
readerInterface,
|
|
17094
17098
|
src,
|
|
17095
|
-
prefetchCache
|
|
17099
|
+
prefetchCache,
|
|
17100
|
+
contentLength
|
|
17096
17101
|
});
|
|
17097
17102
|
const sampleCounter = riffSampleCounter();
|
|
17098
17103
|
const queuedBFrames = queuedBFramesState();
|
|
@@ -17473,7 +17478,8 @@ var makeParserState = ({
|
|
|
17473
17478
|
logLevel,
|
|
17474
17479
|
readerInterface,
|
|
17475
17480
|
src,
|
|
17476
|
-
prefetchCache
|
|
17481
|
+
prefetchCache,
|
|
17482
|
+
contentLength
|
|
17477
17483
|
}),
|
|
17478
17484
|
transportStream: transportStreamState(),
|
|
17479
17485
|
webm: webmState({
|
|
@@ -12859,8 +12859,8 @@ var getAudioSampleFromCbr = ({
|
|
|
12859
12859
|
const nthFrame = Math.round((initialOffset - state.mediaSection.getMediaSectionAssertOnlyOne().start) / avgLength);
|
|
12860
12860
|
const durationInSeconds = samplesPerFrame / sampleRate;
|
|
12861
12861
|
const timeInSeconds = nthFrame * samplesPerFrame / sampleRate;
|
|
12862
|
-
const timestamp = Math.
|
|
12863
|
-
const duration2 = Math.
|
|
12862
|
+
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
|
|
12863
|
+
const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
|
|
12864
12864
|
const audioSample = {
|
|
12865
12865
|
data,
|
|
12866
12866
|
decodingTimestamp: timestamp,
|
|
@@ -12903,8 +12903,8 @@ var getAudioSampleFromVbr = ({
|
|
|
12903
12903
|
tableOfContents: info.xingData.tableOfContents
|
|
12904
12904
|
});
|
|
12905
12905
|
const durationInSeconds = samplesPerFrame / info.xingData.sampleRate;
|
|
12906
|
-
const timestamp = Math.
|
|
12907
|
-
const duration2 = Math.
|
|
12906
|
+
const timestamp = Math.floor(timeInSeconds * WEBCODECS_TIMESCALE);
|
|
12907
|
+
const duration2 = Math.floor(durationInSeconds * WEBCODECS_TIMESCALE);
|
|
12908
12908
|
const audioSample = {
|
|
12909
12909
|
data,
|
|
12910
12910
|
decodingTimestamp: timestamp,
|
|
@@ -13615,7 +13615,7 @@ var handleChunk = async ({
|
|
|
13615
13615
|
trackId
|
|
13616
13616
|
});
|
|
13617
13617
|
const timeInSec = nthSample / samplesPerSecond;
|
|
13618
|
-
const timestamp = Math.
|
|
13618
|
+
const timestamp = Math.floor(timeInSec * WEBCODECS_TIMESCALE);
|
|
13619
13619
|
const data = iterator.getSlice(ckSize);
|
|
13620
13620
|
const audioSample = {
|
|
13621
13621
|
decodingTimestamp: timestamp,
|
|
@@ -16685,7 +16685,8 @@ var fetchIdx1 = async ({
|
|
|
16685
16685
|
controller,
|
|
16686
16686
|
position,
|
|
16687
16687
|
logLevel,
|
|
16688
|
-
prefetchCache
|
|
16688
|
+
prefetchCache,
|
|
16689
|
+
contentLength
|
|
16689
16690
|
}) => {
|
|
16690
16691
|
Log.verbose(logLevel, "Making request to fetch idx1 from ", src, "position", position);
|
|
16691
16692
|
const result = await readerInterface.read({
|
|
@@ -16698,7 +16699,7 @@ var fetchIdx1 = async ({
|
|
|
16698
16699
|
if (result.contentLength === null) {
|
|
16699
16700
|
throw new Error("Content length is null");
|
|
16700
16701
|
}
|
|
16701
|
-
const iterator = getArrayBufferIterator(new Uint8Array,
|
|
16702
|
+
const iterator = getArrayBufferIterator(new Uint8Array, contentLength - position + 1);
|
|
16702
16703
|
while (true) {
|
|
16703
16704
|
const res = await result.reader.reader.read();
|
|
16704
16705
|
if (res.value) {
|
|
@@ -16728,7 +16729,8 @@ var lazyIdx1Fetch = ({
|
|
|
16728
16729
|
logLevel,
|
|
16729
16730
|
readerInterface,
|
|
16730
16731
|
src,
|
|
16731
|
-
prefetchCache
|
|
16732
|
+
prefetchCache,
|
|
16733
|
+
contentLength
|
|
16732
16734
|
}) => {
|
|
16733
16735
|
let prom = null;
|
|
16734
16736
|
let result = null;
|
|
@@ -16745,7 +16747,8 @@ var lazyIdx1Fetch = ({
|
|
|
16745
16747
|
position,
|
|
16746
16748
|
readerInterface,
|
|
16747
16749
|
src,
|
|
16748
|
-
prefetchCache
|
|
16750
|
+
prefetchCache,
|
|
16751
|
+
contentLength
|
|
16749
16752
|
}).then((entries) => {
|
|
16750
16753
|
prom = null;
|
|
16751
16754
|
result = entries;
|
|
@@ -16941,7 +16944,8 @@ var riffSpecificState = ({
|
|
|
16941
16944
|
logLevel,
|
|
16942
16945
|
readerInterface,
|
|
16943
16946
|
src,
|
|
16944
|
-
prefetchCache
|
|
16947
|
+
prefetchCache,
|
|
16948
|
+
contentLength
|
|
16945
16949
|
}) => {
|
|
16946
16950
|
let avcProfile = null;
|
|
16947
16951
|
let nextTrackIndex = 0;
|
|
@@ -16961,7 +16965,8 @@ var riffSpecificState = ({
|
|
|
16961
16965
|
logLevel,
|
|
16962
16966
|
readerInterface,
|
|
16963
16967
|
src,
|
|
16964
|
-
prefetchCache
|
|
16968
|
+
prefetchCache,
|
|
16969
|
+
contentLength
|
|
16965
16970
|
});
|
|
16966
16971
|
const sampleCounter = riffSampleCounter();
|
|
16967
16972
|
const queuedBFrames = queuedBFramesState();
|
|
@@ -17342,7 +17347,8 @@ var makeParserState = ({
|
|
|
17342
17347
|
logLevel,
|
|
17343
17348
|
readerInterface,
|
|
17344
17349
|
src,
|
|
17345
|
-
prefetchCache
|
|
17350
|
+
prefetchCache,
|
|
17351
|
+
contentLength
|
|
17346
17352
|
}),
|
|
17347
17353
|
transportStream: transportStreamState(),
|
|
17348
17354
|
webm: webmState({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MediaParserOnVideoSample, MediaParserVideoSample } from '../webcodec-sample-types';
|
|
2
|
+
export declare function deferSampleReleaseCallback(callback: MediaParserOnVideoSample): {
|
|
3
|
+
addSample: (sample: MediaParserVideoSample) => Promise<void>;
|
|
4
|
+
flush: () => Promise<void>;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type DeferredSampleRelease = ReturnType<typeof deferSampleReleaseCallback>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deferSampleReleaseCallback = deferSampleReleaseCallback;
|
|
4
|
+
function deferSampleReleaseCallback(callback) {
|
|
5
|
+
let hold = null;
|
|
6
|
+
return {
|
|
7
|
+
addSample: async (sample) => {
|
|
8
|
+
if (hold) {
|
|
9
|
+
await callback(hold);
|
|
10
|
+
}
|
|
11
|
+
hold = sample;
|
|
12
|
+
},
|
|
13
|
+
flush: async () => {
|
|
14
|
+
if (hold) {
|
|
15
|
+
await callback({ ...hold, isLast: true });
|
|
16
|
+
hold = null;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
clear: () => {
|
|
20
|
+
hold = null;
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -4,12 +4,13 @@ import type { PrefetchCache } from '../../fetch';
|
|
|
4
4
|
import type { MediaParserLogLevel } from '../../log';
|
|
5
5
|
import type { ParseMediaSrc } from '../../options';
|
|
6
6
|
import type { MediaParserReaderInterface } from '../../readers/reader';
|
|
7
|
-
export declare const lazyIdx1Fetch: ({ controller, logLevel, readerInterface, src, prefetchCache, }: {
|
|
7
|
+
export declare const lazyIdx1Fetch: ({ controller, logLevel, readerInterface, src, prefetchCache, contentLength, }: {
|
|
8
8
|
controller: MediaParserController;
|
|
9
9
|
logLevel: MediaParserLogLevel;
|
|
10
10
|
readerInterface: MediaParserReaderInterface;
|
|
11
11
|
src: ParseMediaSrc;
|
|
12
12
|
prefetchCache: PrefetchCache;
|
|
13
|
+
contentLength: number;
|
|
13
14
|
}) => {
|
|
14
15
|
triggerLoad: (position: number) => Promise<{
|
|
15
16
|
entries: import("../../containers/riff/riff-box").Idx1Entry[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lazyIdx1Fetch = void 0;
|
|
4
4
|
const fetch_idx1_1 = require("../../containers/riff/seek/fetch-idx1");
|
|
5
|
-
const lazyIdx1Fetch = ({ controller, logLevel, readerInterface, src, prefetchCache, }) => {
|
|
5
|
+
const lazyIdx1Fetch = ({ controller, logLevel, readerInterface, src, prefetchCache, contentLength, }) => {
|
|
6
6
|
let prom = null;
|
|
7
7
|
let result = null;
|
|
8
8
|
const triggerLoad = (position) => {
|
|
@@ -19,6 +19,7 @@ const lazyIdx1Fetch = ({ controller, logLevel, readerInterface, src, prefetchCac
|
|
|
19
19
|
readerInterface,
|
|
20
20
|
src,
|
|
21
21
|
prefetchCache,
|
|
22
|
+
contentLength,
|
|
22
23
|
}).then((entries) => {
|
|
23
24
|
prom = null;
|
|
24
25
|
result = entries;
|
package/dist/state/riff.d.ts
CHANGED
|
@@ -5,12 +5,13 @@ import type { ParseMediaSrc } from '../options';
|
|
|
5
5
|
import type { MediaParserReaderInterface } from '../readers/reader';
|
|
6
6
|
import type { SpsAndPps } from './parser-state';
|
|
7
7
|
type AvcProfileInfoCallback = (profile: SpsAndPps) => Promise<void>;
|
|
8
|
-
export declare const riffSpecificState: ({ controller, logLevel, readerInterface, src, prefetchCache, }: {
|
|
8
|
+
export declare const riffSpecificState: ({ controller, logLevel, readerInterface, src, prefetchCache, contentLength, }: {
|
|
9
9
|
controller: MediaParserController;
|
|
10
10
|
logLevel: MediaParserLogLevel;
|
|
11
11
|
readerInterface: MediaParserReaderInterface;
|
|
12
12
|
src: ParseMediaSrc;
|
|
13
13
|
prefetchCache: PrefetchCache;
|
|
14
|
+
contentLength: number;
|
|
14
15
|
}) => {
|
|
15
16
|
getAvcProfile: () => SpsAndPps | null;
|
|
16
17
|
onProfile: (profile: SpsAndPps) => Promise<void>;
|
package/dist/state/riff.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.riffSpecificState = void 0;
|
|
|
4
4
|
const lazy_idx1_fetch_1 = require("./riff/lazy-idx1-fetch");
|
|
5
5
|
const queued_frames_1 = require("./riff/queued-frames");
|
|
6
6
|
const sample_counter_1 = require("./riff/sample-counter");
|
|
7
|
-
const riffSpecificState = ({ controller, logLevel, readerInterface, src, prefetchCache, }) => {
|
|
7
|
+
const riffSpecificState = ({ controller, logLevel, readerInterface, src, prefetchCache, contentLength, }) => {
|
|
8
8
|
let avcProfile = null;
|
|
9
9
|
let nextTrackIndex = 0;
|
|
10
10
|
const profileCallbacks = [];
|
|
@@ -24,6 +24,7 @@ const riffSpecificState = ({ controller, logLevel, readerInterface, src, prefetc
|
|
|
24
24
|
readerInterface,
|
|
25
25
|
src,
|
|
26
26
|
prefetchCache,
|
|
27
|
+
contentLength,
|
|
27
28
|
});
|
|
28
29
|
const sampleCounter = (0, sample_counter_1.riffSampleCounter)();
|
|
29
30
|
const queuedBFrames = (0, queued_frames_1.queuedBFramesState)();
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.306";
|
package/dist/version.js
CHANGED
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.306",
|
|
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.306",
|
|
14
|
+
"@remotion/eslint-config-internal": "4.0.306"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|