@remotion/webcodecs 4.0.286 → 4.0.288

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 (81) 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/convert-media.d.ts +2 -1
  11. package/dist/convert-media.js +2 -1
  12. package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.js +8 -0
  13. package/dist/create/iso-base-media/create-iso-base-media.js +2 -0
  14. package/dist/create/iso-base-media/example-stts.js +620 -0
  15. package/dist/create/matroska/create-matroska-media.js +1 -1
  16. package/dist/create/matroska/matroska-utils.d.ts +1 -1
  17. package/dist/default-on-audio-track-handler.js +2 -0
  18. package/dist/esm/index.mjs +183 -24
  19. package/dist/esm/web-fs.mjs +2 -4
  20. package/dist/get-wave-audio-decoder.js +29 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +3 -1
  23. package/dist/on-audio-track-handler.d.ts +1 -0
  24. package/dist/on-audio-track.js +3 -3
  25. package/dist/resample-audiodata.d.ts +4 -0
  26. package/dist/resample-audiodata.js +35 -0
  27. package/dist/wav-audio-encoder.d.ts +1 -1
  28. package/dist/wav-audio-encoder.js +11 -4
  29. package/package.json +12 -7
  30. package/dist/test/avc1.test.d.ts +0 -1
  31. package/dist/test/avc1.test.js +0 -39
  32. package/dist/test/avcc.test.d.ts +0 -1
  33. package/dist/test/avcc.test.js +0 -15
  34. package/dist/test/avi-to-mp4.test.d.ts +0 -1
  35. package/dist/test/avi-to-mp4.test.js +0 -15
  36. package/dist/test/cmt.test.d.ts +0 -1
  37. package/dist/test/cmt.test.js +0 -13
  38. package/dist/test/colr.test.d.ts +0 -1
  39. package/dist/test/colr.test.js +0 -16
  40. package/dist/test/correct-byte-length.test.d.ts +0 -1
  41. package/dist/test/correct-byte-length.test.js +0 -23
  42. package/dist/test/create-ftyp.test.d.ts +0 -1
  43. package/dist/test/create-ftyp.test.js +0 -47
  44. package/dist/test/create-mvhd.test.d.ts +0 -1
  45. package/dist/test/create-mvhd.test.js +0 -108
  46. package/dist/test/ctts.test.d.ts +0 -1
  47. package/dist/test/ctts.test.js +0 -49
  48. package/dist/test/dinf.test.d.ts +0 -1
  49. package/dist/test/dinf.test.js +0 -12
  50. package/dist/test/ilst.test.d.ts +0 -1
  51. package/dist/test/ilst.test.js +0 -22
  52. package/dist/test/mdhd.test.d.ts +0 -1
  53. package/dist/test/mdhd.test.js +0 -17
  54. package/dist/test/meta.test.d.ts +0 -1
  55. package/dist/test/meta.test.js +0 -26
  56. package/dist/test/mp4-header-length.test.d.ts +0 -1
  57. package/dist/test/mp4-header-length.test.js +0 -12
  58. package/dist/test/mp4a.test.d.ts +0 -1
  59. package/dist/test/mp4a.test.js +0 -24
  60. package/dist/test/pasp.test.d.ts +0 -1
  61. package/dist/test/pasp.test.js +0 -12
  62. package/dist/test/remux-serverside.test.d.ts +0 -1
  63. package/dist/test/remux-serverside.test.js +0 -23
  64. package/dist/test/stbl.test.d.ts +0 -0
  65. package/dist/test/stbl.test.js +0 -176
  66. package/dist/test/stco.test.d.ts +0 -1
  67. package/dist/test/stco.test.js +0 -34
  68. package/dist/test/stsc.test.d.ts +0 -1
  69. package/dist/test/stsc.test.js +0 -63
  70. package/dist/test/stss.test.d.ts +0 -1
  71. package/dist/test/stss.test.js +0 -14
  72. package/dist/test/stsz.test.d.ts +0 -1
  73. package/dist/test/stsz.test.js +0 -43
  74. package/dist/test/stts.test.d.ts +0 -1
  75. package/dist/test/stts.test.js +0 -12
  76. package/dist/test/tkhd.test.d.ts +0 -1
  77. package/dist/test/tkhd.test.js +0 -175
  78. package/dist/test/too.test.d.ts +0 -1
  79. package/dist/test/too.test.js +0 -12
  80. package/dist/test/url.test.d.ts +0 -1
  81. package/dist/test/url.test.js +0 -11
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const avc1_1 = require("../create/iso-base-media/codec-specific/avc1");
5
- const create_avcc_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avcc");
6
- const create_pasp_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/stsd/create-pasp");
7
- // bun segfaults here
8
- if (process.platform !== 'win32') {
9
- const reference = new Uint8Array([
10
- 0, 0, 0, 161, 97, 118, 99, 49, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
11
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 128, 1, 104, 0, 72, 0, 0, 0, 72, 0, 0, 0, 0,
12
- 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 255, 255, 0, 0, 0, 59, 97, 118, 99,
14
- 67, 1, 100, 0, 30, 255, 225, 0, 30, 103, 100, 0, 30, 172, 217, 64, 160, 47,
15
- 249, 112, 22, 224, 64, 64, 180, 160, 0, 0, 3, 0, 32, 0, 0, 7, 129, 226, 197,
16
- 178, 192, 1, 0, 6, 104, 235, 224, 140, 178, 44, 253, 248, 248, 0, 0, 0, 0,
17
- 16, 112, 97, 115, 112, 0, 0, 0, 1, 0, 0, 0, 1,
18
- ]);
19
- (0, bun_test_1.test)('create avc1box', () => {
20
- const privateData = new Uint8Array([
21
- 0x01, 0x64, 0x00, 0x1e, 0xff, 0xe1, 0x00, 0x1e, 0x67, 0x64, 0x00, 0x1e,
22
- 0xac, 0xd9, 0x40, 0xa0, 0x2f, 0xf9, 0x70, 0x16, 0xe0, 0x40, 0x40, 0xb4,
23
- 0xa0, 0x00, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00, 0x07, 0x81, 0xe2, 0xc5,
24
- 0xb2, 0xc0, 0x01, 0x00, 0x06, 0x68, 0xeb, 0xe0, 0x8c, 0xb2, 0x2c, 0xfd,
25
- 0xf8, 0xf8, 0x00,
26
- ]);
27
- (0, bun_test_1.expect)((0, avc1_1.createAvc1Data)({
28
- pasp: (0, create_pasp_1.createPasp)(1, 1),
29
- avccBox: (0, create_avcc_1.createAvccBox)(privateData),
30
- width: 640,
31
- height: 360,
32
- horizontalResolution: 72,
33
- verticalResolution: 72,
34
- compressorName: '',
35
- depth: 24,
36
- type: 'avc1-data',
37
- })).toEqual(reference);
38
- });
39
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_avcc_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avcc");
5
- (0, bun_test_1.test)('avcc box', () => {
6
- (0, bun_test_1.expect)((0, create_avcc_1.createAvccBox)(new Uint8Array([
7
- 1, 100, 0, 32, 255, 225, 0, 27, 103, 100, 0, 32, 172, 217, 64, 68, 2,
8
- 39, 150, 92, 4, 64, 0, 0, 3, 0, 64, 0, 0, 12, 3, 198, 12, 101, 128, 1,
9
- 0, 6, 104, 235, 224, 140, 178, 44, 253, 248, 248, 0,
10
- ]))).toEqual(new Uint8Array([
11
- 0, 0, 0, 56, 97, 118, 99, 67, 1, 100, 0, 32, 255, 225, 0, 27, 103, 100, 0,
12
- 32, 172, 217, 64, 68, 2, 39, 150, 92, 4, 64, 0, 0, 3, 0, 64, 0, 0, 12, 3,
13
- 198, 12, 101, 128, 1, 0, 6, 104, 235, 224, 140, 178, 44, 253, 248, 248, 0,
14
- ]));
15
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const example_videos_1 = require("@remotion/example-videos");
4
- const node_1 = require("@remotion/media-parser/node");
5
- const bun_test_1 = require("bun:test");
6
- const convert_media_1 = require("../convert-media");
7
- (0, bun_test_1.test)('Convert AVI to MP4', async () => {
8
- const output = await (0, convert_media_1.convertMedia)({
9
- src: example_videos_1.exampleVideos.avi,
10
- container: 'mp4',
11
- reader: node_1.nodeReader,
12
- });
13
- const f = await output.save();
14
- (0, bun_test_1.expect)(f.size).toBeGreaterThan(0);
15
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_cmt_1 = require("../create/iso-base-media/ilst/create-cmt");
5
- const reference = new Uint8Array([
6
- 0x00, 0x00, 0x00, 0x32, 0xa9, 0x63, 0x6d, 0x74, 0x00, 0x00, 0x00, 0x2a, 0x64,
7
- 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x61,
8
- 0x64, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74,
9
- 0x69, 0x6f, 0x6e, 0x20, 0x34, 0x2e, 0x30, 0x2e, 0x32, 0x32, 0x37,
10
- ]);
11
- (0, bun_test_1.test)('create cmt', () => {
12
- (0, bun_test_1.expect)((0, create_cmt_1.createCmt)('Made with Remotion 4.0.227')).toEqual(reference);
13
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_colr_1 = require("../create/iso-base-media/create-colr");
5
- const reference = new Uint8Array([
6
- 0x00, 0x00, 0x00, 0x13, 0x63, 0x6f, 0x6c, 0x72, 0x6e, 0x63, 0x6c, 0x78, 0x00,
7
- 0x01, 0x00, 0x01, 0x00, 0x01, 0x0,
8
- ]);
9
- (0, bun_test_1.test)('colr', () => {
10
- (0, bun_test_1.expect)((0, create_colr_1.createColr)({
11
- fullRange: false,
12
- matrixIndex: 1,
13
- primaries: 1,
14
- transferFunction: 1,
15
- })).toEqual(reference);
16
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const matroska_utils_1 = require("../create/matroska/matroska-utils");
5
- (0, bun_test_1.test)('should serialize with correct byte length', () => {
6
- const withInheritedWidth = (0, matroska_utils_1.makeMatroskaBytes)({
7
- type: 'Timestamp',
8
- minVintWidth: null,
9
- value: {
10
- value: 0,
11
- byteLength: null,
12
- },
13
- });
14
- const withFixedWidth = (0, matroska_utils_1.makeMatroskaBytes)({
15
- type: 'Timestamp',
16
- minVintWidth: null,
17
- value: {
18
- value: 0,
19
- byteLength: 1,
20
- },
21
- });
22
- (0, bun_test_1.expect)(withFixedWidth.bytes).toEqual(withInheritedWidth.bytes);
23
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,47 +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_ftyp_1 = require("../create/iso-base-media/create-ftyp");
6
- const input = new Uint8Array([
7
- // size
8
- 0x00, 0x00, 0x00, 0x1c,
9
- // ftyp
10
- 0x66, 0x74, 0x79, 0x70,
11
- // iso5
12
- 0x69, 0x73, 0x6f, 0x35,
13
- // 512
14
- 0x00, 0x00, 0x02, 0x00,
15
- // iso5
16
- 0x69, 0x73, 0x6f, 0x35,
17
- // iso6
18
- 0x69, 0x73, 0x6f, 0x36,
19
- // mp41
20
- 0x6d, 0x70, 0x34, 0x31,
21
- ]);
22
- (0, bun_test_1.test)('Create ftyp box', () => {
23
- const iterator = media_parser_1.MediaParserInternals.getArrayBufferIterator(input, null);
24
- const size = iterator.getFourByteNumber();
25
- iterator.discard(4);
26
- const parsed = media_parser_1.MediaParserInternals.parseFtyp({
27
- iterator,
28
- offset: 0,
29
- size,
30
- });
31
- (0, bun_test_1.expect)(parsed).toEqual({
32
- boxSize: 28,
33
- compatibleBrands: ['iso5', 'iso6', 'mp41'],
34
- majorBrand: 'iso5',
35
- minorVersion: 512,
36
- offset: 0,
37
- type: 'ftyp-box',
38
- });
39
- });
40
- (0, bun_test_1.test)('Should create ftyp box', () => {
41
- const ftype = (0, create_ftyp_1.createIsoBaseMediaFtyp)({
42
- compatibleBrands: ['iso5', 'iso6', 'mp41'],
43
- majorBrand: 'iso5',
44
- minorBrand: 512,
45
- });
46
- (0, bun_test_1.expect)(ftype).toEqual(input);
47
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,108 +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_mvhd_1 = require("../create/iso-base-media/create-mvhd");
6
- const primitives_1 = require("../create/iso-base-media/primitives");
7
- const input = new Uint8Array([
8
- // size
9
- 0x00, 0x00, 0x00, 0x6c,
10
- // mvhd
11
- 0x6d, 0x76, 0x68, 0x64,
12
- // version
13
- 0x00,
14
- // flags
15
- 0x00, 0x00, 0x00,
16
- // creation time
17
- 0x00, 0x00, 0x00, 0x00,
18
- // modification time
19
- 0x00, 0x00, 0x00, 0x00,
20
- // timescale
21
- 0x00, 0x00, 0x03, 0xe8,
22
- // duration in units
23
- 0x00, 0x00, 0x00, 0x00,
24
- // rate
25
- 0x00, 0x01, 0x00, 0x00,
26
- // volume
27
- 0x01, 0x00,
28
- // reserved
29
- 0x00, 0x00,
30
- // reserved
31
- 0x00, 0x00, 0x00, 0x00,
32
- // reserved
33
- 0x00, 0x00, 0x00, 0x00,
34
- // matrix[0]
35
- 0x00, 0x01, 0x00, 0x00,
36
- // matrix[1]
37
- 0x00, 0x00, 0x00, 0x00,
38
- // matrix[2]
39
- 0x00, 0x00, 0x00, 0x00,
40
- // matrix[3]
41
- 0x00, 0x00, 0x00, 0x00,
42
- // matrix[4]
43
- 0x00, 0x01, 0x00, 0x00,
44
- // matrix[5]
45
- 0x00, 0x00, 0x00, 0x00,
46
- // matrix[6]
47
- 0x00, 0x00, 0x00, 0x00,
48
- // matrix[7]
49
- 0x00, 0x00, 0x00, 0x00,
50
- // matrix[8]
51
- 0x40, 0x00, 0x00, 0x00,
52
- // predefined[0]
53
- 0x00, 0x00, 0x00, 0x00,
54
- // predefined[1]
55
- 0x00, 0x00, 0x00, 0x00,
56
- // predefined[2]
57
- 0x00, 0x00, 0x00, 0x00,
58
- // predefined[3]
59
- 0x00, 0x00, 0x00, 0x00,
60
- // predefined[4]
61
- 0x00, 0x00, 0x00, 0x00,
62
- // predefined[5]
63
- 0x00, 0x00, 0x00, 0x00,
64
- // next track id
65
- 0x00, 0x00, 0x00, 0x02,
66
- ]);
67
- (0, bun_test_1.test)('Create mvhd box', () => {
68
- const iterator = media_parser_1.MediaParserInternals.getArrayBufferIterator(input, null);
69
- const size = iterator.getFourByteNumber();
70
- iterator.discard(4);
71
- const parsed = media_parser_1.MediaParserInternals.parseMvhd({
72
- iterator,
73
- offset: 0,
74
- size,
75
- });
76
- (0, bun_test_1.expect)(parsed).toEqual({
77
- creationTime: null,
78
- modificationTime: null,
79
- timeScale: 1000,
80
- durationInUnits: 0,
81
- durationInSeconds: 0,
82
- rate: 1,
83
- volume: 1,
84
- matrix: primitives_1.IDENTITY_MATRIX,
85
- nextTrackId: 2,
86
- type: 'mvhd-box',
87
- boxSize: 108,
88
- offset: 0,
89
- });
90
- const content = (0, create_mvhd_1.createMvhd)({
91
- timescale: 1000,
92
- durationInUnits: 0,
93
- rate: 1,
94
- volume: 1,
95
- nextTrackId: 2,
96
- matrix: [
97
- //
98
- 1, 0, 0,
99
- //
100
- 0, 1, 0,
101
- //
102
- 0, 0, 1,
103
- ],
104
- creationTime: null,
105
- modificationTime: null,
106
- });
107
- (0, bun_test_1.expect)(content).toEqual(input);
108
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,49 +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_ctts_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/create-ctts");
6
- const reference = new Uint8Array([
7
- 0, 0, 3, 128, 99, 116, 116, 115, 0, 0, 0, 0, 0, 0, 0, 110, 0, 0, 0, 1, 0, 0,
8
- 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0,
9
- 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0,
10
- 0, 11, 184, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0, 0, 2, 0, 0, 11, 184, 0, 0, 0, 1,
11
- 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0,
12
- 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
13
- 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0, 0, 2, 0, 0, 11, 184, 0, 0,
14
- 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0,
15
- 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 3, 0, 0, 23, 112,
16
- 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 58,
17
- 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11,
18
- 184, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0,
19
- 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0,
20
- 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0,
21
- 0, 11, 184, 0, 0, 0, 2, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1,
22
- 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1,
23
- 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
24
- 0, 0, 11, 184, 0, 0, 0, 2, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0, 0,
25
- 2, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0,
26
- 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0,
27
- 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 46, 224, 0, 0, 0, 2, 0, 0, 11, 184,
28
- 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23,
29
- 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 58,
30
- 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11,
31
- 184, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0,
32
- 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0,
33
- 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
34
- 11, 184, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0,
35
- 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0,
36
- 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 2, 0, 0, 23, 112, 0, 0, 0, 1,
37
- 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
38
- 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0,
39
- 1, 0, 0, 23, 112, 0, 0, 0, 1, 0, 0, 58, 152, 0, 0, 0, 1, 0, 0, 23, 112, 0, 0,
40
- 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0,
41
- 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0,
42
- 0, 0, 1, 0, 0, 46, 224, 0, 0, 0, 2, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40,
43
- 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11,
44
- 184, 0, 0, 0, 1, 0, 0, 35, 40, 0, 0, 0, 1, 0, 0, 11, 184, 0, 0, 0, 1, 0, 0,
45
- 35, 40, 0, 0, 0, 1, 0, 0, 11, 184,
46
- ]);
47
- (0, bun_test_1.test)('ctts atom', () => {
48
- (0, bun_test_1.expect)((0, create_ctts_1.createCttsBox)(example_stts_1.exampleVideoSamplePositions)).toEqual(reference);
49
- });
@@ -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_dinf_1 = require("../create/iso-base-media/trak/mdia/minf/create-dinf");
5
- const data = new Uint8Array([
6
- 0x00, 0x00, 0x00, 0x24, 0x64, 0x69, 0x6e, 0x66, 0x00, 0x00, 0x00, 0x1c, 0x64,
7
- 0x72, 0x65, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
8
- 0x00, 0x0c, 0x75, 0x72, 0x6c, 0x20, 0x00, 0x00, 0x00, 0x01,
9
- ]);
10
- (0, bun_test_1.test)('dinf', () => {
11
- (0, bun_test_1.expect)((0, create_dinf_1.createDinf)()).toEqual(data);
12
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_ilst_1 = require("../create/iso-base-media/create-ilst");
5
- const create_cmt_1 = require("../create/iso-base-media/ilst/create-cmt");
6
- const create_too_1 = require("../create/iso-base-media/ilst/create-too");
7
- const reference = new Uint8Array([
8
- 0x00, 0x00, 0x00, 0x5e, 0x69, 0x6c, 0x73, 0x74, 0x00, 0x00, 0x00, 0x24, 0xa9,
9
- 0x74, 0x6f, 0x6f, 0x00, 0x00, 0x00, 0x1c, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00,
10
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x61, 0x76, 0x66, 0x36, 0x31, 0x2e,
11
- 0x37, 0x2e, 0x31, 0x30, 0x30, 0x00, 0x00, 0x00, 0x32, 0xa9, 0x63, 0x6d, 0x74,
12
- 0x00, 0x00, 0x00, 0x2a, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x01, 0x00,
13
- 0x00, 0x00, 0x00, 0x4d, 0x61, 0x64, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,
14
- 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x34, 0x2e, 0x30, 0x2e,
15
- 0x32, 0x32, 0x37,
16
- ]);
17
- (0, bun_test_1.test)('ilst', () => {
18
- (0, bun_test_1.expect)((0, create_ilst_1.createIlst)([
19
- (0, create_too_1.createToo)('Lavf61.7.100'),
20
- (0, create_cmt_1.createCmt)('Made with Remotion 4.0.227'),
21
- ])).toEqual(reference);
22
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_mdhd_1 = require("../create/iso-base-media/mdia/create-mdhd");
5
- const reference = new Uint8Array([
6
- 0, 0, 0, 32, 109, 100, 104, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 95,
7
- 144, 1, 238, 98, 128, 85, 196, 0, 0,
8
- ]);
9
- (0, bun_test_1.test)('mdhd', () => {
10
- (0, bun_test_1.expect)(reference.length).toBe(32);
11
- (0, bun_test_1.expect)((0, create_mdhd_1.createMdhd)({
12
- creationTime: null,
13
- modificationTime: null,
14
- timescale: 90000,
15
- duration: 360000,
16
- })).toEqual(reference);
17
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const create_ilst_1 = require("../create/iso-base-media/create-ilst");
5
- const create_cmt_1 = require("../create/iso-base-media/ilst/create-cmt");
6
- const create_too_1 = require("../create/iso-base-media/ilst/create-too");
7
- const create_meta_1 = require("../create/iso-base-media/udta/create-meta");
8
- const create_hdlr_1 = require("../create/iso-base-media/udta/meta/create-hdlr");
9
- (0, bun_test_1.test)('meta atom', () => {
10
- (0, bun_test_1.expect)((0, create_meta_1.createMeta)({
11
- hdlr: (0, create_hdlr_1.createHdlr)('mdir'),
12
- ilst: (0, create_ilst_1.createIlst)([
13
- (0, create_too_1.createToo)('Lavf61.7.100'),
14
- (0, create_cmt_1.createCmt)('Made with Remotion 4.0.227'),
15
- ]),
16
- })).toEqual(new Uint8Array([
17
- 0, 0, 0, 139, 109, 101, 116, 97, 0, 0, 0, 0, 0, 0, 0, 33, 104, 100, 108,
18
- 114, 0, 0, 0, 0, 0, 0, 0, 0, 109, 100, 105, 114, 97, 112, 112, 108, 0, 0,
19
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 105, 108, 115, 116, 0, 0, 0, 36, 169,
20
- 116, 111, 111, 0, 0, 0, 28, 100, 97, 116, 97, 0, 0, 0, 1, 0, 0, 0, 0, 76,
21
- 97, 118, 102, 54, 49, 46, 55, 46, 49, 48, 48, 0, 0, 0, 50, 169, 99, 109,
22
- 116, 0, 0, 0, 42, 100, 97, 116, 97, 0, 0, 0, 1, 0, 0, 0, 0, 77, 97, 100,
23
- 101, 32, 119, 105, 116, 104, 32, 82, 101, 109, 111, 116, 105, 111, 110,
24
- 32, 52, 46, 48, 46, 50, 50, 55,
25
- ]));
26
- });
@@ -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 header_length_1 = require("../create/iso-base-media/header-length");
5
- (0, bun_test_1.test)('should calculate good header length', () => {
6
- const result = (0, header_length_1.calculateAReasonableMp4HeaderLength)(60 * 110);
7
- (0, bun_test_1.expect)(result).toBe(5121246);
8
- });
9
- (0, bun_test_1.test)('should calculate good header length for null', () => {
10
- const result = (0, header_length_1.calculateAReasonableMp4HeaderLength)(0);
11
- (0, bun_test_1.expect)(result).toBe(51200);
12
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const bun_test_1 = require("bun:test");
4
- const mp4a_1 = require("../create/iso-base-media/codec-specific/mp4a");
5
- const reference = new Uint8Array([
6
- 0x00, 0x00, 0x00, 87, 0x6d, 0x70, 0x34, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00,
7
- 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
8
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
9
- 0x33, 0x65, 0x73, 0x64, 0x73, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x80, 0x80,
10
- 0x22, 0x00, 0x02, 0x00, 0x04, 0x80, 0x80, 0x80, 0x14, 0x40, 0x15, 0x00, 0x00,
11
- 0x00, 0x00, 0x04, 0xe1, 0xff, 0x00, 0x04, 0xd7, 0xba, 0x05, 0x80, 0x80, 0x80,
12
- 0x02, 0x11, 0x90, 0x06, 0x80, 0x80, 0x80, 0x01, 0x02,
13
- ]);
14
- (0, bun_test_1.test)('mp4a', () => {
15
- const result = (0, mp4a_1.createMp4a)({
16
- type: 'mp4a-data',
17
- channelCount: 2,
18
- sampleRate: 48000,
19
- avgBitrate: 317370,
20
- maxBitrate: 319999,
21
- codecPrivate: new Uint8Array([17, 144]),
22
- });
23
- (0, bun_test_1.expect)(result).toEqual(reference.slice(0, result.length + 7));
24
- });
@@ -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_pasp_1 = require("../create/iso-base-media/trak/mdia/minf/stbl/stsd/create-pasp");
5
- const reference = new Uint8Array([
6
- 0x00, 0x00, 0x00, 0x10, 0x70, 0x61, 0x73, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00,
7
- 0x00, 0x00, 0x01,
8
- ]);
9
- (0, bun_test_1.test)('pasp box', () => {
10
- const pasp = (0, create_pasp_1.createPasp)(1, 1);
11
- (0, bun_test_1.expect)(pasp).toEqual(reference);
12
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const example_videos_1 = require("@remotion/example-videos");
4
- const node_1 = require("@remotion/media-parser/node");
5
- const node_writer_1 = require("@remotion/media-parser/node-writer");
6
- const bun_test_1 = require("bun:test");
7
- const node_fs_1 = require("node:fs");
8
- const convert_media_1 = require("../convert-media");
9
- (0, bun_test_1.test)('should be able to remux server side', async () => {
10
- // bun file descriptor problem
11
- if (process.platform === 'win32') {
12
- return;
13
- }
14
- const { save } = await (0, convert_media_1.convertMedia)({
15
- src: example_videos_1.exampleVideos.bigBuckBunny,
16
- reader: node_1.nodeReader,
17
- container: 'mp4',
18
- writer: (0, node_writer_1.nodeWriter)('outputbun.mp4'),
19
- });
20
- const data = await save();
21
- (0, bun_test_1.expect)(data.size).toBe(16330323);
22
- (0, node_fs_1.unlinkSync)('outputbun.mp4');
23
- });
File without changes