🎥 Make videos programmatically with React
parse simple block
Jonny Burger674383244717
diff --git a/packages/media-parser/dar.json b/packages/media-parser/dar.jsonnew file mode 100644index 0000000000..2d9bc1dce7--- /dev/null+++ b/packages/media-parser/dar.json@@ -0,0 +1,2556 @@+[+ {+ "type": "ftyp-box",+ "majorBrand": "isom",+ "minorVersion": 512,+ "compatibleBrands": [+ "isom",+ "iso2",+ "avc1",+ "mp41"+ ],+ "offset": 0,+ "boxSize": 32+ },+ {+ "offset": 32,+ "boxSize": 7433,+ "type": "moov-box",+ "children": [+ {+ "creationTime": null,+ "modificationTime": null,+ "timeScale": 1000,+ "durationInUnits": 5725,+ "durationInSeconds": 5.725,+ "rate": 1,+ "volume": 1,+ "matrix": [+ 1,+ 0,+ 0,+ 0,+ 1,+ 0,+ 0,+ 0,+ 1+ ],+ "nextTrackId": 3,+ "type": "mvhd-box",+ "boxSize": 108,+ "offset": 40+ },+ {+ "offset": 148,+ "boxSize": 3130,+ "type": "trak-box",+ "children": [+ {+ "offset": 156,+ "boxSize": 92,+ "type": "tkhd-box",+ "creationTime": null,+ "modificationTime": null,+ "trackId": 1,+ "duration": 5700,+ "layer": 0,+ "alternateGroup": 0,+ "volume": 0,+ "matrix": [+ 1,+ 0,+ 0,+ 0,+ 1,+ 0,+ 0,+ 0,+ 1+ ],+ "width": 404.9717559814453,+ "height": 720,+ "version": 0,+ "rotation": 0,+ "unrotatedWidth": 404.9717559814453,+ "unrotatedHeight": 720+ },+ {+ "type": "regular-box",+ "boxType": "edts",+ "boxSize": 36,+ "children": [],+ "offset": 248+ },+ {+ "type": "regular-box",+ "boxType": "mdia",+ "boxSize": 2994,+ "children": [+ {+ "type": "mdhd-box",+ "duration": 87552,+ "timescale": 15360,+ "version": 0,+ "language": 21956,+ "quality": 0+ },+ {+ "type": "regular-box",+ "boxType": "hdlr",+ "boxSize": 45,+ "children": [],+ "offset": 324+ },+ {+ "type": "regular-box",+ "boxType": "minf",+ "boxSize": 2909,+ "children": [+ {+ "type": "regular-box",+ "boxType": "vmhd",+ "boxSize": 20,+ "children": [],+ "offset": 377+ },+ {+ "type": "regular-box",+ "boxType": "dinf",+ "boxSize": 36,+ "children": [],+ "offset": 397+ },+ {+ "type": "regular-box",+ "boxType": "stbl",+ "boxSize": 2845,+ "children": [+ {+ "type": "stsd-box",+ "boxSize": 197,+ "offset": 441,+ "numberOfEntries": 1,+ "samples": [+ {+ "format": "avc1",+ "offset": 457,+ "dataReferenceIndex": 1,+ "version": 0,+ "revisionLevel": 0,+ "vendor": [+ 0,+ 0,+ 0,+ 0+ ],+ "size": 181,+ "type": "video",+ "width": 1280,+ "height": 720,+ "horizontalResolutionPpi": 72,+ "verticalResolutionPpi": 72,+ "spacialQuality": 0,+ "temporalQuality": 0,+ "dataSize": 0,+ "frameCountPerSample": 1,+ "compressorName": [+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0+ ],+ "depth": 24,+ "colorTableId": -1,+ "descriptors": [+ {+ "type": "avcc-box",+ "data": {+ "0": 1,+ "1": 100,+ "2": 0,+ "3": 31,+ "4": 255,+ "5": 225,+ "6": 0,+ "7": 30,+ "8": 103,+ "9": 100,+ "10": 0,+ "11": 31,+ "12": 172,+ "13": 217,+ "14": 64,+ "15": 80,+ "16": 5,+ "17": 187,+ "18": 255,+ "19": 0,+ "20": 56,+ "21": 0,+ "22": 177,+ "23": 16,+ "24": 0,+ "25": 0,+ "26": 3,+ "27": 0,+ "28": 16,+ "29": 0,+ "30": 0,+ "31": 3,+ "32": 3,+ "33": 192,+ "34": 241,+ "35": 131,+ "36": 25,+ "37": 96,+ "38": 1,+ "39": 0,+ "40": 6,+ "41": 104,+ "42": 235,+ "43": 227,+ "44": 203,+ "45": 34,+ "46": 192,+ "47": 253,+ "48": 248,+ "49": 248,+ "50": 0+ },+ "configurationString": "64001f"+ },+ {+ "type": "pasp-box",+ "boxSize": 16,+ "offset": 602,+ "hSpacing": 56,+ "vSpacing": 177+ },+ {+ "type": "regular-box",+ "boxType": "btrt",+ "boxSize": 20,+ "children": [],+ "offset": 618+ }+ ]+ }+ ]+ },+ {+ "type": "stts-box",+ "sampleDistribution": [+ {+ "sampleCount": 171,+ "sampleDelta": 512+ }+ ]+ },+ {+ "type": "stss-box",+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "sampleNumber": [+ 1,+ 33+ ],+ "boxSize": 24,+ "offset": 662+ },+ {+ "type": "ctts-box",+ "boxSize": 1152,+ "offset": 686,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "entryCount": 142,+ "entries": [+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2048+ },+ {+ "sampleCount": 2,+ "sampleOffset": 512+ },+ {+ "sampleCount": 13,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2048+ },+ {+ "sampleCount": 2,+ "sampleOffset": 512+ },+ {+ "sampleCount": 13,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1536+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1536+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1536+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 4,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ },+ {+ "sampleCount": 1,+ "sampleOffset": 2560+ },+ {+ "sampleCount": 1,+ "sampleOffset": 1024+ },+ {+ "sampleCount": 1,+ "sampleOffset": 0+ },+ {+ "sampleCount": 1,+ "sampleOffset": 512+ }+ ]+ },+ {+ "type": "stsc-box",+ "boxSize": 40,+ "offset": 1838,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "entryCount": 2,+ "entries": [+ {+ "firstChunk": 1,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 2,+ "samplesPerChunk": 1+ }+ ]+ },+ {+ "type": "stsz-box",+ "boxSize": 704,+ "offset": 1878,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "sampleCount": 171,+ "countType": "variable",+ "entries": [+ 1725,+ 439,+ 301,+ 127,+ 150,+ 464,+ 306,+ 99,+ 182,+ 552,+ 346,+ 235,+ 328,+ 531,+ 496,+ 216,+ 329,+ 667,+ 312,+ 332,+ 1436,+ 18331,+ 24767,+ 30638,+ 37033,+ 40871,+ 45520,+ 47903,+ 48646,+ 48968,+ 49073,+ 47246,+ 66081,+ 44620,+ 44392,+ 39625,+ 34043,+ 36566,+ 34207,+ 27497,+ 22077,+ 27023,+ 20139,+ 15038,+ 18497,+ 14809,+ 14673,+ 11944,+ 12792,+ 9315,+ 9795,+ 7869,+ 8182,+ 7209,+ 7152,+ 6409,+ 7634,+ 7035,+ 3385,+ 6727,+ 3174,+ 7839,+ 4374,+ 2722,+ 2472,+ 4484,+ 2166,+ 2883,+ 3509,+ 2430,+ 2405,+ 5235,+ 2684,+ 1645,+ 1593,+ 4453,+ 2558,+ 1657,+ 1492,+ 5717,+ 2736,+ 1642,+ 1568,+ 4939,+ 1992,+ 1281,+ 1238,+ 3307,+ 1541,+ 1025,+ 899,+ 3167,+ 1314,+ 764,+ 718,+ 2767,+ 974,+ 677,+ 561,+ 1632,+ 769,+ 582,+ 484,+ 1489,+ 728,+ 423,+ 513,+ 1516,+ 649,+ 472,+ 381,+ 1642,+ 549,+ 375,+ 367,+ 1255,+ 509,+ 370,+ 330,+ 1407,+ 500,+ 368,+ 300,+ 1123,+ 443,+ 357,+ 252,+ 2897,+ 576,+ 359,+ 326,+ 1046,+ 422,+ 259,+ 249,+ 1211,+ 407,+ 235,+ 211,+ 421,+ 268,+ 256,+ 235,+ 331,+ 253,+ 199,+ 179,+ 218,+ 258,+ 242,+ 200,+ 176,+ 255,+ 189,+ 192,+ 286,+ 217,+ 168,+ 195,+ 266,+ 255,+ 203,+ 194,+ 79,+ 247,+ 177,+ 156,+ 105,+ 237,+ 185,+ 173+ ]+ },+ {+ "type": "stco-box",+ "boxSize": 696,+ "offset": 2582,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "entries": [+ 7481,+ 9669,+ 9982,+ 10115,+ 10277,+ 10747,+ 11065,+ 11176,+ 11364,+ 11928,+ 12280,+ 12527,+ 12861,+ 13404,+ 13906,+ 14134,+ 14475,+ 15201,+ 16638,+ 17620,+ 20297,+ 39076,+ 64764,+ 96182,+ 133636,+ 175163,+ 221062,+ 269672,+ 318686,+ 368342,+ 417774,+ 465711,+ 532460,+ 577532,+ 622781,+ 662695,+ 697363,+ 734263,+ 769117,+ 797304,+ 819710,+ 847403,+ 867867,+ 883592,+ 902427,+ 917920,+ 932940,+ 945587,+ 959064,+ 968725,+ 979253,+ 987471,+ 996357,+ 1003925,+ 1011795,+ 1018890,+ 1026873,+ 1034594,+ 1038314,+ 1045740,+ 1049266,+ 1057756,+ 1062489,+ 1065937,+ 1069152,+ 1073991,+ 1076817,+ 1080043,+ 1084242,+ 1087038,+ 1090148,+ 1096083,+ 1099083,+ 1101372,+ 1103296,+ 1108421,+ 1111317,+ 1113612,+ 1115403,+ 1121777,+ 1125127,+ 1127159,+ 1129444,+ 1134766,+ 1137413,+ 1139044,+ 1140962,+ 1144967,+ 1146862,+ 1148556,+ 1149853,+ 1153702,+ 1155364,+ 1156790,+ 1157840,+ 1161279,+ 1162940,+ 1163983,+ 1165206,+ 1167190,+ 1168588,+ 1169513,+ 1170694,+ 1172846,+ 1173926,+ 1175048,+ 1175922,+ 1178166,+ 1179138,+ 1180292,+ 1181034,+ 1183324,+ 1184599,+ 1185323,+ 1186339,+ 1187937,+ 1189113,+ 1189840,+ 1190896,+ 1192922,+ 1193745,+ 1194767,+ 1195447,+ 1197276,+ 1198038,+ 1199040,+ 1199660,+ 1203278,+ 1204549,+ 1205229,+ 1206160,+ 1207561,+ 1208659,+ 1209268,+ 1210214,+ 1212123,+ 1212883,+ 1213783,+ 1214379,+ 1215437,+ 1216055,+ 1216988,+ 1217562,+ 1218589,+ 1219542,+ 1220062,+ 1220966,+ 1221548,+ 1222490,+ 1223040,+ 1223921,+ 1224795,+ 1225370,+ 1226244,+ 1226776,+ 1227739,+ 1228278,+ 1229164,+ 1229696,+ 1230632,+ 1231561,+ 1232128,+ 1232971,+ 1233402,+ 1234328,+ 1234899,+ 1235725,+ 1236551,+ 1237114,+ 1237974+ ],+ "entryCount": 170+ }+ ],+ "offset": 433+ }+ ],+ "offset": 369+ }+ ],+ "offset": 284+ }+ ]+ },+ {+ "offset": 3278,+ "boxSize": 4089,+ "type": "trak-box",+ "children": [+ {+ "offset": 3286,+ "boxSize": 92,+ "type": "tkhd-box",+ "creationTime": null,+ "modificationTime": null,+ "trackId": 2,+ "duration": 5725,+ "layer": 0,+ "alternateGroup": 1,+ "volume": 256,+ "matrix": [+ 1,+ 0,+ 0,+ 0,+ 1,+ 0,+ 0,+ 0,+ 1+ ],+ "width": 0,+ "height": 0,+ "version": 0,+ "rotation": 0,+ "unrotatedWidth": 0,+ "unrotatedHeight": 0+ },+ {+ "type": "regular-box",+ "boxType": "edts",+ "boxSize": 36,+ "children": [],+ "offset": 3378+ },+ {+ "type": "regular-box",+ "boxType": "mdia",+ "boxSize": 3953,+ "children": [+ {+ "type": "mdhd-box",+ "duration": 274768,+ "timescale": 48000,+ "version": 0,+ "language": 21956,+ "quality": 0+ },+ {+ "type": "regular-box",+ "boxType": "hdlr",+ "boxSize": 45,+ "children": [],+ "offset": 3454+ },+ {+ "type": "regular-box",+ "boxType": "minf",+ "boxSize": 3868,+ "children": [+ {+ "type": "regular-box",+ "boxType": "smhd",+ "boxSize": 16,+ "children": [],+ "offset": 3507+ },+ {+ "type": "regular-box",+ "boxType": "dinf",+ "boxSize": 36,+ "children": [],+ "offset": 3523+ },+ {+ "type": "regular-box",+ "boxType": "stbl",+ "boxSize": 3808,+ "children": [+ {+ "type": "stsd-box",+ "boxSize": 126,+ "offset": 3567,+ "numberOfEntries": 1,+ "samples": [+ {+ "format": "mp4a",+ "offset": 3583,+ "dataReferenceIndex": 1,+ "version": 0,+ "revisionLevel": 0,+ "vendor": [+ 0,+ 0,+ 0,+ 0+ ],+ "size": 110,+ "type": "audio",+ "numberOfChannels": 2,+ "sampleSize": 16,+ "compressionId": 0,+ "packetSize": 0,+ "sampleRate": 48000,+ "samplesPerPacket": null,+ "bytesPerPacket": null,+ "bytesPerFrame": null,+ "bitsPerSample": null,+ "children": [+ {+ "type": "esds-box",+ "version": 0,+ "tag": 3,+ "sizeOfInstance": 37,+ "esId": 2,+ "descriptors": [+ {+ "type": "decoder-config-descriptor",+ "objectTypeIndication": "aac",+ "asNumber": 64+ },+ {+ "type": "sl-config-descriptor"+ }+ ]+ },+ {+ "type": "regular-box",+ "boxType": "btrt",+ "boxSize": 20,+ "children": [],+ "offset": 3673+ }+ ]+ }+ ]+ },+ {+ "type": "stts-box",+ "sampleDistribution": [+ {+ "sampleCount": 269,+ "sampleDelta": 1024+ }+ ]+ },+ {+ "type": "stsc-box",+ "boxSize": 1804,+ "offset": 3717,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "entryCount": 149,+ "entries": [+ {+ "firstChunk": 1,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 2,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 3,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 4,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 5,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 6,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 8,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 9,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 10,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 11,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 12,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 13,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 14,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 15,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 17,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 18,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 19,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 20,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 21,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 22,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 24,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 25,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 26,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 27,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 28,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 29,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 30,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 31,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 33,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 34,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 35,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 36,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 37,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 38,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 40,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 41,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 42,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 43,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 44,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 45,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 46,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 47,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 49,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 50,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 51,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 52,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 53,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 54,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 56,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 57,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 58,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 59,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 60,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 61,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 62,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 63,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 65,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 66,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 67,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 68,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 69,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 70,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 72,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 73,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 74,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 75,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 76,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 77,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 78,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 79,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 81,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 82,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 83,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 84,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 85,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 86,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 88,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 89,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 90,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 91,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 92,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 93,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 94,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 95,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 97,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 98,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 99,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 100,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 101,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 102,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 104,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 105,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 106,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 107,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 108,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 109,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 110,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 111,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 113,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 114,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 115,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 116,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 117,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 118,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 120,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 121,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 122,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 123,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 124,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 125,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 126,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 127,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 129,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 130,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 131,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 132,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 133,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 134,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 136,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 137,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 138,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 139,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 140,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 141,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 142,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 143,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 145,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 146,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 147,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 148,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 149,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 150,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 152,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 153,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 154,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 155,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 156,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 157,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 158,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 159,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 161,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 162,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 163,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 164,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 165,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 166,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 168,+ "samplesPerChunk": 1+ },+ {+ "firstChunk": 169,+ "samplesPerChunk": 2+ },+ {+ "firstChunk": 170,+ "samplesPerChunk": 5+ }+ ]+ },+ {+ "type": "stsz-box",+ "boxSize": 1096,+ "offset": 5521,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "sampleCount": 269,+ "countType": "variable",+ "entries": [+ 24,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 6,+ 59,+ 490,+ 635,+ 650,+ 639,+ 602,+ 448,+ 459,+ 462,+ 383,+ 397,+ 421,+ 326,+ 330,+ 379,+ 350,+ 357,+ 368,+ 363,+ 325,+ 359,+ 326,+ 365,+ 352,+ 316,+ 452,+ 434,+ 423,+ 289,+ 306,+ 319,+ 334,+ 321,+ 326,+ 351,+ 339,+ 329,+ 331,+ 339,+ 325,+ 337,+ 350,+ 338,+ 339,+ 345,+ 347,+ 339,+ 364,+ 337,+ 348,+ 346,+ 344,+ 389,+ 349,+ 358,+ 346,+ 359,+ 364,+ 354,+ 364,+ 322,+ 349,+ 332,+ 354,+ 335,+ 361,+ 338,+ 352,+ 342,+ 309,+ 359,+ 366,+ 360,+ 377,+ 366,+ 355,+ 339,+ 321,+ 343,+ 352,+ 338,+ 366,+ 349,+ 356,+ 355,+ 345,+ 316,+ 333,+ 311,+ 331,+ 322,+ 350,+ 338,+ 310,+ 328,+ 299,+ 325,+ 332,+ 279,+ 335,+ 390,+ 363,+ 354,+ 383,+ 359,+ 296,+ 350,+ 373,+ 307,+ 332,+ 366,+ 354,+ 332,+ 337,+ 398,+ 376,+ 306,+ 348,+ 335,+ 327,+ 332,+ 345,+ 327,+ 353,+ 334,+ 366,+ 335,+ 327,+ 352,+ 312,+ 317,+ 343,+ 346,+ 351,+ 325,+ 338,+ 352,+ 345,+ 354,+ 361,+ 336,+ 392,+ 323,+ 353,+ 329,+ 361,+ 315,+ 333,+ 328,+ 398,+ 349,+ 351,+ 298,+ 343,+ 346,+ 321,+ 357,+ 364,+ 362,+ 321,+ 298,+ 323,+ 339,+ 315,+ 380,+ 363,+ 343,+ 319,+ 317,+ 328,+ 368,+ 366,+ 355,+ 351,+ 344,+ 321,+ 295,+ 310,+ 355,+ 332,+ 344,+ 350,+ 380,+ 317,+ 347,+ 351,+ 353,+ 313,+ 352,+ 385,+ 302,+ 335,+ 350,+ 326,+ 351,+ 339,+ 354,+ 342,+ 344,+ 356,+ 321,+ 361,+ 364,+ 364,+ 366,+ 318,+ 308,+ 382,+ 299,+ 355,+ 343,+ 320,+ 361,+ 324,+ 340,+ 331,+ 346,+ 322,+ 372,+ 346,+ 337,+ 327,+ 343,+ 339,+ 335,+ 364,+ 292,+ 357,+ 352,+ 358,+ 321,+ 394,+ 300,+ 370,+ 336,+ 385,+ 326,+ 320,+ 355,+ 328,+ 332,+ 331,+ 337,+ 152+ ]+ },+ {+ "type": "stco-box",+ "boxSize": 696,+ "offset": 6617,+ "version": 0,+ "flags": [+ 0,+ 0,+ 0+ ],+ "entries": [+ 9645,+ 9970,+ 10109,+ 10265,+ 10741,+ 11053,+ 11164,+ 11358,+ 11916,+ 12274,+ 12515,+ 12855,+ 13392,+ 13900,+ 14122,+ 14463,+ 15142,+ 15513,+ 16970,+ 19056,+ 38628,+ 63843,+ 95402,+ 133215,+ 174507,+ 220683,+ 268965,+ 318318,+ 367654,+ 417415,+ 465020,+ 531792,+ 577080,+ 621924,+ 662406,+ 696738,+ 733929,+ 768470,+ 796614,+ 819381,+ 846733,+ 867542,+ 882905,+ 902089,+ 917236,+ 932593,+ 944884,+ 958379,+ 968379,+ 978520,+ 987122,+ 995653,+ 1003566,+ 1011077,+ 1018204,+ 1026524,+ 1033908,+ 1037979,+ 1045041,+ 1048914,+ 1057105,+ 1062130,+ 1065211,+ 1068409,+ 1073636,+ 1076157,+ 1079700,+ 1083552,+ 1086672,+ 1089443,+ 1095383,+ 1098767,+ 1100728,+ 1102965,+ 1107749,+ 1110979,+ 1112974,+ 1115104,+ 1121120,+ 1124513,+ 1126769,+ 1128727,+ 1134383,+ 1136758,+ 1138694,+ 1140282,+ 1144269,+ 1146508,+ 1147887,+ 1149455,+ 1153020,+ 1155016,+ 1156128,+ 1157508,+ 1160607,+ 1162253,+ 1163617,+ 1164544,+ 1166838,+ 1167959,+ 1169170,+ 1169997,+ 1172183,+ 1173574,+ 1174349,+ 1175561,+ 1177438,+ 1178815,+ 1179610,+ 1180673,+ 1182676,+ 1183873,+ 1184974,+ 1185690,+ 1187594,+ 1188446,+ 1189483,+ 1190170,+ 1192303,+ 1193422,+ 1194113,+ 1195067,+ 1196570,+ 1197719,+ 1198395,+ 1199292,+ 1202557,+ 1203854,+ 1204908,+ 1205555,+ 1207206,+ 1207983,+ 1208918,+ 1209517,+ 1211425,+ 1212530,+ 1213118,+ 1213994,+ 1214800,+ 1215705,+ 1216311,+ 1217223,+ 1217893,+ 1218842,+ 1219741,+ 1220241,+ 1221184,+ 1221806,+ 1222732,+ 1223240,+ 1224097,+ 1225050,+ 1225559,+ 1226436,+ 1227062,+ 1227956,+ 1228446,+ 1229359,+ 1229962,+ 1230887,+ 1231764,+ 1232322,+ 1233050,+ 1233649,+ 1234505,+ 1235055,+ 1235830,+ 1236788,+ 1237299,+ 1238147+ ],+ "entryCount": 170+ },+ {+ "type": "regular-box",+ "boxType": "sgpd",+ "boxSize": 26,+ "children": [],+ "offset": 7313+ },+ {+ "type": "regular-box",+ "boxType": "sbgp",+ "boxSize": 28,+ "children": [],+ "offset": 7339+ }+ ],+ "offset": 3559+ }+ ],+ "offset": 3499+ }+ ],+ "offset": 3414+ }+ ]+ },+ {+ "type": "regular-box",+ "boxType": "udta",+ "boxSize": 98,+ "children": [],+ "offset": 7367+ }+ ]+ },+ {+ "type": "regular-box",+ "boxType": "free",+ "boxSize": 8,+ "children": [],+ "offset": 7465+ },+ {+ "type": "regular-box",+ "boxType": "mdat",+ "children": [],+ "boxSize": 1232154,+ "offset": 7473+ }+]\ No newline at end of filediff --git a/packages/media-parser/src/boxes/webm/segments.ts b/packages/media-parser/src/boxes/webm/segments.tsindex ddbece04fa..15778c2f34 100644--- a/packages/media-parser/src/boxes/webm/segments.ts+++ b/packages/media-parser/src/boxes/webm/segments.ts@@ -30,6 +30,7 @@ import type {LanguageSegment,MaxBlockAdditionId,SegmentUUIDSegment,+ SimpleBlockSegment,TagSegment,TagsSegment,TimestampSegment,@@ -56,6 +57,7 @@ import {parseLanguageSegment,parseMaxBlockAdditionId,parseSegmentUUIDSegment,+ parseSimpleBlockSegment,parseTagSegment,parseTagsSegment,parseTimestampSegment,@@ -112,7 +114,8 @@ export type MatroskaSegment =| TagsSegment| TagSegment| ClusterSegment- | TimestampSegment;+ | TimestampSegment+ | SimpleBlockSegment;export const expectSegment = (iterator: BufferIterator): MatroskaSegment => {const bytesRemaining_ = iterator.byteLength() - iterator.counter.getOffset();@@ -269,6 +272,10 @@ export const expectSegment = (iterator: BufferIterator): MatroskaSegment => {return parseTimestampSegment(iterator);}+ if (segmentId === '0xa3') {+ return parseSimpleBlockSegment(iterator);+ }+const length = iterator.getVint();const bytesRemaining = iterator.byteLength() - iterator.counter.getOffset();diff --git a/packages/media-parser/src/boxes/webm/segments/track-entry.ts b/packages/media-parser/src/boxes/webm/segments/track-entry.tsindex f1619dd961..211dda989a 100644--- a/packages/media-parser/src/boxes/webm/segments/track-entry.ts+++ b/packages/media-parser/src/boxes/webm/segments/track-entry.ts@@ -458,3 +458,46 @@ export const parseTimestampSegment = (timestamp: value,};};++export type SimpleBlockSegment = {+ type: 'simple-block-segment';+ length: number;+ trackNumber: number;+ timecode: number;+ headerFlags: number;+ keyframe: boolean;+ lacing: [number, number];+ invisible: boolean;+ children: MatroskaSegment[];+};++export const parseSimpleBlockSegment = (+ iterator: BufferIterator,+): SimpleBlockSegment => {+ const length = iterator.getVint();+ const offset = iterator.counter.getOffset();+ const trackNumber = iterator.getVint();+ const timecode = iterator.getUint16();+ const headerFlags = iterator.getUint8();++ const invisible = Boolean((headerFlags >> 5) & 1);+ const pos6 = (headerFlags >> 6) & 1;+ const pos7 = (headerFlags >> 6) & 1;+ const keyframe = Boolean((headerFlags >> 7) & 1);++ const remaining = length - (iterator.counter.getOffset() - offset);++ const children = expectChildren(iterator, remaining);++ return {+ type: 'simple-block-segment',+ length,+ trackNumber,+ timecode,+ headerFlags,+ keyframe,+ lacing: [pos6, pos7],+ invisible,+ children,+ };+};diff --git a/packages/media-parser/src/buffer-iterator.ts b/packages/media-parser/src/buffer-iterator.tsindex 964ba2df73..48f16c5add 100644--- a/packages/media-parser/src/buffer-iterator.ts+++ b/packages/media-parser/src/buffer-iterator.ts@@ -210,6 +210,7 @@ export const getArrayBufferIterator = ('0xbf','0x88','0xe7',+ '0xa3',];if (knownIdsWithOneLength.includes(firstOneString)) {return firstOneString;diff --git a/packages/media-parser/src/test/matroska.test.ts b/packages/media-parser/src/test/matroska.test.tsindex eba00ad81c..5a2606d6c5 100644--- a/packages/media-parser/src/test/matroska.test.ts+++ b/packages/media-parser/src/test/matroska.test.ts@@ -171,8 +171,20 @@ test('Should get duration of AV1 video', async () => {timestamp: 0,},{- id: '0xa324430b',- type: 'unknown-segment',+ length: 279307,+ type: 'simple-block-segment',+ trackNumber: 1,+ headerFlags: 128,+ invisible: false,+ keyframe: true,+ lacing: [0, 0],+ timecode: 0,+ children: [+ {+ type: 'unknown-segment',+ id: '0x0a0e0000',+ },+ ],},],type: 'cluster-segment',