@remotion/media-parser 4.0.201 → 4.0.204

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.
Files changed (144) hide show
  1. package/dist/av1-codec-string.d.ts +0 -5
  2. package/dist/av1-codec-string.js +1 -18
  3. package/dist/boxes/iso-base-media/ftype.d.ts +9 -0
  4. package/dist/boxes/iso-base-media/ftype.js +31 -0
  5. package/dist/boxes/iso-base-media/get-sample-positions-from-track.d.ts +4 -0
  6. package/dist/boxes/iso-base-media/get-sample-positions-from-track.js +48 -0
  7. package/dist/boxes/iso-base-media/mvhd.js +2 -2
  8. package/dist/boxes/iso-base-media/stsd/keys.js +1 -1
  9. package/dist/boxes/iso-base-media/tfdt.d.ts +12 -0
  10. package/dist/boxes/iso-base-media/tfdt.js +20 -0
  11. package/dist/boxes/iso-base-media/tfhd.d.ts +16 -0
  12. package/dist/boxes/iso-base-media/tfhd.js +41 -0
  13. package/dist/boxes/iso-base-media/trun.d.ts +21 -0
  14. package/dist/boxes/iso-base-media/trun.js +44 -0
  15. package/dist/boxes/webm/av1-codec-private.js +1 -1
  16. package/dist/boxes/webm/bitstream/av1.js +1 -10
  17. package/dist/boxes/webm/description.d.ts +2 -2
  18. package/dist/boxes/webm/description.js +2 -2
  19. package/dist/boxes/webm/ebml.d.ts +2 -2
  20. package/dist/boxes/webm/ebml.js +23 -1
  21. package/dist/boxes/webm/get-ready-tracks.d.ts +1 -1
  22. package/dist/boxes/webm/get-ready-tracks.js +3 -3
  23. package/dist/boxes/webm/get-sample-from-block.d.ts +17 -0
  24. package/dist/boxes/webm/get-sample-from-block.js +78 -0
  25. package/dist/boxes/webm/get-track.d.ts +2 -2
  26. package/dist/boxes/webm/get-track.js +26 -25
  27. package/dist/boxes/webm/make-header.d.ts +3 -8
  28. package/dist/boxes/webm/make-header.js +43 -20
  29. package/dist/boxes/webm/parse-ebml.d.ts +9 -4
  30. package/dist/boxes/webm/parse-ebml.js +122 -13
  31. package/dist/boxes/webm/segments/all-segments.d.ts +421 -107
  32. package/dist/boxes/webm/segments/all-segments.js +260 -33
  33. package/dist/boxes/webm/segments/track-entry.d.ts +3 -191
  34. package/dist/boxes/webm/segments/track-entry.js +2 -456
  35. package/dist/boxes/webm/segments.d.ts +3 -16
  36. package/dist/boxes/webm/segments.js +12 -196
  37. package/dist/boxes/webm/tracks.d.ts +8 -0
  38. package/dist/boxes/webm/tracks.js +21 -0
  39. package/dist/boxes/webm/traversal.d.ts +5 -6
  40. package/dist/boxes/webm/traversal.js +6 -6
  41. package/dist/buffer-iterator.d.ts +1 -1
  42. package/dist/buffer-iterator.js +3 -3
  43. package/dist/from-web.js +6 -15
  44. package/dist/get-audio-codec.d.ts +1 -1
  45. package/dist/get-audio-codec.js +13 -13
  46. package/dist/get-duration.js +12 -14
  47. package/dist/get-tracks.js +2 -2
  48. package/dist/get-video-codec.js +13 -13
  49. package/dist/get-video-metadata.d.ts +2 -0
  50. package/dist/get-video-metadata.js +44 -0
  51. package/dist/parse-media.js +4 -1
  52. package/dist/parser-context.d.ts +1 -0
  53. package/dist/parser-state.js +3 -2
  54. package/dist/read-and-increment-offset.d.ts +28 -0
  55. package/dist/read-and-increment-offset.js +177 -0
  56. package/dist/samples-from-moof.d.ts +6 -0
  57. package/dist/samples-from-moof.js +74 -0
  58. package/dist/traversal.d.ts +19 -17
  59. package/dist/traversal.js +38 -39
  60. package/dist/understand-vorbis.d.ts +1 -0
  61. package/dist/understand-vorbis.js +12 -0
  62. package/input.webm +0 -0
  63. package/package.json +2 -2
  64. package/src/boxes/iso-base-media/get-sample-positions-from-track.ts +69 -0
  65. package/src/boxes/iso-base-media/make-track.ts +4 -45
  66. package/src/boxes/iso-base-media/mdat/mdat.ts +33 -24
  67. package/src/boxes/iso-base-media/mdhd.ts +10 -7
  68. package/src/boxes/iso-base-media/mvhd.ts +17 -16
  69. package/src/boxes/iso-base-media/process-box.ts +42 -0
  70. package/src/boxes/iso-base-media/stsd/keys.ts +1 -1
  71. package/src/boxes/iso-base-media/tfdt.ts +37 -0
  72. package/src/boxes/iso-base-media/tfhd.ts +66 -0
  73. package/src/boxes/iso-base-media/tkhd.ts +11 -13
  74. package/src/boxes/iso-base-media/trun.ts +74 -0
  75. package/src/boxes/webm/av1-codec-private.ts +1 -1
  76. package/src/boxes/webm/description.ts +7 -4
  77. package/src/boxes/webm/ebml.ts +24 -4
  78. package/src/boxes/webm/get-ready-tracks.ts +4 -4
  79. package/src/boxes/webm/get-sample-from-block.ts +125 -0
  80. package/src/boxes/webm/get-track.ts +40 -33
  81. package/src/boxes/webm/make-header.ts +58 -51
  82. package/src/boxes/webm/parse-ebml.ts +170 -16
  83. package/src/boxes/webm/segments/all-segments.ts +379 -62
  84. package/src/boxes/webm/segments/track-entry.ts +3 -846
  85. package/src/boxes/webm/segments.ts +18 -410
  86. package/src/boxes/webm/traversal.ts +17 -17
  87. package/src/buffer-iterator.ts +8 -6
  88. package/src/get-audio-codec.ts +14 -16
  89. package/src/get-duration.ts +55 -21
  90. package/src/get-tracks.ts +6 -6
  91. package/src/get-video-codec.ts +13 -15
  92. package/src/has-all-info.ts +1 -1
  93. package/src/parse-media.ts +7 -2
  94. package/src/parse-result.ts +7 -1
  95. package/src/parser-context.ts +1 -0
  96. package/src/parser-state.ts +2 -2
  97. package/src/samples-from-moof.ts +101 -0
  98. package/src/test/create-matroska.test.ts +237 -23
  99. package/src/test/matroska.test.ts +283 -348
  100. package/src/test/mvhd.test.ts +1 -1
  101. package/src/test/parse-esds.test.ts +2 -2
  102. package/src/test/parse-stco.test.ts +2 -2
  103. package/src/test/parse-stsc.test.ts +2 -2
  104. package/src/test/parse-stsz.test.ts +2 -2
  105. package/src/test/parse-stts.test.ts +1 -1
  106. package/src/test/samples-from-moof.test.ts +2496 -0
  107. package/src/test/stream-local.test.ts +28 -30
  108. package/src/test/stream-samples.test.ts +153 -231
  109. package/src/test/stsd.test.ts +4 -2
  110. package/src/test/tkhd.test.ts +1 -1
  111. package/src/traversal.ts +118 -86
  112. package/tsconfig.tsbuildinfo +1 -1
  113. package/dist/bitstream/av1.d.ts +0 -2
  114. package/dist/bitstream/av1.js +0 -12
  115. package/dist/boxes/iso-base-media/avcc-hvcc.d.ts +0 -20
  116. package/dist/boxes/iso-base-media/avcc-hvcc.js +0 -73
  117. package/dist/boxes/iso-base-media/avcc.d.ts +0 -18
  118. package/dist/boxes/iso-base-media/avcc.js +0 -27
  119. package/dist/boxes/iso-base-media/esds-descriptors.d.ts +0 -21
  120. package/dist/boxes/iso-base-media/esds-descriptors.js +0 -62
  121. package/dist/boxes/iso-base-media/esds.d.ts +0 -15
  122. package/dist/boxes/iso-base-media/esds.js +0 -27
  123. package/dist/from-input-type-file.d.ts +0 -2
  124. package/dist/from-input-type-file.js +0 -37
  125. package/dist/get-codec.d.ts +0 -4
  126. package/dist/get-codec.js +0 -22
  127. package/dist/web-file.d.ts +0 -2
  128. package/dist/web-file.js +0 -37
  129. package/src/boxes/webm/segments/duration.ts +0 -29
  130. package/src/boxes/webm/segments/info.ts +0 -34
  131. package/src/boxes/webm/segments/main.ts +0 -6
  132. package/src/boxes/webm/segments/muxing.ts +0 -18
  133. package/src/boxes/webm/segments/seek-head.ts +0 -34
  134. package/src/boxes/webm/segments/seek-position.ts +0 -18
  135. package/src/boxes/webm/segments/seek.ts +0 -55
  136. package/src/boxes/webm/segments/timestamp-scale.ts +0 -17
  137. package/src/boxes/webm/segments/tracks.ts +0 -32
  138. package/src/boxes/webm/segments/void.ts +0 -18
  139. package/src/boxes/webm/segments/writing.ts +0 -18
  140. package/src/combine-uint8array.ts +0 -13
  141. /package/dist/{get-samples.d.ts → boxes/webm/bitstream/av1/frame.d.ts} +0 -0
  142. /package/dist/{get-samples.js → boxes/webm/bitstream/av1/frame.js} +0 -0
  143. /package/dist/{sample-aspect-ratio.d.ts → boxes/webm/bitstream/h264/get-h264-descriptor.d.ts} +0 -0
  144. /package/dist/{sample-aspect-ratio.js → boxes/webm/bitstream/h264/get-h264-descriptor.js} +0 -0
