@remotion/studio 4.0.331 → 4.0.333
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/.turbo/turbo-make.log +2 -2
- package/dist/esm/chunk-1g0vys7t.js +46593 -0
- package/dist/esm/chunk-kssm9t8x.js +46596 -0
- package/dist/esm/internals.mjs +105 -46
- package/dist/esm/previewEntry.mjs +105 -46
- package/dist/esm/renderEntry.mjs +1 -1
- package/package.json +10 -10
- package/tsconfig.tsbuildinfo +1 -1
package/dist/esm/internals.mjs
CHANGED
|
@@ -24055,6 +24055,17 @@ var getAvccBox = (trakBox) => {
|
|
|
24055
24055
|
}
|
|
24056
24056
|
return avccBox;
|
|
24057
24057
|
};
|
|
24058
|
+
var getVpccBox = (trakBox) => {
|
|
24059
|
+
const videoConfig = getStsdVideoConfig(trakBox);
|
|
24060
|
+
if (!videoConfig) {
|
|
24061
|
+
return null;
|
|
24062
|
+
}
|
|
24063
|
+
const vpccBox = videoConfig.descriptors.find((c) => c.type === "vpcc-box");
|
|
24064
|
+
if (!vpccBox || vpccBox.type !== "vpcc-box") {
|
|
24065
|
+
return null;
|
|
24066
|
+
}
|
|
24067
|
+
return vpccBox;
|
|
24068
|
+
};
|
|
24058
24069
|
var getAv1CBox = (trakBox) => {
|
|
24059
24070
|
const videoConfig = getStsdVideoConfig(trakBox);
|
|
24060
24071
|
if (!videoConfig) {
|
|
@@ -24210,21 +24221,25 @@ var getIsoBmColrConfig = (trakBox) => {
|
|
|
24210
24221
|
var getVideoCodecString = (trakBox) => {
|
|
24211
24222
|
const videoSample = getStsdVideoConfig(trakBox);
|
|
24212
24223
|
const avccBox = getAvccBox(trakBox);
|
|
24213
|
-
const hvccBox = getHvccBox(trakBox);
|
|
24214
|
-
const av1cBox = getAv1CBox(trakBox);
|
|
24215
24224
|
if (!videoSample) {
|
|
24216
24225
|
return null;
|
|
24217
24226
|
}
|
|
24218
24227
|
if (avccBox) {
|
|
24219
24228
|
return `${videoSample.format}.${avccBox.configurationString}`;
|
|
24220
24229
|
}
|
|
24230
|
+
const hvccBox = getHvccBox(trakBox);
|
|
24221
24231
|
if (hvccBox) {
|
|
24222
24232
|
return `${videoSample.format}.${hvccBox.configurationString}`;
|
|
24223
24233
|
}
|
|
24234
|
+
const av1cBox = getAv1CBox(trakBox);
|
|
24224
24235
|
if (av1cBox) {
|
|
24225
24236
|
const colrAtom = getColrBox(videoSample);
|
|
24226
24237
|
return parseAv1PrivateData(av1cBox.privateData, colrAtom);
|
|
24227
24238
|
}
|
|
24239
|
+
const vpccBox = getVpccBox(trakBox);
|
|
24240
|
+
if (vpccBox) {
|
|
24241
|
+
return `${videoSample.format}.${vpccBox.codecString}`;
|
|
24242
|
+
}
|
|
24228
24243
|
return videoSample.format;
|
|
24229
24244
|
};
|
|
24230
24245
|
var normalizeVideoRotation = (rotation) => {
|
|
@@ -24274,6 +24289,9 @@ var getVideoCodecFromIsoTrak = (trakBox) => {
|
|
|
24274
24289
|
if (videoSample.format === "av01") {
|
|
24275
24290
|
return "av1";
|
|
24276
24291
|
}
|
|
24292
|
+
if (videoSample.format === "vp09") {
|
|
24293
|
+
return "vp9";
|
|
24294
|
+
}
|
|
24277
24295
|
if (videoSample.format === "ap4h") {
|
|
24278
24296
|
return "prores";
|
|
24279
24297
|
}
|
|
@@ -25206,6 +25224,51 @@ var parseStts = ({
|
|
|
25206
25224
|
sampleDistribution: sampleDistributions
|
|
25207
25225
|
};
|
|
25208
25226
|
};
|
|
25227
|
+
var getvp09ConfigurationString = ({
|
|
25228
|
+
profile,
|
|
25229
|
+
level,
|
|
25230
|
+
bitDepth: bitDepth2
|
|
25231
|
+
}) => {
|
|
25232
|
+
return `${String(profile).padStart(2, "0")}.${String(level).padStart(2, "0")}.${String(bitDepth2).padStart(2, "0")}`;
|
|
25233
|
+
};
|
|
25234
|
+
var parseVpcc = ({
|
|
25235
|
+
data,
|
|
25236
|
+
size: size4
|
|
25237
|
+
}) => {
|
|
25238
|
+
const box2 = data.startBox(size4 - 8);
|
|
25239
|
+
const confVersion = data.getUint8();
|
|
25240
|
+
if (confVersion !== 1) {
|
|
25241
|
+
throw new Error(`Unsupported AVCC version ${confVersion}`);
|
|
25242
|
+
}
|
|
25243
|
+
data.discard(3);
|
|
25244
|
+
const profile = data.getUint8();
|
|
25245
|
+
const level = data.getUint8();
|
|
25246
|
+
data.startReadingBits();
|
|
25247
|
+
const bitDepth2 = data.getBits(4);
|
|
25248
|
+
const chromaSubsampling = data.getBits(3);
|
|
25249
|
+
const videoFullRangeFlag = data.getBits(1);
|
|
25250
|
+
const videoColorPrimaries = data.getBits(8);
|
|
25251
|
+
const videoTransferCharacteristics = data.getBits(8);
|
|
25252
|
+
const videoMatrixCoefficients = data.getBits(8);
|
|
25253
|
+
data.stopReadingBits();
|
|
25254
|
+
const codecInitializationDataSize = data.getUint16();
|
|
25255
|
+
const codecInitializationData = data.getSlice(codecInitializationDataSize);
|
|
25256
|
+
box2.expectNoMoreBytes();
|
|
25257
|
+
return {
|
|
25258
|
+
type: "vpcc-box",
|
|
25259
|
+
profile,
|
|
25260
|
+
level,
|
|
25261
|
+
bitDepth: bitDepth2,
|
|
25262
|
+
chromaSubsampling,
|
|
25263
|
+
videoFullRangeFlag,
|
|
25264
|
+
videoColorPrimaries,
|
|
25265
|
+
videoTransferCharacteristics,
|
|
25266
|
+
videoMatrixCoefficients,
|
|
25267
|
+
codecInitializationDataSize,
|
|
25268
|
+
codecInitializationData,
|
|
25269
|
+
codecString: getvp09ConfigurationString({ profile, level, bitDepth: bitDepth2 })
|
|
25270
|
+
};
|
|
25271
|
+
};
|
|
25209
25272
|
var parseTfdt = ({
|
|
25210
25273
|
iterator,
|
|
25211
25274
|
size: size4,
|
|
@@ -25522,7 +25585,7 @@ var processBox = async ({
|
|
|
25522
25585
|
if (boxType === "stsz") {
|
|
25523
25586
|
return {
|
|
25524
25587
|
type: "box",
|
|
25525
|
-
box:
|
|
25588
|
+
box: parseStsz({
|
|
25526
25589
|
iterator,
|
|
25527
25590
|
offset: fileOffset,
|
|
25528
25591
|
size: boxSize
|
|
@@ -25532,7 +25595,7 @@ var processBox = async ({
|
|
|
25532
25595
|
if (boxType === "stco" || boxType === "co64") {
|
|
25533
25596
|
return {
|
|
25534
25597
|
type: "box",
|
|
25535
|
-
box:
|
|
25598
|
+
box: parseStco({
|
|
25536
25599
|
iterator,
|
|
25537
25600
|
offset: fileOffset,
|
|
25538
25601
|
size: boxSize,
|
|
@@ -25543,7 +25606,7 @@ var processBox = async ({
|
|
|
25543
25606
|
if (boxType === "pasp") {
|
|
25544
25607
|
return {
|
|
25545
25608
|
type: "box",
|
|
25546
|
-
box:
|
|
25609
|
+
box: parsePasp({
|
|
25547
25610
|
iterator,
|
|
25548
25611
|
offset: fileOffset,
|
|
25549
25612
|
size: boxSize
|
|
@@ -25553,7 +25616,7 @@ var processBox = async ({
|
|
|
25553
25616
|
if (boxType === "stss") {
|
|
25554
25617
|
return {
|
|
25555
25618
|
type: "box",
|
|
25556
|
-
box:
|
|
25619
|
+
box: parseStss({
|
|
25557
25620
|
iterator,
|
|
25558
25621
|
offset: fileOffset,
|
|
25559
25622
|
boxSize
|
|
@@ -25563,7 +25626,7 @@ var processBox = async ({
|
|
|
25563
25626
|
if (boxType === "ctts") {
|
|
25564
25627
|
return {
|
|
25565
25628
|
type: "box",
|
|
25566
|
-
box:
|
|
25629
|
+
box: parseCtts({
|
|
25567
25630
|
iterator,
|
|
25568
25631
|
offset: fileOffset,
|
|
25569
25632
|
size: boxSize
|
|
@@ -25573,7 +25636,7 @@ var processBox = async ({
|
|
|
25573
25636
|
if (boxType === "stsc") {
|
|
25574
25637
|
return {
|
|
25575
25638
|
type: "box",
|
|
25576
|
-
box:
|
|
25639
|
+
box: parseStsc({
|
|
25577
25640
|
iterator,
|
|
25578
25641
|
offset: fileOffset,
|
|
25579
25642
|
size: boxSize
|
|
@@ -25692,7 +25755,7 @@ var processBox = async ({
|
|
|
25692
25755
|
if (boxType === "stts") {
|
|
25693
25756
|
return {
|
|
25694
25757
|
type: "box",
|
|
25695
|
-
box:
|
|
25758
|
+
box: parseStts({
|
|
25696
25759
|
data: iterator,
|
|
25697
25760
|
size: boxSize,
|
|
25698
25761
|
fileOffset
|
|
@@ -25702,16 +25765,22 @@ var processBox = async ({
|
|
|
25702
25765
|
if (boxType === "avcC") {
|
|
25703
25766
|
return {
|
|
25704
25767
|
type: "box",
|
|
25705
|
-
box:
|
|
25768
|
+
box: parseAvcc({
|
|
25706
25769
|
data: iterator,
|
|
25707
25770
|
size: boxSize
|
|
25708
25771
|
})
|
|
25709
25772
|
};
|
|
25710
25773
|
}
|
|
25774
|
+
if (boxType === "vpcC") {
|
|
25775
|
+
return {
|
|
25776
|
+
type: "box",
|
|
25777
|
+
box: parseVpcc({ data: iterator, size: boxSize })
|
|
25778
|
+
};
|
|
25779
|
+
}
|
|
25711
25780
|
if (boxType === "av1C") {
|
|
25712
25781
|
return {
|
|
25713
25782
|
type: "box",
|
|
25714
|
-
box:
|
|
25783
|
+
box: parseAv1C({
|
|
25715
25784
|
data: iterator,
|
|
25716
25785
|
size: boxSize
|
|
25717
25786
|
})
|
|
@@ -25720,7 +25789,7 @@ var processBox = async ({
|
|
|
25720
25789
|
if (boxType === "hvcC") {
|
|
25721
25790
|
return {
|
|
25722
25791
|
type: "box",
|
|
25723
|
-
box:
|
|
25792
|
+
box: parseHvcc({
|
|
25724
25793
|
data: iterator,
|
|
25725
25794
|
size: boxSize,
|
|
25726
25795
|
offset: fileOffset
|
|
@@ -25730,7 +25799,7 @@ var processBox = async ({
|
|
|
25730
25799
|
if (boxType === "tfhd") {
|
|
25731
25800
|
return {
|
|
25732
25801
|
type: "box",
|
|
25733
|
-
box:
|
|
25802
|
+
box: getTfhd({
|
|
25734
25803
|
iterator,
|
|
25735
25804
|
offset: fileOffset,
|
|
25736
25805
|
size: boxSize
|
|
@@ -25740,7 +25809,7 @@ var processBox = async ({
|
|
|
25740
25809
|
if (boxType === "mdhd") {
|
|
25741
25810
|
return {
|
|
25742
25811
|
type: "box",
|
|
25743
|
-
box:
|
|
25812
|
+
box: parseMdhd({
|
|
25744
25813
|
data: iterator,
|
|
25745
25814
|
size: boxSize,
|
|
25746
25815
|
fileOffset
|
|
@@ -25750,7 +25819,7 @@ var processBox = async ({
|
|
|
25750
25819
|
if (boxType === "esds") {
|
|
25751
25820
|
return {
|
|
25752
25821
|
type: "box",
|
|
25753
|
-
box:
|
|
25822
|
+
box: parseEsds({
|
|
25754
25823
|
data: iterator,
|
|
25755
25824
|
size: boxSize,
|
|
25756
25825
|
fileOffset
|
|
@@ -25760,7 +25829,7 @@ var processBox = async ({
|
|
|
25760
25829
|
if (boxType === "trex") {
|
|
25761
25830
|
return {
|
|
25762
25831
|
type: "box",
|
|
25763
|
-
box:
|
|
25832
|
+
box: parseTrex({ iterator, offset: fileOffset, size: boxSize })
|
|
25764
25833
|
};
|
|
25765
25834
|
}
|
|
25766
25835
|
if (boxType === "moof") {
|
|
@@ -25855,7 +25924,9 @@ var videoTags = [
|
|
|
25855
25924
|
"hvc1",
|
|
25856
25925
|
"hev1",
|
|
25857
25926
|
"ap4h",
|
|
25858
|
-
"av01"
|
|
25927
|
+
"av01",
|
|
25928
|
+
"vp08",
|
|
25929
|
+
"vp09"
|
|
25859
25930
|
];
|
|
25860
25931
|
var audioTags = [
|
|
25861
25932
|
0,
|
|
@@ -31485,6 +31556,13 @@ var findBestJump = ({
|
|
|
31485
31556
|
const minProgress = Math.min(...Object.values(progresses));
|
|
31486
31557
|
const trackNumberWithLowestProgress = Object.entries(progresses).find(([, progress]) => progress === minProgress)?.[0];
|
|
31487
31558
|
const firstSampleAboveMinProgress = offsetsSorted.findIndex((offset) => sampleMap.get(offset).track.trackId === Number(trackNumberWithLowestProgress) && !visited.has(getKey(sampleMap.get(offset))));
|
|
31559
|
+
if (firstSampleAboveMinProgress === -1) {
|
|
31560
|
+
const backup = offsetsSorted.findIndex((offset) => !visited.has(getKey(sampleMap.get(offset))));
|
|
31561
|
+
if (backup === -1) {
|
|
31562
|
+
throw new Error("this should not happen");
|
|
31563
|
+
}
|
|
31564
|
+
return backup;
|
|
31565
|
+
}
|
|
31488
31566
|
return firstSampleAboveMinProgress;
|
|
31489
31567
|
};
|
|
31490
31568
|
var calculateJumpMarks = ({
|
|
@@ -31500,12 +31578,10 @@ var calculateJumpMarks = ({
|
|
|
31500
31578
|
const jumpMarks = [];
|
|
31501
31579
|
let indexToVisit = 0;
|
|
31502
31580
|
const visited = new Set;
|
|
31503
|
-
let rollOverToProcess = false;
|
|
31504
31581
|
const increaseIndex = () => {
|
|
31505
31582
|
indexToVisit++;
|
|
31506
31583
|
if (indexToVisit >= offsetsSorted.length) {
|
|
31507
|
-
|
|
31508
|
-
indexToVisit = 0;
|
|
31584
|
+
throw new Error("should not roll over, should jump");
|
|
31509
31585
|
}
|
|
31510
31586
|
};
|
|
31511
31587
|
let lastVisitedSample = null;
|
|
@@ -31519,6 +31595,10 @@ var calculateJumpMarks = ({
|
|
|
31519
31595
|
afterSampleWithOffset: lastVisitedSample.samplePosition.offset,
|
|
31520
31596
|
jumpToOffset: offsetsSorted[firstSampleAboveMinProgress]
|
|
31521
31597
|
};
|
|
31598
|
+
if (firstSampleAboveMinProgress === offsetsSorted.indexOf(lastVisitedSample.samplePosition.offset) + 1) {
|
|
31599
|
+
indexToVisit = firstSampleAboveMinProgress;
|
|
31600
|
+
return;
|
|
31601
|
+
}
|
|
31522
31602
|
indexToVisit = firstSampleAboveMinProgress;
|
|
31523
31603
|
jumpMarks.push(jumpMark);
|
|
31524
31604
|
};
|
|
@@ -31538,17 +31618,7 @@ var calculateJumpMarks = ({
|
|
|
31538
31618
|
visited,
|
|
31539
31619
|
progresses
|
|
31540
31620
|
});
|
|
31541
|
-
|
|
31542
|
-
addJumpMark({ firstSampleAboveMinProgress });
|
|
31543
|
-
indexToVisit = firstSampleAboveMinProgress;
|
|
31544
|
-
} else {
|
|
31545
|
-
while (true) {
|
|
31546
|
-
increaseIndex();
|
|
31547
|
-
if (!visited.has(getKey(sampleMap.get(offsetsSorted[indexToVisit])))) {
|
|
31548
|
-
break;
|
|
31549
|
-
}
|
|
31550
|
-
}
|
|
31551
|
-
}
|
|
31621
|
+
addJumpMark({ firstSampleAboveMinProgress });
|
|
31552
31622
|
};
|
|
31553
31623
|
while (true) {
|
|
31554
31624
|
const currentSamplePosition = sampleMap.get(offsetsSorted[indexToVisit]);
|
|
@@ -31558,16 +31628,6 @@ var calculateJumpMarks = ({
|
|
|
31558
31628
|
continue;
|
|
31559
31629
|
}
|
|
31560
31630
|
visited.add(sampleKey);
|
|
31561
|
-
if (rollOverToProcess) {
|
|
31562
|
-
if (!lastVisitedSample) {
|
|
31563
|
-
throw new Error("no last visited sample");
|
|
31564
|
-
}
|
|
31565
|
-
jumpMarks.push({
|
|
31566
|
-
afterSampleWithOffset: lastVisitedSample.samplePosition.offset,
|
|
31567
|
-
jumpToOffset: currentSamplePosition.samplePosition.offset
|
|
31568
|
-
});
|
|
31569
|
-
rollOverToProcess = false;
|
|
31570
|
-
}
|
|
31571
31631
|
lastVisitedSample = currentSamplePosition;
|
|
31572
31632
|
if (visited.size === offsetsSorted.length) {
|
|
31573
31633
|
addFinalJumpIfNecessary();
|
|
@@ -31585,6 +31645,8 @@ var calculateJumpMarks = ({
|
|
|
31585
31645
|
}
|
|
31586
31646
|
if (spread > MAX_SPREAD_IN_SECONDS) {
|
|
31587
31647
|
considerJump();
|
|
31648
|
+
} else if (indexToVisit === offsetsSorted.length - 1) {
|
|
31649
|
+
considerJump();
|
|
31588
31650
|
} else {
|
|
31589
31651
|
increaseIndex();
|
|
31590
31652
|
}
|
|
@@ -33162,10 +33224,7 @@ var innerParseMp3PacketHeader = (iterator) => {
|
|
|
33162
33224
|
throw new Error("Expected Layer I, II or III");
|
|
33163
33225
|
}
|
|
33164
33226
|
const layer = layerBits === 3 ? 1 : layerBits === 2 ? 2 : 3;
|
|
33165
|
-
|
|
33166
|
-
if (protectionBit !== 1) {
|
|
33167
|
-
throw new Error("Does not support CRC yet");
|
|
33168
|
-
}
|
|
33227
|
+
iterator.getBits(1);
|
|
33169
33228
|
const bitrateIndex = iterator.getBits(4);
|
|
33170
33229
|
const bitrateInKbit = getBitrateKB({
|
|
33171
33230
|
bits: bitrateIndex,
|
|
@@ -35179,7 +35238,7 @@ var parseWav = (state) => {
|
|
|
35179
35238
|
if (type === "id3") {
|
|
35180
35239
|
return parseId32({ state });
|
|
35181
35240
|
}
|
|
35182
|
-
if (type === "junk" || type === "fllr") {
|
|
35241
|
+
if (type === "junk" || type === "fllr" || type === "bext") {
|
|
35183
35242
|
return parseJunk({ state });
|
|
35184
35243
|
}
|
|
35185
35244
|
if (type === "fact") {
|
|
@@ -24335,6 +24335,17 @@ var getAvccBox = (trakBox) => {
|
|
|
24335
24335
|
}
|
|
24336
24336
|
return avccBox;
|
|
24337
24337
|
};
|
|
24338
|
+
var getVpccBox = (trakBox) => {
|
|
24339
|
+
const videoConfig = getStsdVideoConfig(trakBox);
|
|
24340
|
+
if (!videoConfig) {
|
|
24341
|
+
return null;
|
|
24342
|
+
}
|
|
24343
|
+
const vpccBox = videoConfig.descriptors.find((c) => c.type === "vpcc-box");
|
|
24344
|
+
if (!vpccBox || vpccBox.type !== "vpcc-box") {
|
|
24345
|
+
return null;
|
|
24346
|
+
}
|
|
24347
|
+
return vpccBox;
|
|
24348
|
+
};
|
|
24338
24349
|
var getAv1CBox = (trakBox) => {
|
|
24339
24350
|
const videoConfig = getStsdVideoConfig(trakBox);
|
|
24340
24351
|
if (!videoConfig) {
|
|
@@ -24490,21 +24501,25 @@ var getIsoBmColrConfig = (trakBox) => {
|
|
|
24490
24501
|
var getVideoCodecString = (trakBox) => {
|
|
24491
24502
|
const videoSample = getStsdVideoConfig(trakBox);
|
|
24492
24503
|
const avccBox = getAvccBox(trakBox);
|
|
24493
|
-
const hvccBox = getHvccBox(trakBox);
|
|
24494
|
-
const av1cBox = getAv1CBox(trakBox);
|
|
24495
24504
|
if (!videoSample) {
|
|
24496
24505
|
return null;
|
|
24497
24506
|
}
|
|
24498
24507
|
if (avccBox) {
|
|
24499
24508
|
return `${videoSample.format}.${avccBox.configurationString}`;
|
|
24500
24509
|
}
|
|
24510
|
+
const hvccBox = getHvccBox(trakBox);
|
|
24501
24511
|
if (hvccBox) {
|
|
24502
24512
|
return `${videoSample.format}.${hvccBox.configurationString}`;
|
|
24503
24513
|
}
|
|
24514
|
+
const av1cBox = getAv1CBox(trakBox);
|
|
24504
24515
|
if (av1cBox) {
|
|
24505
24516
|
const colrAtom = getColrBox(videoSample);
|
|
24506
24517
|
return parseAv1PrivateData(av1cBox.privateData, colrAtom);
|
|
24507
24518
|
}
|
|
24519
|
+
const vpccBox = getVpccBox(trakBox);
|
|
24520
|
+
if (vpccBox) {
|
|
24521
|
+
return `${videoSample.format}.${vpccBox.codecString}`;
|
|
24522
|
+
}
|
|
24508
24523
|
return videoSample.format;
|
|
24509
24524
|
};
|
|
24510
24525
|
var normalizeVideoRotation = (rotation) => {
|
|
@@ -24554,6 +24569,9 @@ var getVideoCodecFromIsoTrak = (trakBox) => {
|
|
|
24554
24569
|
if (videoSample.format === "av01") {
|
|
24555
24570
|
return "av1";
|
|
24556
24571
|
}
|
|
24572
|
+
if (videoSample.format === "vp09") {
|
|
24573
|
+
return "vp9";
|
|
24574
|
+
}
|
|
24557
24575
|
if (videoSample.format === "ap4h") {
|
|
24558
24576
|
return "prores";
|
|
24559
24577
|
}
|
|
@@ -25486,6 +25504,51 @@ var parseStts = ({
|
|
|
25486
25504
|
sampleDistribution: sampleDistributions
|
|
25487
25505
|
};
|
|
25488
25506
|
};
|
|
25507
|
+
var getvp09ConfigurationString = ({
|
|
25508
|
+
profile,
|
|
25509
|
+
level,
|
|
25510
|
+
bitDepth: bitDepth2
|
|
25511
|
+
}) => {
|
|
25512
|
+
return `${String(profile).padStart(2, "0")}.${String(level).padStart(2, "0")}.${String(bitDepth2).padStart(2, "0")}`;
|
|
25513
|
+
};
|
|
25514
|
+
var parseVpcc = ({
|
|
25515
|
+
data,
|
|
25516
|
+
size: size4
|
|
25517
|
+
}) => {
|
|
25518
|
+
const box2 = data.startBox(size4 - 8);
|
|
25519
|
+
const confVersion = data.getUint8();
|
|
25520
|
+
if (confVersion !== 1) {
|
|
25521
|
+
throw new Error(`Unsupported AVCC version ${confVersion}`);
|
|
25522
|
+
}
|
|
25523
|
+
data.discard(3);
|
|
25524
|
+
const profile = data.getUint8();
|
|
25525
|
+
const level = data.getUint8();
|
|
25526
|
+
data.startReadingBits();
|
|
25527
|
+
const bitDepth2 = data.getBits(4);
|
|
25528
|
+
const chromaSubsampling = data.getBits(3);
|
|
25529
|
+
const videoFullRangeFlag = data.getBits(1);
|
|
25530
|
+
const videoColorPrimaries = data.getBits(8);
|
|
25531
|
+
const videoTransferCharacteristics = data.getBits(8);
|
|
25532
|
+
const videoMatrixCoefficients = data.getBits(8);
|
|
25533
|
+
data.stopReadingBits();
|
|
25534
|
+
const codecInitializationDataSize = data.getUint16();
|
|
25535
|
+
const codecInitializationData = data.getSlice(codecInitializationDataSize);
|
|
25536
|
+
box2.expectNoMoreBytes();
|
|
25537
|
+
return {
|
|
25538
|
+
type: "vpcc-box",
|
|
25539
|
+
profile,
|
|
25540
|
+
level,
|
|
25541
|
+
bitDepth: bitDepth2,
|
|
25542
|
+
chromaSubsampling,
|
|
25543
|
+
videoFullRangeFlag,
|
|
25544
|
+
videoColorPrimaries,
|
|
25545
|
+
videoTransferCharacteristics,
|
|
25546
|
+
videoMatrixCoefficients,
|
|
25547
|
+
codecInitializationDataSize,
|
|
25548
|
+
codecInitializationData,
|
|
25549
|
+
codecString: getvp09ConfigurationString({ profile, level, bitDepth: bitDepth2 })
|
|
25550
|
+
};
|
|
25551
|
+
};
|
|
25489
25552
|
var parseTfdt = ({
|
|
25490
25553
|
iterator,
|
|
25491
25554
|
size: size4,
|
|
@@ -25802,7 +25865,7 @@ var processBox = async ({
|
|
|
25802
25865
|
if (boxType === "stsz") {
|
|
25803
25866
|
return {
|
|
25804
25867
|
type: "box",
|
|
25805
|
-
box:
|
|
25868
|
+
box: parseStsz({
|
|
25806
25869
|
iterator,
|
|
25807
25870
|
offset: fileOffset,
|
|
25808
25871
|
size: boxSize
|
|
@@ -25812,7 +25875,7 @@ var processBox = async ({
|
|
|
25812
25875
|
if (boxType === "stco" || boxType === "co64") {
|
|
25813
25876
|
return {
|
|
25814
25877
|
type: "box",
|
|
25815
|
-
box:
|
|
25878
|
+
box: parseStco({
|
|
25816
25879
|
iterator,
|
|
25817
25880
|
offset: fileOffset,
|
|
25818
25881
|
size: boxSize,
|
|
@@ -25823,7 +25886,7 @@ var processBox = async ({
|
|
|
25823
25886
|
if (boxType === "pasp") {
|
|
25824
25887
|
return {
|
|
25825
25888
|
type: "box",
|
|
25826
|
-
box:
|
|
25889
|
+
box: parsePasp({
|
|
25827
25890
|
iterator,
|
|
25828
25891
|
offset: fileOffset,
|
|
25829
25892
|
size: boxSize
|
|
@@ -25833,7 +25896,7 @@ var processBox = async ({
|
|
|
25833
25896
|
if (boxType === "stss") {
|
|
25834
25897
|
return {
|
|
25835
25898
|
type: "box",
|
|
25836
|
-
box:
|
|
25899
|
+
box: parseStss({
|
|
25837
25900
|
iterator,
|
|
25838
25901
|
offset: fileOffset,
|
|
25839
25902
|
boxSize
|
|
@@ -25843,7 +25906,7 @@ var processBox = async ({
|
|
|
25843
25906
|
if (boxType === "ctts") {
|
|
25844
25907
|
return {
|
|
25845
25908
|
type: "box",
|
|
25846
|
-
box:
|
|
25909
|
+
box: parseCtts({
|
|
25847
25910
|
iterator,
|
|
25848
25911
|
offset: fileOffset,
|
|
25849
25912
|
size: boxSize
|
|
@@ -25853,7 +25916,7 @@ var processBox = async ({
|
|
|
25853
25916
|
if (boxType === "stsc") {
|
|
25854
25917
|
return {
|
|
25855
25918
|
type: "box",
|
|
25856
|
-
box:
|
|
25919
|
+
box: parseStsc({
|
|
25857
25920
|
iterator,
|
|
25858
25921
|
offset: fileOffset,
|
|
25859
25922
|
size: boxSize
|
|
@@ -25972,7 +26035,7 @@ var processBox = async ({
|
|
|
25972
26035
|
if (boxType === "stts") {
|
|
25973
26036
|
return {
|
|
25974
26037
|
type: "box",
|
|
25975
|
-
box:
|
|
26038
|
+
box: parseStts({
|
|
25976
26039
|
data: iterator,
|
|
25977
26040
|
size: boxSize,
|
|
25978
26041
|
fileOffset
|
|
@@ -25982,16 +26045,22 @@ var processBox = async ({
|
|
|
25982
26045
|
if (boxType === "avcC") {
|
|
25983
26046
|
return {
|
|
25984
26047
|
type: "box",
|
|
25985
|
-
box:
|
|
26048
|
+
box: parseAvcc({
|
|
25986
26049
|
data: iterator,
|
|
25987
26050
|
size: boxSize
|
|
25988
26051
|
})
|
|
25989
26052
|
};
|
|
25990
26053
|
}
|
|
26054
|
+
if (boxType === "vpcC") {
|
|
26055
|
+
return {
|
|
26056
|
+
type: "box",
|
|
26057
|
+
box: parseVpcc({ data: iterator, size: boxSize })
|
|
26058
|
+
};
|
|
26059
|
+
}
|
|
25991
26060
|
if (boxType === "av1C") {
|
|
25992
26061
|
return {
|
|
25993
26062
|
type: "box",
|
|
25994
|
-
box:
|
|
26063
|
+
box: parseAv1C({
|
|
25995
26064
|
data: iterator,
|
|
25996
26065
|
size: boxSize
|
|
25997
26066
|
})
|
|
@@ -26000,7 +26069,7 @@ var processBox = async ({
|
|
|
26000
26069
|
if (boxType === "hvcC") {
|
|
26001
26070
|
return {
|
|
26002
26071
|
type: "box",
|
|
26003
|
-
box:
|
|
26072
|
+
box: parseHvcc({
|
|
26004
26073
|
data: iterator,
|
|
26005
26074
|
size: boxSize,
|
|
26006
26075
|
offset: fileOffset
|
|
@@ -26010,7 +26079,7 @@ var processBox = async ({
|
|
|
26010
26079
|
if (boxType === "tfhd") {
|
|
26011
26080
|
return {
|
|
26012
26081
|
type: "box",
|
|
26013
|
-
box:
|
|
26082
|
+
box: getTfhd({
|
|
26014
26083
|
iterator,
|
|
26015
26084
|
offset: fileOffset,
|
|
26016
26085
|
size: boxSize
|
|
@@ -26020,7 +26089,7 @@ var processBox = async ({
|
|
|
26020
26089
|
if (boxType === "mdhd") {
|
|
26021
26090
|
return {
|
|
26022
26091
|
type: "box",
|
|
26023
|
-
box:
|
|
26092
|
+
box: parseMdhd({
|
|
26024
26093
|
data: iterator,
|
|
26025
26094
|
size: boxSize,
|
|
26026
26095
|
fileOffset
|
|
@@ -26030,7 +26099,7 @@ var processBox = async ({
|
|
|
26030
26099
|
if (boxType === "esds") {
|
|
26031
26100
|
return {
|
|
26032
26101
|
type: "box",
|
|
26033
|
-
box:
|
|
26102
|
+
box: parseEsds({
|
|
26034
26103
|
data: iterator,
|
|
26035
26104
|
size: boxSize,
|
|
26036
26105
|
fileOffset
|
|
@@ -26040,7 +26109,7 @@ var processBox = async ({
|
|
|
26040
26109
|
if (boxType === "trex") {
|
|
26041
26110
|
return {
|
|
26042
26111
|
type: "box",
|
|
26043
|
-
box:
|
|
26112
|
+
box: parseTrex({ iterator, offset: fileOffset, size: boxSize })
|
|
26044
26113
|
};
|
|
26045
26114
|
}
|
|
26046
26115
|
if (boxType === "moof") {
|
|
@@ -26135,7 +26204,9 @@ var videoTags = [
|
|
|
26135
26204
|
"hvc1",
|
|
26136
26205
|
"hev1",
|
|
26137
26206
|
"ap4h",
|
|
26138
|
-
"av01"
|
|
26207
|
+
"av01",
|
|
26208
|
+
"vp08",
|
|
26209
|
+
"vp09"
|
|
26139
26210
|
];
|
|
26140
26211
|
var audioTags = [
|
|
26141
26212
|
0,
|
|
@@ -31765,6 +31836,13 @@ var findBestJump = ({
|
|
|
31765
31836
|
const minProgress = Math.min(...Object.values(progresses));
|
|
31766
31837
|
const trackNumberWithLowestProgress = Object.entries(progresses).find(([, progress]) => progress === minProgress)?.[0];
|
|
31767
31838
|
const firstSampleAboveMinProgress = offsetsSorted.findIndex((offset) => sampleMap.get(offset).track.trackId === Number(trackNumberWithLowestProgress) && !visited.has(getKey(sampleMap.get(offset))));
|
|
31839
|
+
if (firstSampleAboveMinProgress === -1) {
|
|
31840
|
+
const backup = offsetsSorted.findIndex((offset) => !visited.has(getKey(sampleMap.get(offset))));
|
|
31841
|
+
if (backup === -1) {
|
|
31842
|
+
throw new Error("this should not happen");
|
|
31843
|
+
}
|
|
31844
|
+
return backup;
|
|
31845
|
+
}
|
|
31768
31846
|
return firstSampleAboveMinProgress;
|
|
31769
31847
|
};
|
|
31770
31848
|
var calculateJumpMarks = ({
|
|
@@ -31780,12 +31858,10 @@ var calculateJumpMarks = ({
|
|
|
31780
31858
|
const jumpMarks = [];
|
|
31781
31859
|
let indexToVisit = 0;
|
|
31782
31860
|
const visited = new Set;
|
|
31783
|
-
let rollOverToProcess = false;
|
|
31784
31861
|
const increaseIndex = () => {
|
|
31785
31862
|
indexToVisit++;
|
|
31786
31863
|
if (indexToVisit >= offsetsSorted.length) {
|
|
31787
|
-
|
|
31788
|
-
indexToVisit = 0;
|
|
31864
|
+
throw new Error("should not roll over, should jump");
|
|
31789
31865
|
}
|
|
31790
31866
|
};
|
|
31791
31867
|
let lastVisitedSample = null;
|
|
@@ -31799,6 +31875,10 @@ var calculateJumpMarks = ({
|
|
|
31799
31875
|
afterSampleWithOffset: lastVisitedSample.samplePosition.offset,
|
|
31800
31876
|
jumpToOffset: offsetsSorted[firstSampleAboveMinProgress]
|
|
31801
31877
|
};
|
|
31878
|
+
if (firstSampleAboveMinProgress === offsetsSorted.indexOf(lastVisitedSample.samplePosition.offset) + 1) {
|
|
31879
|
+
indexToVisit = firstSampleAboveMinProgress;
|
|
31880
|
+
return;
|
|
31881
|
+
}
|
|
31802
31882
|
indexToVisit = firstSampleAboveMinProgress;
|
|
31803
31883
|
jumpMarks.push(jumpMark);
|
|
31804
31884
|
};
|
|
@@ -31818,17 +31898,7 @@ var calculateJumpMarks = ({
|
|
|
31818
31898
|
visited,
|
|
31819
31899
|
progresses
|
|
31820
31900
|
});
|
|
31821
|
-
|
|
31822
|
-
addJumpMark({ firstSampleAboveMinProgress });
|
|
31823
|
-
indexToVisit = firstSampleAboveMinProgress;
|
|
31824
|
-
} else {
|
|
31825
|
-
while (true) {
|
|
31826
|
-
increaseIndex();
|
|
31827
|
-
if (!visited.has(getKey(sampleMap.get(offsetsSorted[indexToVisit])))) {
|
|
31828
|
-
break;
|
|
31829
|
-
}
|
|
31830
|
-
}
|
|
31831
|
-
}
|
|
31901
|
+
addJumpMark({ firstSampleAboveMinProgress });
|
|
31832
31902
|
};
|
|
31833
31903
|
while (true) {
|
|
31834
31904
|
const currentSamplePosition = sampleMap.get(offsetsSorted[indexToVisit]);
|
|
@@ -31838,16 +31908,6 @@ var calculateJumpMarks = ({
|
|
|
31838
31908
|
continue;
|
|
31839
31909
|
}
|
|
31840
31910
|
visited.add(sampleKey);
|
|
31841
|
-
if (rollOverToProcess) {
|
|
31842
|
-
if (!lastVisitedSample) {
|
|
31843
|
-
throw new Error("no last visited sample");
|
|
31844
|
-
}
|
|
31845
|
-
jumpMarks.push({
|
|
31846
|
-
afterSampleWithOffset: lastVisitedSample.samplePosition.offset,
|
|
31847
|
-
jumpToOffset: currentSamplePosition.samplePosition.offset
|
|
31848
|
-
});
|
|
31849
|
-
rollOverToProcess = false;
|
|
31850
|
-
}
|
|
31851
31911
|
lastVisitedSample = currentSamplePosition;
|
|
31852
31912
|
if (visited.size === offsetsSorted.length) {
|
|
31853
31913
|
addFinalJumpIfNecessary();
|
|
@@ -31865,6 +31925,8 @@ var calculateJumpMarks = ({
|
|
|
31865
31925
|
}
|
|
31866
31926
|
if (spread > MAX_SPREAD_IN_SECONDS) {
|
|
31867
31927
|
considerJump();
|
|
31928
|
+
} else if (indexToVisit === offsetsSorted.length - 1) {
|
|
31929
|
+
considerJump();
|
|
31868
31930
|
} else {
|
|
31869
31931
|
increaseIndex();
|
|
31870
31932
|
}
|
|
@@ -33442,10 +33504,7 @@ var innerParseMp3PacketHeader = (iterator) => {
|
|
|
33442
33504
|
throw new Error("Expected Layer I, II or III");
|
|
33443
33505
|
}
|
|
33444
33506
|
const layer = layerBits === 3 ? 1 : layerBits === 2 ? 2 : 3;
|
|
33445
|
-
|
|
33446
|
-
if (protectionBit !== 1) {
|
|
33447
|
-
throw new Error("Does not support CRC yet");
|
|
33448
|
-
}
|
|
33507
|
+
iterator.getBits(1);
|
|
33449
33508
|
const bitrateIndex = iterator.getBits(4);
|
|
33450
33509
|
const bitrateInKbit = getBitrateKB({
|
|
33451
33510
|
bits: bitrateIndex,
|
|
@@ -35459,7 +35518,7 @@ var parseWav = (state) => {
|
|
|
35459
35518
|
if (type === "id3") {
|
|
35460
35519
|
return parseId32({ state });
|
|
35461
35520
|
}
|
|
35462
|
-
if (type === "junk" || type === "fllr") {
|
|
35521
|
+
if (type === "junk" || type === "fllr" || type === "bext") {
|
|
35463
35522
|
return parseJunk({ state });
|
|
35464
35523
|
}
|
|
35465
35524
|
if (type === "fact") {
|
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -183,7 +183,7 @@ var renderContent = (Root) => {
|
|
|
183
183
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
184
184
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
185
185
|
}));
|
|
186
|
-
import("./chunk-
|
|
186
|
+
import("./chunk-1g0vys7t.js").then(({ StudioInternals }) => {
|
|
187
187
|
renderToDOM(/* @__PURE__ */ jsx(StudioInternals.Studio, {
|
|
188
188
|
readOnly: true,
|
|
189
189
|
rootComponent: Root
|