@remotion/webcodecs 4.0.287 → 4.0.289

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 (79) hide show
  1. package/dist/audio-data/data-types.d.ts +1 -0
  2. package/dist/audio-data/data-types.js +26 -0
  3. package/dist/audio-data/is-planar-format.d.ts +1 -0
  4. package/dist/audio-data/is-planar-format.js +7 -0
  5. package/dist/audio-encoder.js +5 -1
  6. package/dist/can-reencode-audio-track.d.ts +2 -1
  7. package/dist/can-reencode-audio-track.js +2 -2
  8. package/dist/convert-audiodata.d.ts +10 -0
  9. package/dist/convert-audiodata.js +85 -0
  10. package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.js +8 -0
  11. package/dist/create/iso-base-media/create-iso-base-media.js +2 -0
  12. package/dist/create/iso-base-media/example-stts.js +620 -0
  13. package/dist/create/matroska/create-matroska-media.js +1 -1
  14. package/dist/create/matroska/matroska-utils.d.ts +1 -1
  15. package/dist/default-on-audio-track-handler.js +2 -0
  16. package/dist/esm/index.mjs +176 -15
  17. package/dist/get-wave-audio-decoder.js +29 -1
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +3 -1
  20. package/dist/on-audio-track-handler.d.ts +1 -0
  21. package/dist/on-audio-track.js +3 -3
  22. package/dist/resample-audiodata.d.ts +4 -0
  23. package/dist/resample-audiodata.js +35 -0
  24. package/dist/select-container-creator.d.ts +1 -1
  25. package/dist/wav-audio-encoder.d.ts +1 -1
  26. package/dist/wav-audio-encoder.js +11 -4
  27. package/package.json +12 -7
  28. package/dist/test/avc1.test.d.ts +0 -1
  29. package/dist/test/avc1.test.js +0 -39
  30. package/dist/test/avcc.test.d.ts +0 -1
  31. package/dist/test/avcc.test.js +0 -15
  32. package/dist/test/avi-to-mp4.test.d.ts +0 -1
  33. package/dist/test/avi-to-mp4.test.js +0 -15
  34. package/dist/test/cmt.test.d.ts +0 -1
  35. package/dist/test/cmt.test.js +0 -13
  36. package/dist/test/colr.test.d.ts +0 -1
  37. package/dist/test/colr.test.js +0 -16
  38. package/dist/test/correct-byte-length.test.d.ts +0 -1
  39. package/dist/test/correct-byte-length.test.js +0 -23
  40. package/dist/test/create-ftyp.test.d.ts +0 -1
  41. package/dist/test/create-ftyp.test.js +0 -47
  42. package/dist/test/create-mvhd.test.d.ts +0 -1
  43. package/dist/test/create-mvhd.test.js +0 -108
  44. package/dist/test/ctts.test.d.ts +0 -1
  45. package/dist/test/ctts.test.js +0 -49
  46. package/dist/test/dinf.test.d.ts +0 -1
  47. package/dist/test/dinf.test.js +0 -12
  48. package/dist/test/ilst.test.d.ts +0 -1
  49. package/dist/test/ilst.test.js +0 -22
  50. package/dist/test/mdhd.test.d.ts +0 -1
  51. package/dist/test/mdhd.test.js +0 -17
  52. package/dist/test/meta.test.d.ts +0 -1
  53. package/dist/test/meta.test.js +0 -26
  54. package/dist/test/mp4-header-length.test.d.ts +0 -1
  55. package/dist/test/mp4-header-length.test.js +0 -12
  56. package/dist/test/mp4a.test.d.ts +0 -1
  57. package/dist/test/mp4a.test.js +0 -24
  58. package/dist/test/pasp.test.d.ts +0 -1
  59. package/dist/test/pasp.test.js +0 -12
  60. package/dist/test/remux-serverside.test.d.ts +0 -1
  61. package/dist/test/remux-serverside.test.js +0 -23
  62. package/dist/test/stbl.test.d.ts +0 -0
  63. package/dist/test/stbl.test.js +0 -176
  64. package/dist/test/stco.test.d.ts +0 -1
  65. package/dist/test/stco.test.js +0 -34
  66. package/dist/test/stsc.test.d.ts +0 -1
  67. package/dist/test/stsc.test.js +0 -63
  68. package/dist/test/stss.test.d.ts +0 -1
  69. package/dist/test/stss.test.js +0 -14
  70. package/dist/test/stsz.test.d.ts +0 -1
  71. package/dist/test/stsz.test.js +0 -43
  72. package/dist/test/stts.test.d.ts +0 -1
  73. package/dist/test/stts.test.js +0 -12
  74. package/dist/test/tkhd.test.d.ts +0 -1
  75. package/dist/test/tkhd.test.js +0 -175
  76. package/dist/test/too.test.d.ts +0 -1
  77. package/dist/test/too.test.js +0 -12
  78. package/dist/test/url.test.d.ts +0 -1
  79. package/dist/test/url.test.js +0 -11
