hls.js 1.6.1-0.canary.11107 → 1.6.1-0.canary.11108
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/hls.js +35 -30
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +35 -30
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +35 -30
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +35 -30
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/dist/hls.worker.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/mp4-tools.ts +71 -65
package/package.json
CHANGED
package/src/utils/mp4-tools.ts
CHANGED
@@ -343,11 +343,14 @@ function parseStsd(stsd: Uint8Array): StsdData {
|
|
343
343
|
case 'avc4': {
|
344
344
|
// extract profile + compatibility + level out of avcC box
|
345
345
|
const avcCBox = findBox(sampleEntriesEnd, ['avcC'])[0];
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
346
|
+
if (avcCBox && avcCBox.length > 3) {
|
347
|
+
codec +=
|
348
|
+
'.' + toHex(avcCBox[1]) + toHex(avcCBox[2]) + toHex(avcCBox[3]);
|
349
|
+
supplemental = parseSupplementalDoViCodec(
|
350
|
+
codecFourCC === 'avc1' ? 'dva1' : 'dvav',
|
351
|
+
sampleEntriesEnd,
|
352
|
+
);
|
353
|
+
}
|
351
354
|
break;
|
352
355
|
}
|
353
356
|
case 'mp4a': {
|
@@ -397,9 +400,8 @@ function parseStsd(stsd: Uint8Array): StsdData {
|
|
397
400
|
}
|
398
401
|
case 'hvc1':
|
399
402
|
case 'hev1': {
|
400
|
-
const
|
401
|
-
if (
|
402
|
-
const hvcCBox = hvcCBoxes[0];
|
403
|
+
const hvcCBox = findBox(sampleEntriesEnd, ['hvcC'])[0];
|
404
|
+
if (hvcCBox && hvcCBox.length > 12) {
|
403
405
|
const profileByte = hvcCBox[1];
|
404
406
|
const profileSpace = ['', 'A', 'B', 'C'][profileByte >> 6];
|
405
407
|
const generalProfileIdc = profileByte & 0x1f;
|
@@ -436,67 +438,71 @@ function parseStsd(stsd: Uint8Array): StsdData {
|
|
436
438
|
}
|
437
439
|
case 'vp09': {
|
438
440
|
const vpcCBox = findBox(sampleEntriesEnd, ['vpcC'])[0];
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
441
|
+
if (vpcCBox && vpcCBox.length > 6) {
|
442
|
+
const profile = vpcCBox[4];
|
443
|
+
const level = vpcCBox[5];
|
444
|
+
const bitDepth = (vpcCBox[6] >> 4) & 0x0f;
|
445
|
+
codec +=
|
446
|
+
'.' +
|
447
|
+
addLeadingZero(profile) +
|
448
|
+
'.' +
|
449
|
+
addLeadingZero(level) +
|
450
|
+
'.' +
|
451
|
+
addLeadingZero(bitDepth);
|
452
|
+
}
|
449
453
|
break;
|
450
454
|
}
|
451
455
|
case 'av01': {
|
452
456
|
const av1CBox = findBox(sampleEntriesEnd, ['av1C'])[0];
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
?
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
457
|
+
if (av1CBox && av1CBox.length > 2) {
|
458
|
+
const profile = av1CBox[1] >>> 5;
|
459
|
+
const level = av1CBox[1] & 0x1f;
|
460
|
+
const tierFlag = av1CBox[2] >>> 7 ? 'H' : 'M';
|
461
|
+
const highBitDepth = (av1CBox[2] & 0x40) >> 6;
|
462
|
+
const twelveBit = (av1CBox[2] & 0x20) >> 5;
|
463
|
+
const bitDepth =
|
464
|
+
profile === 2 && highBitDepth
|
465
|
+
? twelveBit
|
466
|
+
? 12
|
467
|
+
: 10
|
468
|
+
: highBitDepth
|
469
|
+
? 10
|
470
|
+
: 8;
|
471
|
+
const monochrome = (av1CBox[2] & 0x10) >> 4;
|
472
|
+
const chromaSubsamplingX = (av1CBox[2] & 0x08) >> 3;
|
473
|
+
const chromaSubsamplingY = (av1CBox[2] & 0x04) >> 2;
|
474
|
+
const chromaSamplePosition = av1CBox[2] & 0x03;
|
475
|
+
// TODO: parse color_description_present_flag
|
476
|
+
// default it to BT.709/limited range for now
|
477
|
+
// more info https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax
|
478
|
+
const colorPrimaries = 1;
|
479
|
+
const transferCharacteristics = 1;
|
480
|
+
const matrixCoefficients = 1;
|
481
|
+
const videoFullRangeFlag = 0;
|
482
|
+
codec +=
|
483
|
+
'.' +
|
484
|
+
profile +
|
485
|
+
'.' +
|
486
|
+
addLeadingZero(level) +
|
487
|
+
tierFlag +
|
488
|
+
'.' +
|
489
|
+
addLeadingZero(bitDepth) +
|
490
|
+
'.' +
|
491
|
+
monochrome +
|
492
|
+
'.' +
|
493
|
+
chromaSubsamplingX +
|
494
|
+
chromaSubsamplingY +
|
495
|
+
chromaSamplePosition +
|
496
|
+
'.' +
|
497
|
+
addLeadingZero(colorPrimaries) +
|
498
|
+
'.' +
|
499
|
+
addLeadingZero(transferCharacteristics) +
|
500
|
+
'.' +
|
501
|
+
addLeadingZero(matrixCoefficients) +
|
502
|
+
'.' +
|
503
|
+
videoFullRangeFlag;
|
504
|
+
supplemental = parseSupplementalDoViCodec('dav1', sampleEntriesEnd);
|
505
|
+
}
|
500
506
|
break;
|
501
507
|
}
|
502
508
|
case 'ac-3':
|