@@ -1,3 +1,4 @@
1
+ import type { Prettify } from '../parse-ebml';
1
2
  export declare const matroskaElements: {
2
3
  readonly Header: "0x1a45dfa3";
3
4
  readonly EBMLMaxIDLength: "0x42f2";
@@ -273,16 +274,15 @@ export declare const knownIdsWithOneLength: string[];
273
274
  export declare const knownIdsWithTwoLength: string[];
274
275
  export declare const knownIdsWithThreeLength: string[];
275
276
  export declare const getSegmentName: (id: string) => string | undefined;
276
- export declare const getIdForName: (name: string) => "0x1a45dfa3" | "0x42f2" | "0x4286" | "0x42f7" | "0x42f3" | "0x4282" | "0x4287" | "0x4285" | "0x18538067" | "0x114d9b74" | "0x4dbb" | "0x53ab" | "0x53ac" | "0x1549a966" | "0x73a4" | "0x7384" | "0x3cb923" | "0x3c83ab" | "0x3eb923" | "0x3e83bb" | "0x4444" | "0x6924" | "0x69a5" | "0x69bf" | "0x69fc" | "0x2ad7b1" | "0x4489" | "0x4461" | "0x7ba9" | "0x4d80" | "0x5741" | "0x1f43b675" | "0xe7" | "0x5854" | "0x58d7" | "0xa7" | "0xab" | "0xa3" | "0xa0" | "0xa1" | "0xa2" | "0x75a1" | "0xa6" | "0xa5" | "0xee" | "0x9b" | "0xfa" | "0xfb" | "0xfd" | "0xa4" | "0x75a2" | "0x8e" | "0xe8" | "0xcc" | "0xcd" | "0xcb" | "0xce" | "0xcf" | "0xc8" | "0xc9" | "0xca" | "0xaf" | "0x1654ae6b" | "0xae" | "0xd7" | "0x73c5" | "0x83" | "0xb9" | "0x88" | "0x55aa" | "0x55ab" | "0x55ac" | "0x55ad" | "0x55ae" | "0x55af" | "0x9c" | "0x6de7" | "0x6df8" | "0x23e383" | "0x234e7a" | "0x23314f" | "0x537f" | "0x55ee" | "0x41e4" | "0x41f0" | "0x41a4" | "0x41e7" | "0x41ed" | "0x536e" | "0x22b59c" | "0x22b59d" | "0x86" | "0x63a2" | "0x258688" | "0x7446" | "0x3a9697" | "0x3b4040" | "0x26b240" | "0xaa" | "0x6fab" | "0x56aa" | "0x56bb" | "0x6624" | "0x66a5" | "0x66bf" | "0x66fc" | "0xe0" | "0x9a" | "0x9d" | "0x53b8" | "0x53c0" | "0x53b9" | "0xb0" | "0xba" | "0x54aa" | "0x54bb" | "0x54cc" | "0x54dd" | "0x54b0" | "0x54ba" | "0x54b2" | "0x54b3" | "0x2eb524" | "0x2fb523" | "0x2383e3" | "0x55b0" | "0x55b1" | "0x55b2" | "0x55b3" | "0x55b4" | "0x55b5" | "0x55b6" | "0x55b7" | "0x55b8" | "0x55b9" | "0x55ba" | "0x55bb" | "0x55bc" | "0x55bd" | "0x55d0" | "0x55d1" | "0x55d2" | "0x55d3" | "0x55d4" | "0x55d5" | "0x55d6" | "0x55d7" | "0x55d8" | "0x55d9" | "0x55da" | "0x7670" | "0x7671" | "0x7672" | "0x7673" | "0x7674" | "0x7675" | "0xe1" | "0xb5" | "0x78b5" | "0x9f" | "0x7d7b" | "0x6264" | "0x52f1" | "0xe2" | "0xe3" | "0xe4" | "0xe5" | "0xe6" | "0xe9" | "0xed" | "0xc0" | "0xc1" | "0xc6" | "0xc7" | "0xc4" | "0x6d80" | "0x6240" | "0x5031" | "0x5032" | "0x5033" | "0x5034" | "0x4254" | "0x4255" | "0x5035" | "0x47e1" | "0x47e2" | "0x47e7" | "0x47e8" | "0x47e3" | "0x47e4" | "0x47e5" | "0x47e6" | "0x1c53bb6b" | "0xbb" | "0xb3" | "0xb7" | "0xf7" | "0xf1" | "0xf0" | "0xb2" | "0x5378" | "0xea" | "0xdb" | "0x96" | "0x97" | "0x535f" | "0xeb" | "0x1941a469" | "0x61a7" | "0x467e" | "0x466e" | "0x4660" | "0x465c" | "0x46ae" | "0x4675" | "0x4661" | "0x4662" | "0x1043a770" | "0x45b9" | "0x45bc" | "0x45bd" | "0x45db" | "0x45dd" | "0x4520" | "0x4521" | "0x45e4" | "0xb6" | "0x73c4" | "0x5654" | "0x91" | "0x92" | "0x98" | "0x4598" | "0x6e67" | "0x4588" | "0x6ebc" | "0x63c3" | "0x8f" | "0x89" | "0x80" | "0x85" | "0x437c" | "0x437d" | "0x437e" | "0x6944" | "0x6955" | "0x450d" | "0x6911" | "0x6922" | "0x6933" | "0x1254c367" | "0x7373" | "0x63c0" | "0x68ca" | "0x63ca" | "0x63c5" | "0x63c9" | "0x63c4" | "0x63c6" | "0x67c8" | "0x45a3" | "0x447a" | "0x447b" | "0x4484" | "0x44b4" | "0x4487" | "0x4485" | "0xec" | "0xbf";
277
+ export declare const getIdForName: (name: string) => EbmlMapKey;
277
278
  export type MatroskaKey = keyof typeof matroskaElements;
278
279
  export type MatroskaElement = (typeof matroskaElements)[MatroskaKey];
279
280
  type EbmlType = 'string';
280
281
  export type EbmlWithChildren = {
281
282
  name: MatroskaKey;
282
283
  type: 'children';
283
- children: HeaderStructure;
284
284
  };
285
- export type EbmlWithUint8 = {
285
+ export type EbmlWithUint = {
286
286
  name: MatroskaKey;
287
287
  type: 'uint';
288
288
  };
@@ -294,15 +294,15 @@ export type EbmlWithString = {
294
294
  name: MatroskaKey;
295
295
  type: EbmlType;
296
296
  };
297
- export type EbmlWithVoid = {
298
- name: MatroskaKey;
299
- type: 'void';
300
- };
301
297
  export type EbmlWithFloat = {
302
298
  name: MatroskaKey;
303
299
  type: 'float';
304
300
  };
305
- export type Ebml = EbmlWithString | EbmlWithUint8 | EbmlWithChildren | EbmlWithVoid | EbmlWithFloat | EbmlWithHexString;
301
+ export type EbmlWithUint8Array = {
302
+ name: MatroskaKey;
303
+ type: 'uint8array';
304
+ };
305
+ export type Ebml = EbmlWithString | EbmlWithUint | EbmlWithChildren | EbmlWithFloat | EbmlWithHexString | EbmlWithUint8Array;
306
306
  export declare const ebmlVersion: {
307
307
  name: "EBMLVersion";
308
308
  type: "uint";
@@ -331,66 +331,18 @@ export declare const docTypeReadVersion: {
331
331
  name: "DocTypeReadVersion";
332
332
  type: "uint";
333
333
  };
334
- export declare const voidEbml: {
335
- name: "Void";
336
- type: "void";
337
- };
338
334
  export type EmblTypes = {
339
335
  uint: number;
340
336
  float: number;
341
337
  string: string;
342
- children: HeaderStructure;
338
+ children: Ebml[];
343
339
  void: undefined;
344
340
  'hex-string': string;
341
+ uint8array: Uint8Array;
345
342
  };
346
- export type HeaderStructure = Ebml[];
347
- export declare const matroskaHeaderStructure: [{
348
- name: "EBMLVersion";
349
- type: "uint";
350
- }, {
351
- name: "EBMLReadVersion";
352
- type: "uint";
353
- }, {
354
- name: "EBMLMaxIDLength";
355
- type: "uint";
356
- }, {
357
- name: "EBMLMaxSizeLength";
358
- type: "uint";
359
- }, {
360
- name: "DocType";
361
- type: "string";
362
- }, {
363
- name: "DocTypeVersion";
364
- type: "uint";
365
- }, {
366
- name: "DocTypeReadVersion";
367
- type: "uint";
368
- }];
369
343
  export declare const matroskaHeader: {
370
344
  readonly name: "Header";
371
345
  readonly type: "children";
372
- readonly children: [{
373
- name: "EBMLVersion";
374
- type: "uint";
375
- }, {
376
- name: "EBMLReadVersion";
377
- type: "uint";
378
- }, {
379
- name: "EBMLMaxIDLength";
380
- type: "uint";
381
- }, {
382
- name: "EBMLMaxSizeLength";
383
- type: "uint";
384
- }, {
385
- name: "DocType";
386
- type: "string";
387
- }, {
388
- name: "DocTypeVersion";
389
- type: "uint";
390
- }, {
391
- name: "DocTypeReadVersion";
392
- type: "uint";
393
- }];
394
346
  };
395
347
  export declare const seekId: {
396
348
  readonly name: "SeekID";
@@ -403,50 +355,228 @@ export declare const seekPosition: {
403
355
  export declare const seek: {
404
356
  readonly name: "Seek";
405
357
  readonly type: "children";
406
- readonly children: [{
407
- readonly name: "SeekID";
408
- readonly type: "hex-string";
409
- }, {
410
- readonly name: "SeekPosition";
411
- readonly type: "uint";
412
- }];
358
+ };
359
+ export declare const seekHead: {
360
+ readonly name: "SeekHead";
361
+ readonly type: "children";
413
362
  };
414
363
  export declare const voidHeader: {
415
364
  readonly name: "Void";
416
- readonly type: "void";
365
+ readonly type: "uint8array";
366
+ };
367
+ export declare const codecID: {
368
+ readonly name: "CodecID";
369
+ readonly type: "string";
370
+ };
371
+ export declare const trackType: {
372
+ readonly name: "TrackType";
373
+ readonly type: "uint";
374
+ };
375
+ export declare const widthType: {
376
+ readonly name: "PixelWidth";
377
+ readonly type: "uint";
378
+ };
379
+ export declare const heightType: {
380
+ readonly name: "PixelHeight";
381
+ readonly type: "uint";
417
382
  };
418
- export type EbmlValue<T extends Ebml> = T extends EbmlWithUint8 ? number : T extends EbmlWithVoid ? undefined : T extends EbmlWithString ? string : T extends EbmlWithFloat ? number : EbmlParsed<Ebml>[];
383
+ export declare const muxingApp: {
384
+ readonly name: "MuxingApp";
385
+ readonly type: "string";
386
+ };
387
+ export declare const duration: {
388
+ readonly name: "Duration";
389
+ readonly type: "float";
390
+ };
391
+ export declare const timestampScale: {
392
+ readonly name: "TimestampScale";
393
+ readonly type: "uint";
394
+ };
395
+ export declare const writingApp: {
396
+ readonly name: "WritingApp";
397
+ readonly type: "string";
398
+ };
399
+ export declare const infoType: {
400
+ readonly name: "Info";
401
+ readonly type: "children";
402
+ };
403
+ export declare const titleType: {
404
+ readonly name: "Title";
405
+ readonly type: "string";
406
+ };
407
+ export declare const samplingFrequency: {
408
+ readonly name: "SamplingFrequency";
409
+ readonly type: "float";
410
+ };
411
+ export declare const channels: {
412
+ readonly name: "Channels";
413
+ readonly type: "uint";
414
+ };
415
+ export declare const alphaMode: {
416
+ readonly name: "AlphaMode";
417
+ readonly type: "uint";
418
+ };
419
+ export declare const interlaced: {
420
+ readonly name: "FlagInterlaced";
421
+ readonly type: "uint";
422
+ };
423
+ export declare const bitDepth: {
424
+ readonly name: "BitDepth";
425
+ readonly type: "uint";
426
+ };
427
+ export declare const displayWidth: {
428
+ readonly name: "DisplayWidth";
429
+ readonly type: "uint";
430
+ };
431
+ export declare const displayHeight: {
432
+ readonly name: "DisplayHeight";
433
+ readonly type: "uint";
434
+ };
435
+ export declare const flagLacing: {
436
+ readonly name: "FlagLacing";
437
+ readonly type: "uint";
438
+ };
439
+ export declare const tagSegment: {
440
+ readonly name: "Tag";
441
+ readonly type: "uint8array";
442
+ };
443
+ export declare const tags: {
444
+ readonly name: "Tags";
445
+ readonly type: "children";
446
+ };
447
+ export declare const trackNumber: {
448
+ readonly name: "TrackNumber";
449
+ readonly type: "uint";
450
+ };
451
+ export declare const trackUID: {
452
+ readonly name: "TrackUID";
453
+ readonly type: "hex-string";
454
+ };
455
+ export declare const color: {
456
+ readonly name: "Colour";
457
+ readonly type: "uint8array";
458
+ };
459
+ export declare const language: {
460
+ readonly name: "Language";
461
+ readonly type: "string";
462
+ };
463
+ export declare const defaultDuration: {
464
+ readonly name: "DefaultDuration";
465
+ readonly type: "uint";
466
+ };
467
+ export declare const codecPrivate: {
468
+ readonly name: "CodecPrivate";
469
+ readonly type: "uint8array";
470
+ };
471
+ export declare const blockAdditionsSegment: {
472
+ readonly name: "BlockAdditions";
473
+ readonly type: "uint8array";
474
+ };
475
+ export declare const maxBlockAdditionIdSegment: {
476
+ readonly name: "MaxBlockAdditionID";
477
+ readonly type: "uint";
478
+ };
479
+ export declare const audioSegment: {
480
+ readonly name: "Audio";
481
+ readonly type: "children";
482
+ };
483
+ export declare const videoSegment: {
484
+ readonly name: "Video";
485
+ readonly type: "children";
486
+ };
487
+ export declare const flagDefault: {
488
+ readonly name: "FlagDefault";
489
+ readonly type: "uint8array";
490
+ };
491
+ export declare const referenceBlock: {
492
+ readonly name: "ReferenceBlock";
493
+ readonly type: "uint";
494
+ };
495
+ export declare const blockElement: {
496
+ readonly name: "Block";
497
+ readonly type: "uint8array";
498
+ };
499
+ export declare const codecName: {
500
+ readonly name: "CodecName";
501
+ readonly type: "string";
502
+ };
503
+ export declare const trackTimestampScale: {
504
+ readonly name: "TrackTimestampScale";
505
+ readonly type: "float";
506
+ };
507
+ export declare const trackEntry: {
508
+ readonly name: "TrackEntry";
509
+ readonly type: "children";
510
+ };
511
+ export declare const tracks: {
512
+ readonly name: "Tracks";
513
+ readonly type: "children";
514
+ };
515
+ export declare const timestampEntry: {
516
+ readonly name: "Timestamp";
517
+ readonly type: "uint";
518
+ };
519
+ export declare const block: {
520
+ readonly name: "Block";
521
+ readonly type: "uint8array";
522
+ };
523
+ export declare const simpleBlock: {
524
+ readonly name: "SimpleBlock";
525
+ readonly type: "uint8array";
526
+ };
527
+ export declare const blockGroup: {
528
+ readonly name: "BlockGroup";
529
+ readonly type: "children";
530
+ };
531
+ export declare const segment: {
532
+ readonly name: "Segment";
533
+ readonly type: "children";
534
+ };
535
+ export declare const cluster: {
536
+ readonly name: "Cluster";
537
+ readonly type: "children";
538
+ };
539
+ export type CodecIdSegment = EbmlParsed<typeof codecID>;
540
+ export type TrackTypeSegment = EbmlParsed<typeof trackType>;
541
+ export type WidthSegment = EbmlParsed<typeof widthType>;
542
+ export type HeightSegment = EbmlParsed<typeof heightType>;
543
+ export type TimestampScaleSegment = EbmlParsed<typeof timestampScale>;
544
+ export type DurationSegment = EbmlParsed<typeof duration>;
545
+ export type DisplayWidthSegment = EbmlParsed<typeof displayWidth>;
546
+ export type DisplayHeightSegment = EbmlParsed<typeof displayHeight>;
547
+ export type TrackNumberSegment = EbmlParsed<typeof trackNumber>;
548
+ export type AudioSegment = EbmlParsed<typeof audioSegment>;
549
+ export type VideoSegment = EbmlParsed<typeof videoSegment>;
550
+ export type TrackEntry = EbmlParsed<typeof trackEntry>;
551
+ export type BlockSegment = EbmlParsed<typeof block>;
552
+ export type SimpleBlockSegment = EbmlParsed<typeof simpleBlock>;
553
+ export type MainSegment = EbmlParsed<typeof segment>;
554
+ export type ClusterSegment = EbmlParsed<typeof cluster>;
555
+ export type Tracks = EbmlParsed<typeof tracks>;
556
+ export type FloatWithSize = {
557
+ value: number;
558
+ size: '32' | '64';
559
+ };
560
+ export type UintWithSize = {
561
+ value: number;
562
+ byteLength: number;
563
+ };
564
+ export type EbmlValue<T extends Ebml, Child = PossibleEbml> = T extends EbmlWithUint ? UintWithSize : T extends EbmlWithString ? string : T extends EbmlWithFloat ? FloatWithSize : T extends EbmlWithHexString ? string : T extends EbmlWithUint8Array ? Uint8Array : T extends EbmlWithChildren ? Child[] : never;
565
+ export type EbmlValueOrUint8Array<T extends Ebml> = Uint8Array | EbmlValue<T, PossibleEbmlOrUint8Array>;
419
566
  export type EbmlParsed<T extends Ebml> = {
420
567
  type: T['name'];
421
568
  value: EbmlValue<T>;
422
- hex: string;
569
+ minVintWidth: number;
570
+ };
571
+ export type EbmlParsedOrUint8Array<T extends Ebml> = {
572
+ type: T['name'];
573
+ value: EbmlValueOrUint8Array<T>;
574
+ minVintWidth: number;
423
575
  };
424
576
  export declare const ebmlMap: {
425
577
  readonly "0x1a45dfa3": {
426
578
  readonly name: "Header";
427
579
  readonly type: "children";
428
- readonly children: [{
429
- name: "EBMLVersion";
430
- type: "uint";
431
- }, {
432
- name: "EBMLReadVersion";
433
- type: "uint";
434
- }, {
435
- name: "EBMLMaxIDLength";
436
- type: "uint";
437
- }, {
438
- name: "EBMLMaxSizeLength";
439
- type: "uint";
440
- }, {
441
- name: "DocType";
442
- type: "string";
443
- }, {
444
- name: "DocTypeVersion";
445
- type: "uint";
446
- }, {
447
- name: "DocTypeReadVersion";
448
- type: "uint";
449
- }];
450
580
  };
451
581
  readonly "0x4282": {
452
582
  name: "DocType";
@@ -478,15 +608,15 @@ export declare const ebmlMap: {
478
608
  };
479
609
  readonly "0xec": {
480
610
  name: "Void";
481
- type: "void";
611
+ type: "uint8array";
482
612
  };
483
613
  readonly "0x1c53bb6b": {
484
614
  readonly name: "Cues";
485
- readonly type: "void";
615
+ readonly type: "uint8array";
486
616
  };
487
617
  readonly "0x4461": {
488
618
  readonly name: "DateUTC";
489
- readonly type: "void";
619
+ readonly type: "uint8array";
490
620
  };
491
621
  readonly "0x23314f": {
492
622
  readonly name: "TrackTimestampScale";
@@ -494,38 +624,222 @@ export declare const ebmlMap: {
494
624
  };
495
625
  readonly "0x56aa": {
496
626
  readonly name: "CodecDelay";
497
- readonly type: "void";
627
+ readonly type: "uint8array";
498
628
  };
499
629
  readonly "0x56bb": {
500
630
  readonly name: "SeekPreRoll";
501
- readonly type: "void";
631
+ readonly type: "uint8array";
502
632
  };
503
633
  readonly "0x75a2": {
504
634
  readonly name: "DiscardPadding";
505
- readonly type: "void";
635
+ readonly type: "uint8array";
506
636
  };
507
637
  readonly "0x78b5": {
508
638
  readonly name: "OutputSamplingFrequency";
509
- readonly type: "void";
639
+ readonly type: "uint8array";
510
640
  };
511
641
  readonly "0x258688": {
512
642
  readonly name: "CodecName";
513
- readonly type: "void";
643
+ readonly type: "string";
514
644
  };
515
645
  readonly "0xa7": {
516
646
  readonly name: "Position";
517
- readonly type: "void";
647
+ readonly type: "uint8array";
518
648
  };
519
649
  readonly "0xcf": {
520
650
  readonly name: "SliceDuration";
521
- readonly type: "void";
651
+ readonly type: "uint8array";
522
652
  };
523
- };
524
- export type PossibleEbml = {
525
- [key in keyof typeof ebmlMap]: {
526
- type: (typeof ebmlMap)[key]['name'];
527
- value: EbmlValue<(typeof ebmlMap)[key]>;
528
- hex: string;
653
+ readonly "0x114d9b74": {
654
+ readonly name: "SeekHead";
655
+ readonly type: "children";
656
+ };
657
+ readonly "0x4dbb": {
658
+ readonly name: "Seek";
659
+ readonly type: "children";
660
+ };
661
+ readonly "0x53ab": {
662
+ readonly name: "SeekID";
663
+ readonly type: "hex-string";
664
+ };
665
+ readonly "0x53ac": {
666
+ readonly name: "SeekPosition";
667
+ readonly type: "uint";
668
+ };
669
+ readonly "0xbf": {
670
+ readonly name: "Crc32";
671
+ readonly type: "uint8array";
672
+ };
673
+ readonly "0x4d80": {
674
+ readonly name: "MuxingApp";
675
+ readonly type: "string";
676
+ };
677
+ readonly "0x5741": {
678
+ readonly name: "WritingApp";
679
+ readonly type: "string";
680
+ };
681
+ readonly "0x73a4": {
682
+ readonly name: "SegmentUUID";
683
+ readonly type: "string";
684
+ };
685
+ readonly "0x4489": {
686
+ readonly name: "Duration";
687
+ readonly type: "float";
688
+ };
689
+ readonly "0x86": {
690
+ readonly name: "CodecID";
691
+ readonly type: "string";
692
+ };
693
+ readonly "0x83": {
694
+ readonly name: "TrackType";
695
+ readonly type: "uint";
696
+ };
697
+ readonly "0xb0": {
698
+ readonly name: "PixelWidth";
699
+ readonly type: "uint";
700
+ };
701
+ readonly "0xba": {
702
+ readonly name: "PixelHeight";
703
+ readonly type: "uint";
704
+ };
705
+ readonly "0x2ad7b1": {
706
+ readonly name: "TimestampScale";
707
+ readonly type: "uint";
708
+ };
709
+ readonly "0x1549a966": {
710
+ readonly name: "Info";
711
+ readonly type: "children";
712
+ };
713
+ readonly "0x7ba9": {
714
+ readonly name: "Title";
715
+ readonly type: "string";
716
+ };
717
+ readonly "0xb5": {
718
+ readonly name: "SamplingFrequency";
719
+ readonly type: "float";
720
+ };
721
+ readonly "0x9f": {
722
+ readonly name: "Channels";
723
+ readonly type: "uint";
724
+ };
725
+ readonly "0x53c0": {
726
+ readonly name: "AlphaMode";
727
+ readonly type: "uint";
728
+ };
729
+ readonly "0x9a": {
730
+ readonly name: "FlagInterlaced";
731
+ readonly type: "uint";
732
+ };
733
+ readonly "0x6264": {
734
+ readonly name: "BitDepth";
735
+ readonly type: "uint";
736
+ };
737
+ readonly "0x54ba": {
738
+ readonly name: "DisplayHeight";
739
+ readonly type: "uint";
740
+ };
741
+ readonly "0x54b0": {
742
+ readonly name: "DisplayWidth";
743
+ readonly type: "uint";
744
+ };
745
+ readonly "0x9c": {
746
+ readonly name: "FlagLacing";
747
+ readonly type: "uint";
748
+ };
749
+ readonly "0x1254c367": {
750
+ readonly name: "Tags";
751
+ readonly type: "children";
752
+ };
753
+ readonly "0x7373": {
754
+ readonly name: "Tag";
755
+ readonly type: "uint8array";
756
+ };
757
+ readonly "0xd7": {
758
+ readonly name: "TrackNumber";
759
+ readonly type: "uint";
760
+ };
761
+ readonly "0x73c5": {
762
+ readonly name: "TrackUID";
763
+ readonly type: "hex-string";
764
+ };
765
+ readonly "0x55b0": {
766
+ readonly name: "Colour";
767
+ readonly type: "uint8array";
768
+ };
769
+ readonly "0x22b59c": {
770
+ readonly name: "Language";
771
+ readonly type: "string";
772
+ };
773
+ readonly "0x23e383": {
774
+ readonly name: "DefaultDuration";
775
+ readonly type: "uint";
776
+ };
777
+ readonly "0x63a2": {
778
+ readonly name: "CodecPrivate";
779
+ readonly type: "uint8array";
780
+ };
781
+ readonly "0x75a1": {
782
+ readonly name: "BlockAdditions";
783
+ readonly type: "uint8array";
529
784
  };
530
- }[keyof typeof ebmlMap];
785
+ readonly "0x55ee": {
786
+ readonly name: "MaxBlockAdditionID";
787
+ readonly type: "uint";
788
+ };
789
+ readonly "0xe1": {
790
+ readonly name: "Audio";
791
+ readonly type: "children";
792
+ };
793
+ readonly "0xe0": {
794
+ readonly name: "Video";
795
+ readonly type: "children";
796
+ };
797
+ readonly "0x88": {
798
+ readonly name: "FlagDefault";
799
+ readonly type: "uint8array";
800
+ };
801
+ readonly "0xfb": {
802
+ readonly name: "ReferenceBlock";
803
+ readonly type: "uint";
804
+ };
805
+ readonly "0xae": {
806
+ readonly name: "TrackEntry";
807
+ readonly type: "children";
808
+ };
809
+ readonly "0xe7": {
810
+ readonly name: "Timestamp";
811
+ readonly type: "uint";
812
+ };
813
+ readonly "0x1654ae6b": {
814
+ readonly name: "Tracks";
815
+ readonly type: "children";
816
+ };
817
+ readonly "0xa1": {
818
+ readonly name: "Block";
819
+ readonly type: "uint8array";
820
+ };
821
+ readonly "0xa3": {
822
+ readonly name: "SimpleBlock";
823
+ readonly type: "uint8array";
824
+ };
825
+ readonly "0xa0": {
826
+ readonly name: "BlockGroup";
827
+ readonly type: "children";
828
+ };
829
+ readonly "0x18538067": {
830
+ readonly name: "Segment";
831
+ readonly type: "children";
832
+ };
833
+ readonly "0x1f43b675": {
834
+ readonly name: "Cluster";
835
+ readonly type: "children";
836
+ };
837
+ };
838
+ export type PossibleEbml = Prettify<{
839
+ [key in keyof typeof ebmlMap]: EbmlParsed<(typeof ebmlMap)[key]>;
840
+ }[keyof typeof ebmlMap]>;
841
+ export type PossibleEbmlOrUint8Array = Prettify<{
842
+ [key in keyof typeof ebmlMap]: EbmlParsedOrUint8Array<(typeof ebmlMap)[key]>;
843
+ }[keyof typeof ebmlMap]> | Uint8Array;
844
+ export type EbmlMapKey = keyof typeof ebmlMap;
531
845
  export {};