@@ -1,176 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- if (process.platform !== 'win32') {
36
- // @ts-expect-error
37
- const { expect, test } = await Promise.resolve().then(() => __importStar(require('bun:test')));
38
- // @ts-expect-error
39
- const { createAvc1Data } = await Promise.resolve().then(() => __importStar(require('../create/iso-base-media/codec-specific/avc1')));
40
- // @ts-expect-error
41
- const { exampleVideoSamplePositions } = await Promise.resolve().then(() => __importStar(require('../create/iso-base-media/example-stts')));
42
- // @ts-expect-error
43
- const { createStbl } = await Promise.resolve().then(() => __importStar(require('../create/iso-base-media/trak/mdia/minf/create-stbl')));
44
- // @ts-expect-error
45
- const { createAvccBox } = await Promise.resolve().then(() => __importStar(require('../create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avcc')));
46
- // @ts-expect-error
47
- const { createPasp } = await Promise.resolve().then(() => __importStar(require('../create/iso-base-media/trak/mdia/minf/stbl/stsd/create-pasp')));
48
- const sample = new Uint8Array([
49
- 0, 0, 8, 125, 115, 116, 98, 108, 0, 0, 0, 177, 115, 116, 115, 100, 0, 0, 0,
50
- 0, 0, 0, 0, 1, 0, 0, 0, 161, 97, 118, 99, 49, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
51
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 128, 1, 104, 0, 72, 0, 0, 0,
52
- 72, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
53
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 255, 255, 0, 0, 0,
54
- 59, 97, 118, 99, 67, 1, 100, 0, 30, 255, 225, 0, 30, 103, 100, 0, 30, 172,
55
- 217, 64, 160, 47, 249, 112, 22, 224, 64, 64, 180, 160, 0, 0, 3, 0, 32, 0, 0,
56
- 7, 129, 226, 197, 178, 192, 1, 0, 6, 104, 235, 224, 140, 178, 44, 253, 248,
57
- 248, 0, 0, 0, 0, 16, 112, 97, 115, 112, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 24,
58
- 115, 116, 116, 115, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0, 11, 184, 0,
59
- 0, 0, 40, 115, 116, 115, 115, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0,
60
- 21, 0, 0, 0, 41, 0, 0, 0, 61, 0, 0, 0, 81, 0, 0, 0, 101, 0, 0, 3, 128, 99,
61
- 116, 116, 115, 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0,
62
- 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
63
- 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0,
64
- 0, 0, 1, 0, 0, 46, 224, 0, 0, 0, 2, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40,
65
- 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58,
66
- 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
67
- 11, 184, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0, 0, 2, 0, 0, 11, 184, 0, 0, 0, 1,
68
- 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0,
69
- 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 3, 0, 0, 23, 112, 0, 0,
70
- 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 58, 152, 0,
71
- 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184,
72
- 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0,
73
- 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0,
74
- 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0,
75
- 0, 11, 184, 0, 0, 0, 2, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0,
76
- 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0,
77
- 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0,
78
- 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 2, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 46,
79
- 224, 0, 0, 0, 2, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0,
80
- 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0,
81
- 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0, 0,
82
- 2, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0,
83
- 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184,
84
- 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0,
85
- 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0,
86
- 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0,
87
- 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0,
88
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0,
89
- 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0,
90
- 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184,
91
- 0, 0, 0, 2, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23,
92
- 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0,
93
- 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0,
94
- 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
95
- 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0,
96
- 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0,
97
- 0, 2, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0,
98
- 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40,
99
- 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11,
100
- 184, 0, 0, 0, 40, 115, 116, 115, 99, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
101
- 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 244, 115,
102
- 116, 115, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 30, 78, 0, 0, 12,
103
- 118, 0, 0, 6, 88, 0, 0, 3, 102, 0, 0, 2, 226, 0, 0, 11, 254, 0, 0, 3, 26, 0,
104
- 0, 11, 220, 0, 0, 3, 185, 0, 0, 2, 211, 0, 0, 13, 169, 0, 0, 3, 117, 0, 0,
105
- 10, 226, 0, 0, 21, 209, 0, 0, 11, 136, 0, 0, 5, 158, 0, 0, 10, 7, 0, 0, 13,
106
- 159, 0, 0, 10, 129, 0, 0, 6, 243, 0, 0, 54, 116, 0, 0, 15, 32, 0, 0, 5, 204,
107
- 0, 0, 15, 147, 0, 0, 6, 253, 0, 0, 15, 32, 0, 0, 13, 193, 0, 0, 14, 115, 0,
108
- 0, 14, 228, 0, 0, 5, 180, 0, 0, 17, 151, 0, 0, 7, 46, 0, 0, 4, 240, 0, 0, 4,
109
- 176, 0, 0, 13, 68, 0, 0, 9, 26, 0, 0, 4, 70, 0, 0, 4, 175, 0, 0, 7, 72, 0,
110
- 0, 3, 136, 0, 0, 61, 1, 0, 0, 18, 142, 0, 0, 4, 82, 0, 0, 9, 162, 0, 0, 11,
111
- 163, 0, 0, 21, 234, 0, 0, 7, 237, 0, 0, 2, 245, 0, 0, 3, 76, 0, 0, 20, 46,
112
- 0, 0, 5, 116, 0, 0, 3, 49, 0, 0, 4, 116, 0, 0, 9, 119, 0, 0, 9, 53, 0, 0,
113
- 12, 109, 0, 0, 4, 64, 0, 0, 3, 172, 0, 0, 7, 105, 0, 0, 3, 228, 0, 0, 75,
114
- 172, 0, 0, 11, 57, 0, 0, 3, 226, 0, 0, 8, 119, 0, 0, 9, 75, 0, 0, 3, 109, 0,
115
- 0, 2, 156, 0, 0, 5, 241, 0, 0, 7, 155, 0, 0, 3, 111, 0, 0, 2, 28, 0, 0, 2,
116
- 117, 0, 0, 5, 157, 0, 0, 3, 114, 0, 0, 2, 44, 0, 0, 2, 21, 0, 0, 3, 70, 0,
117
- 0, 3, 88, 0, 0, 1, 210, 0, 0, 2, 1, 0, 0, 76, 94, 0, 0, 7, 98, 0, 0, 3, 108,
118
- 0, 0, 1, 236, 0, 0, 2, 81, 0, 0, 6, 121, 0, 0, 3, 157, 0, 0, 2, 128, 0, 0,
119
- 3, 16, 0, 0, 5, 75, 0, 0, 6, 88, 0, 0, 3, 101, 0, 0, 5, 117, 0, 0, 5, 92, 0,
120
- 0, 5, 150, 0, 0, 5, 101, 0, 0, 2, 209, 0, 0, 4, 32, 0, 0, 4, 136, 0, 0, 3,
121
- 172, 0, 0, 77, 246, 0, 0, 9, 144, 0, 0, 4, 2, 0, 0, 2, 39, 0, 0, 1, 144, 0,
122
- 0, 6, 195, 0, 0, 1, 130, 0, 0, 4, 141, 0, 0, 1, 149, 0, 0, 3, 218, 0, 0, 1,
123
- 231, 0, 0, 1, 164, 0, 0, 3, 124, 0, 0, 1, 122, 0, 0, 3, 17, 0, 0, 1, 62, 0,
124
- 0, 2, 117, 0, 0, 1, 45, 0, 0, 4, 199, 0, 0, 2, 48, 0, 0, 1, 232, 115, 116,
125
- 99, 111, 0, 0, 0, 0, 0, 0, 0, 118, 0, 0, 22, 167, 0, 0, 78, 95, 0, 0, 88,
126
- 98, 0, 0, 94, 146, 0, 0, 113, 45, 0, 0, 119, 149, 0, 0, 138, 14, 0, 0, 145,
127
- 21, 0, 0, 154, 133, 0, 0, 174, 203, 0, 0, 181, 142, 0, 0, 199, 13, 0, 0,
128
- 224, 44, 0, 0, 242, 81, 0, 0, 251, 61, 0, 1, 11, 225, 0, 1, 28, 206, 0, 1,
129
- 45, 236, 0, 1, 59, 123, 0, 1, 117, 62, 0, 1, 138, 250, 0, 1, 148, 20, 0, 1,
130
- 170, 68, 0, 1, 180, 143, 0, 1, 202, 76, 0, 1, 222, 169, 0, 1, 240, 107, 0,
131
- 2, 5, 235, 0, 2, 14, 238, 0, 2, 39, 33, 0, 2, 49, 158, 0, 2, 61, 42, 0, 2,
132
- 69, 41, 0, 2, 89, 9, 0, 2, 104, 192, 0, 2, 112, 84, 0, 2, 123, 160, 0, 2,
133
- 134, 54, 0, 2, 144, 91, 0, 2, 208, 170, 0, 2, 233, 213, 0, 2, 244, 195, 0,
134
- 3, 1, 179, 0, 3, 19, 243, 0, 3, 45, 43, 0, 3, 59, 181, 0, 3, 65, 248, 0, 3,
135
- 75, 225, 0, 3, 99, 93, 0, 3, 111, 110, 0, 3, 121, 60, 0, 3, 128, 254, 0, 3,
136
- 145, 18, 0, 3, 157, 149, 0, 3, 176, 159, 0, 3, 184, 45, 0, 3, 194, 118, 0,
137
- 3, 208, 123, 0, 3, 215, 174, 0, 4, 41, 246, 0, 4, 56, 126, 0, 4, 66, 252, 0,
138
- 4, 78, 193, 0, 4, 94, 169, 0, 4, 101, 100, 0, 4, 110, 157, 0, 4, 123, 43, 0,
139
- 4, 134, 20, 0, 4, 144, 32, 0, 4, 149, 138, 0, 4, 158, 156, 0, 4, 167, 135,
140
- 0, 4, 177, 150, 0, 4, 186, 94, 0, 4, 191, 194, 0, 4, 201, 164, 0, 4, 208,
141
- 75, 0, 4, 216, 185, 0, 4, 222, 9, 0, 5, 49, 3, 0, 5, 59, 180, 0, 5, 69, 188,
142
- 0, 5, 78, 69, 0, 5, 83, 228, 0, 5, 96, 250, 0, 5, 103, 229, 0, 5, 113, 2, 0,
143
- 5, 119, 96, 0, 5, 131, 72, 0, 5, 144, 60, 0, 5, 150, 240, 0, 5, 163, 1, 0,
144
- 5, 171, 172, 0, 5, 183, 222, 0, 5, 192, 146, 0, 5, 201, 255, 0, 5, 209, 110,
145
- 0, 5, 220, 146, 0, 5, 230, 219, 0, 6, 56, 31, 0, 6, 72, 76, 0, 6, 79, 156,
146
- 0, 6, 88, 96, 0, 6, 93, 62, 0, 6, 106, 158, 0, 6, 114, 188, 0, 6, 122, 152,
147
- 0, 6, 130, 201, 0, 6, 137, 242, 0, 6, 146, 117, 0, 6, 151, 104, 0, 6, 161,
148
- 128, 0, 6, 166, 73, 0, 6, 175, 246, 0, 6, 183, 209, 0, 6, 189, 148, 0, 6,
149
- 197, 94, 0, 6, 205, 115,
150
- ]);
151
- test('Create a full stbl atom', () => {
152
- const privateData = new Uint8Array([
153
- 0x01, 0x64, 0x00, 0x1e, 0xff, 0xe1, 0x00, 0x1e, 0x67, 0x64, 0x00, 0x1e,
154
- 0xac, 0xd9, 0x40, 0xa0, 0x2f, 0xf9, 0x70, 0x16, 0xe0, 0x40, 0x40, 0xb4,
155
- 0xa0, 0x00, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00, 0x07, 0x81, 0xe2, 0xc5,
156
- 0xb2, 0xc0, 0x01, 0x00, 0x06, 0x68, 0xeb, 0xe0, 0x8c, 0xb2, 0x2c, 0xfd,
157
- 0xf8, 0xf8, 0x00,
158
- ]);
159
- const result = createStbl({
160
- samplePositions: exampleVideoSamplePositions,
161
- codecSpecificData: createAvc1Data({
162
- pasp: createPasp(1, 1),
163
- avccBox: createAvccBox(privateData),
164
- width: 640,
165
- height: 360,
166
- horizontalResolution: 72,
167
- verticalResolution: 72,
168
- compressorName: '',
169
- depth: 24,
170
- type: 'avc1-data',
171
- }),
172
- isVideo: true,
173
- });
174
- expect(result).toEqual(sample);
175
- });
176
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const example_stts_1 = require("../create/iso-base-media/example-stts");
5
- const create_stco_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/create-stco");
6
- const reference = new Uint8Array([
7
- 0, 0, 1, 232, 115, 116, 99, 111, 0, 0, 0, 0, 0, 0, 0, 118, 0, 0, 71, 195, 0,
8
- 0, 81, 197, 0, 0, 91, 68, 0, 0, 106, 144, 0, 0, 116, 71, 0, 0, 131, 113, 0, 0,
9
- 141, 199, 0, 0, 147, 232, 0, 0, 168, 46, 0, 0, 178, 64, 0, 0, 192, 112, 0, 0,
10
- 220, 222, 0, 0, 235, 180, 0, 0, 247, 239, 0, 1, 5, 68, 0, 1, 25, 128, 0, 1,
11
- 39, 79, 0, 1, 52, 223, 0, 1, 113, 239, 0, 1, 132, 94, 0, 1, 144, 198, 0, 1,
12
- 163, 167, 0, 1, 177, 65, 0, 1, 195, 175, 0, 1, 216, 13, 0, 1, 237, 28, 0, 1,
13
- 255, 79, 0, 2, 11, 159, 0, 2, 32, 133, 0, 2, 46, 79, 0, 2, 54, 142, 0, 2, 65,
14
- 218, 0, 2, 82, 109, 0, 2, 98, 35, 0, 2, 109, 6, 0, 2, 117, 3, 0, 2, 130, 232,
15
- 0, 2, 137, 190, 0, 2, 205, 92, 0, 2, 227, 56, 0, 2, 238, 39, 0, 2, 254, 101,
16
- 0, 3, 13, 86, 0, 3, 41, 221, 0, 3, 53, 24, 0, 3, 62, 170, 0, 3, 69, 68, 0, 3,
17
- 96, 15, 0, 3, 104, 209, 0, 3, 114, 159, 0, 3, 125, 176, 0, 3, 138, 117, 0, 3,
18
- 154, 71, 0, 3, 170, 2, 0, 3, 180, 223, 0, 3, 187, 217, 0, 3, 201, 223, 0, 3,
19
- 212, 95, 0, 4, 35, 90, 0, 4, 53, 47, 0, 4, 60, 96, 0, 4, 75, 115, 0, 4, 88,
20
- 12, 0, 4, 98, 22, 0, 4, 104, 0, 0, 4, 116, 142, 0, 4, 130, 198, 0, 4, 137,
21
- 131, 0, 4, 146, 60, 0, 4, 151, 255, 0, 4, 164, 57, 0, 4, 170, 249, 0, 4, 179,
22
- 194, 0, 4, 188, 115, 0, 4, 195, 8, 0, 4, 204, 252, 0, 4, 210, 29, 0, 4, 218,
23
- 186, 0, 5, 42, 103, 0, 5, 56, 101, 0, 5, 63, 32, 0, 5, 71, 168, 0, 5, 80, 150,
24
- 0, 5, 90, 93, 0, 5, 100, 151, 0, 5, 106, 101, 0, 5, 116, 18, 0, 5, 124, 171,
25
- 0, 5, 137, 160, 0, 5, 147, 161, 0, 5, 156, 101, 0, 5, 168, 93, 0, 5, 177, 66,
26
- 0, 5, 189, 67, 0, 5, 195, 99, 0, 5, 206, 31, 0, 5, 213, 246, 0, 5, 224, 62, 0,
27
- 6, 52, 209, 0, 6, 65, 175, 0, 6, 76, 78, 0, 6, 81, 195, 0, 6, 89, 240, 0, 6,
28
- 100, 1, 0, 6, 108, 32, 0, 6, 119, 73, 0, 6, 124, 45, 0, 6, 134, 163, 0, 6,
29
- 139, 217, 0, 6, 148, 25, 0, 6, 154, 228, 0, 6, 162, 250, 0, 6, 169, 90, 0, 6,
30
- 177, 52, 0, 6, 186, 70, 0, 6, 190, 193, 0, 6, 202, 37, 0, 6, 207, 163,
31
- ]);
32
- (0, bun_test_1.test)('stco', () => {
33
- (0, bun_test_1.expect)((0, create_stco_1.createStcoAtom)(example_stts_1.exampleAudioSamplePositions)).toEqual(reference);
34
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const reference = new Uint8Array([
4
- 0, 0, 4, 228, 115, 116, 115, 99, 0, 0, 0, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0,
5
- 0, 2, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 2,
6
- 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0, 2, 0, 0,
7
- 0, 1, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 1,
8
- 0, 0, 0, 9, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0,
9
- 0, 11, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 12, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0,
10
- 13, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 15,
11
- 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 18, 0,
12
-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 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 111, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
52
- 112, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 114, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
53
- 115, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 116, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
54
- 117, 0, 0, 0, 7, 0, 0, 0, 1,
55
- ]);
56
- const bun_test_1 = require("bun:test");
57
- const example_stts_1 = require("../create/iso-base-media/example-stts");
58
- const create_stsc_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/create-stsc");
59
- (0, bun_test_1.test)('stsc', () => {
60
- (0, bun_test_1.expect)(reference.byteLength).toBe(1252);
61
- const result = (0, create_stsc_1.createStsc)(example_stts_1.exampleAudioSamplePositions);
62
- (0, bun_test_1.expect)(result).toEqual(reference);
63
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const example_stts_1 = require("../create/iso-base-media/example-stts");
5
- const create_stss_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/create-stss");
6
- const reference = new Uint8Array([
7
- 0x00, 0x00, 0x00, 0x28, 0x73, 0x74, 0x73, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00,
8
- 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00,
9
- 0x00, 0x29, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00,
10
- 0x65,
11
- ]);
12
- (0, bun_test_1.test)('stss', () => {
13
- (0, bun_test_1.expect)((0, create_stss_1.createStss)(example_stts_1.exampleVideoSamplePositions)).toEqual(reference);
14
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const example_stts_1 = require("../create/iso-base-media/example-stts");
5
- const create_stsz_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/create-stsz");
6
- const refernce = new Uint8Array([
7
- 0, 0, 3, 12, 115, 116, 115, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 0, 0,
8
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
9
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
10
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
11
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
12
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
13
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0,
14
- 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0,
15
- 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0,
16
- 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0,
17
- 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0,
18
- 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 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 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
33
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0,
34
- 3, 78, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0,
35
- 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0,
36
- 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0,
37
- 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0,
38
- 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0,
39
- 3, 79, 0, 0, 3, 78, 0, 0, 3, 78, 0, 0, 3, 79,
40
- ]);
41
- (0, bun_test_1.test)('stsz', () => {
42
- (0, bun_test_1.expect)((0, create_stsz_1.createStsz)(example_stts_1.exampleAudioSamplePositions)).toEqual(refernce);
43
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const example_stts_1 = require("../create/iso-base-media/example-stts");
5
- const create_stts_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/create-stts");
6
- const reference = new Uint8Array([
7
- 0x00, 0x00, 0x00, 0x18, 0x73, 0x74, 0x74, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00,
8
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x04, 0x00,
9
- ]);
10
- (0, bun_test_1.test)('stts', () => {
11
- return (0, bun_test_1.expect)((0, create_stts_1.createSttsAtom)(example_stts_1.exampleAudioSamplePositions)).toEqual(reference);
12
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,175 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const media_parser_1 = require("@remotion/media-parser");
4
- const bun_test_1 = require("bun:test");
5
- const create_tkhd_1 = require("../create/iso-base-media/trak/create-tkhd");
6
- const buffer = Uint8Array.from([
7
- // size, 32 bit
8
- 0, 0, 0, 92,
9
- // mvhd atom, 32 bit
10
- 116, 107, 104, 100,
11
- // version, 8 unsigned bit
12
- 0,
13
- // flags, 24 bit
14
- 0, 0, 15,
15
- // creation time, 32 bit
16
- 226, 94, 106, 178,
17
- // modification time, 32 bit
18
- 226, 94, 106, 182,
19
- // track id, 32 bit
20
- 0, 0, 0, 5,
21
- // reserved, 32 bit
22
- 0, 0, 0, 0,
23
- // duration, 32 bit
24
- 0, 0, 7, 248,
25
- // reserved, 32 bit
26
- 0, 0, 0, 0,
27
- // reserved, 32 bit
28
- 0, 0, 0, 0,
29
- // layer, 16 bit
30
- 0, 0,
31
- // alternate group, 16 bit
32
- 0, 0,
33
- // volume, 16 bit
34
- 0, 0,
35
- // reserved, 16 bit
36
- 0, 0,
37
- // matrix[0], 32 bit
38
- 0, 1, 0, 0,
39
- // matrix[1], 32 bit
40
- 0, 0, 0, 0,
41
- // matrix[2], 32 bit
42
- 0, 0, 0, 0,
43
- // matrix[3], 32 bit
44
- 0, 0, 0, 0,
45
- // matrix[4], 32 bit
46
- 0, 1, 0, 0,
47
- // matrix[5], 32 bit
48
- 0, 0, 0, 0,
49
- // matrix[6], 32 bit
50
- 0, 0, 0, 0,
51
- // matrix[7], 32 bit
52
- 0, 0, 0, 0,
53
- // matrix[8], 32 bit
54
- 64, 0, 0, 0,
55
- // width, 32 bit
56
- 0, 0, 0, 0,
57
- // height, 32 bit
58
- 0, 0, 0, 0,
59
- ]);
60
- (0, bun_test_1.test)('Should be able to parse a TKHD box', () => {
61
- const iterator = media_parser_1.MediaParserInternals.getArrayBufferIterator(buffer, null);
62
- iterator.discard(8);
63
- const mvhd = media_parser_1.MediaParserInternals.parseTkhd({
64
- iterator,
65
- offset: 0,
66
- size: 92,
67
- });
68
- (0, bun_test_1.expect)(mvhd).toEqual({
69
- type: 'tkhd-box',
70
- boxSize: 92,
71
- offset: 0,
72
- alternateGroup: 0,
73
- creationTime: 1714993714000,
74
- duration: 2040,
75
- modificationTime: 1714993718000,
76
- trackId: 5,
77
- version: 0,
78
- layer: 0,
79
- volume: 0,
80
- matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1],
81
- width: 0,
82
- height: 0,
83
- rotation: 0,
84
- unrotatedWidth: 0,
85
- unrotatedHeight: 0,
86
- });
87
- });
88
- (0, bun_test_1.test)('Should be able to create a tkhd', () => {
89
- (0, bun_test_1.expect)((0, create_tkhd_1.createTkhdForVideo)({
90
- creationTime: 1714993714000,
91
- modificationTime: 1714993718000,
92
- trackId: 5,
93
- duration: 2040,
94
- volume: 0,
95
- matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1],
96
- width: 0,
97
- height: 0,
98
- flags: create_tkhd_1.TKHD_FLAGS.TRACK_ENABLED |
99
- create_tkhd_1.TKHD_FLAGS.TRACK_IN_MOVIE |
100
- create_tkhd_1.TKHD_FLAGS.TRACK_IN_PREVIEW |
101
- create_tkhd_1.TKHD_FLAGS.TRACK_IN_POSTER,
102
- timescale: 1000,
103
- })).toEqual(buffer);
104
- });
105
- const buffer2 = new Uint8Array([
106
- 0x00, 0x00, 0x00, 0x5c, 0x74, 0x6b, 0x68, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00,
107
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
108
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
110
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
111
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112
- 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x07, 0x80, 0x00,
113
- 0x00,
114
- ]);
115
- (0, bun_test_1.test)('Should be able to parse a TKHD box 2', () => {
116
- const iterator = media_parser_1.MediaParserInternals.getArrayBufferIterator(buffer2, null);
117
- iterator.discard(8);
118
- const mvhd = media_parser_1.MediaParserInternals.parseTkhd({
119
- iterator,
120
- offset: 0,
121
- size: 92,
122
- });
123
- (0, bun_test_1.expect)(mvhd).toEqual({
124
- type: 'tkhd-box',
125
- boxSize: 92,
126
- offset: 0,
127
- alternateGroup: 0,
128
- creationTime: null,
129
- duration: 0,
130
- modificationTime: null,
131
- trackId: 1,
132
- version: 0,
133
- layer: 0,
134
- volume: 0,
135
- matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1],
136
- width: 1080,
137
- height: 1920,
138
- rotation: 0,
139
- unrotatedWidth: 1080,
140
- unrotatedHeight: 1920,
141
- });
142
- (0, bun_test_1.expect)((0, create_tkhd_1.createTkhdForVideo)({
143
- creationTime: null,
144
- modificationTime: null,
145
- duration: 0,
146
- height: 1920,
147
- width: 1080,
148
- matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1],
149
- trackId: 1,
150
- volume: 0,
151
- flags: create_tkhd_1.TKHD_FLAGS.TRACK_ENABLED | create_tkhd_1.TKHD_FLAGS.TRACK_IN_MOVIE,
152
- timescale: 1000,
153
- })).toEqual(buffer2);
154
- });
155
- const audioTkhd = new Uint8Array([
156
- 0x00, 0x00, 0x00, 0x5c, 0x74, 0x6b, 0x68, 0x64, 0x00, 0x00, 0x00, 0x03, 0x00,
157
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
158
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
159
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
160
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
161
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
162
- 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
163
- 0x0,
164
- ]);
165
- (0, bun_test_1.test)('tkhd', () => {
166
- (0, bun_test_1.expect)((0, create_tkhd_1.createTkhdForAudio)({
167
- creationTime: null,
168
- flags: 3,
169
- modificationTime: null,
170
- trackId: 2,
171
- duration: 4054,
172
- volume: 1,
173
- timescale: 1000,
174
- })).toEqual(audioTkhd);
175
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_too_1 = require("../create/iso-base-media/ilst/create-too");
5
- const reference = new Uint8Array([
6
- 0x0, 0x00, 0x00, 0x24, 0xa9, 0x74, 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x1c, 0x64,
7
- 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x61,
8
- 0x76, 0x66, 0x36, 0x31, 0x2e, 0x37, 0x2e, 0x31, 0x30, 0x30,
9
- ]);
10
- (0, bun_test_1.test)('create too', () => {
11
- (0, bun_test_1.expect)((0, create_too_1.createToo)('Lavf61.7.100')).toEqual(reference);
12
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_url_1 = require("../create/iso-base-media/create-url");
5
- const reference = new Uint8Array([
6
- 0x00, 0x00, 0x00, 0x0c, 0x75, 0x72, 0x6c, 0x20, 0x00, 0x00, 0x00, 0x01,
7
- ]);
8
- (0, bun_test_1.test)('url atom', () => {
9
- const atom = (0, create_url_1.createUrlAtom)();
10
- (0, bun_test_1.expect)(atom).toEqual(reference);
11
- });