@remotion/media-parser 4.0.200 → 4.0.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/av1-codec-string.d.ts +5 -0
- package/dist/av1-codec-string.js +18 -1
- package/dist/bitstream/av1.d.ts +2 -0
- package/dist/bitstream/av1.js +12 -0
- package/dist/boxes/iso-base-media/avcc-hvcc.d.ts +20 -0
- package/dist/boxes/iso-base-media/avcc-hvcc.js +73 -0
- package/dist/boxes/iso-base-media/avcc.d.ts +18 -0
- package/dist/boxes/iso-base-media/avcc.js +27 -0
- package/dist/boxes/iso-base-media/esds-descriptors.d.ts +21 -0
- package/dist/boxes/iso-base-media/esds-descriptors.js +62 -0
- package/dist/boxes/iso-base-media/esds.d.ts +15 -0
- package/dist/boxes/iso-base-media/esds.js +27 -0
- package/dist/boxes/iso-base-media/mdat/mdat.js +2 -1
- package/dist/boxes/iso-base-media/moov/moov.js +1 -0
- package/dist/boxes/iso-base-media/process-box.d.ts +4 -2
- package/dist/boxes/iso-base-media/process-box.js +56 -40
- package/dist/boxes/iso-base-media/stsd/mebx.d.ts +2 -1
- package/dist/boxes/iso-base-media/stsd/mebx.js +2 -1
- package/dist/boxes/iso-base-media/stsd/samples.js +3 -0
- package/dist/boxes/iso-base-media/stsd/stco.d.ts +3 -2
- package/dist/boxes/iso-base-media/stsd/stco.js +2 -2
- package/dist/boxes/iso-base-media/trak/trak.js +1 -0
- package/dist/boxes/webm/bitstream/av1.js +10 -1
- package/dist/boxes/webm/ebml.d.ts +1 -1
- package/dist/boxes/webm/make-header.d.ts +8 -1
- package/dist/boxes/webm/make-header.js +65 -30
- package/dist/boxes/webm/parse-ebml.d.ts +7 -0
- package/dist/boxes/webm/parse-ebml.js +66 -0
- package/dist/boxes/webm/parse-webm-header.js +8 -9
- package/dist/boxes/webm/segments/all-segments.d.ts +258 -1
- package/dist/boxes/webm/segments/all-segments.js +126 -2
- package/dist/boxes/webm/segments/seek-position.js +1 -1
- package/dist/boxes/webm/segments/seek.d.ts +1 -1
- package/dist/boxes/webm/segments/seek.js +8 -2
- package/dist/boxes/webm/segments/timestamp-scale.js +1 -1
- package/dist/boxes/webm/segments/track-entry.d.ts +5 -1
- package/dist/boxes/webm/segments/track-entry.js +19 -20
- package/dist/boxes/webm/segments.d.ts +2 -2
- package/dist/boxes/webm/segments.js +30 -25
- package/dist/boxes/webm/traversal.d.ts +1 -0
- package/dist/boxes/webm/traversal.js +12 -1
- package/dist/buffer-iterator.d.ts +9 -6
- package/dist/buffer-iterator.js +83 -7
- package/dist/from-fetch.js +13 -3
- package/dist/from-input-type-file.d.ts +2 -0
- package/dist/from-input-type-file.js +37 -0
- package/dist/from-node.js +9 -2
- package/dist/from-web-file.js +6 -1
- package/dist/from-web.js +15 -6
- package/dist/get-audio-codec.d.ts +1 -1
- package/dist/get-codec.d.ts +4 -0
- package/dist/get-codec.js +22 -0
- package/dist/get-sample-positions.js +1 -1
- package/dist/has-all-info.js +1 -1
- package/dist/options.d.ts +3 -2
- package/dist/parse-media.js +13 -9
- package/dist/parse-video.js +16 -0
- package/dist/parser-state.d.ts +4 -3
- package/dist/parser-state.js +15 -3
- package/dist/reader.d.ts +1 -1
- package/dist/web-file.d.ts +2 -0
- package/dist/web-file.js +37 -0
- package/package.json +2 -2
- package/src/boxes/iso-base-media/mdat/mdat.ts +2 -1
- package/src/boxes/iso-base-media/moov/moov.ts +1 -0
- package/src/boxes/iso-base-media/process-box.ts +70 -40
- package/src/boxes/iso-base-media/stsd/mebx.ts +3 -0
- package/src/boxes/iso-base-media/stsd/samples.ts +3 -0
- package/src/boxes/iso-base-media/stsd/stco.ts +5 -3
- package/src/boxes/iso-base-media/trak/trak.ts +1 -0
- package/src/boxes/webm/make-header.ts +122 -32
- package/src/boxes/webm/parse-ebml.ts +93 -0
- package/src/boxes/webm/parse-webm-header.ts +8 -12
- package/src/boxes/webm/segments/all-segments.ts +222 -1
- package/src/boxes/webm/segments/seek-position.ts +1 -1
- package/src/boxes/webm/segments/seek.ts +12 -2
- package/src/boxes/webm/segments/timestamp-scale.ts +1 -1
- package/src/boxes/webm/segments/track-entry.ts +31 -26
- package/src/boxes/webm/segments.ts +37 -32
- package/src/boxes/webm/traversal.ts +13 -0
- package/src/buffer-iterator.ts +102 -9
- package/src/from-fetch.ts +22 -3
- package/src/from-node.ts +18 -4
- package/src/from-web-file.ts +11 -1
- package/src/get-sample-positions.ts +1 -1
- package/src/has-all-info.ts +1 -1
- package/src/options.ts +3 -2
- package/src/parse-media.ts +14 -8
- package/src/parse-video.ts +17 -0
- package/src/parser-state.ts +22 -5
- package/src/reader.ts +1 -0
- package/src/test/create-matroska.test.ts +36 -2
- package/src/test/matroska.test.ts +69 -27
- package/src/test/parse-stco.test.ts +2 -0
- package/src/test/stream-local.test.ts +23 -9
- package/src/test/stream-remote.test.ts +23 -19
- package/src/test/stsd.test.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/boxes/iso-base-media/ftype.d.ts +0 -9
- package/dist/boxes/iso-base-media/ftype.js +0 -31
- package/dist/get-video-metadata.d.ts +0 -2
- package/dist/get-video-metadata.js +0 -44
- package/dist/read-and-increment-offset.d.ts +0 -28
- package/dist/read-and-increment-offset.js +0 -177
- package/dist/understand-vorbis.d.ts +0 -1
- package/dist/understand-vorbis.js +0 -12
- package/src/boxes/webm/segments/unknown.ts +0 -19
- /package/dist/{boxes/webm/bitstream/av1/frame.d.ts → get-samples.d.ts} +0 -0
- /package/dist/{boxes/webm/bitstream/av1/frame.js → get-samples.js} +0 -0
- /package/dist/{boxes/webm/bitstream/h264/get-h264-descriptor.d.ts → sample-aspect-ratio.d.ts} +0 -0
- /package/dist/{boxes/webm/bitstream/h264/get-h264-descriptor.js → sample-aspect-ratio.js} +0 -0
|
@@ -23,6 +23,47 @@ test('Should get duration of AV1 video', async () => {
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
expect(parsed.boxes).toEqual([
|
|
26
|
+
{
|
|
27
|
+
hex: '0x1a45dfa3',
|
|
28
|
+
type: 'Header',
|
|
29
|
+
value: [
|
|
30
|
+
{
|
|
31
|
+
hex: '0x4286',
|
|
32
|
+
type: 'EBMLVersion',
|
|
33
|
+
value: 1,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
hex: '0x42f7',
|
|
37
|
+
type: 'EBMLReadVersion',
|
|
38
|
+
value: 1,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
hex: '0x42f2',
|
|
42
|
+
type: 'EBMLMaxIDLength',
|
|
43
|
+
value: 4,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
hex: '0x42f3',
|
|
47
|
+
type: 'EBMLMaxSizeLength',
|
|
48
|
+
value: 8,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
hex: '0x4282',
|
|
52
|
+
type: 'DocType',
|
|
53
|
+
value: 'webm',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
hex: '0x4287',
|
|
57
|
+
type: 'DocTypeVersion',
|
|
58
|
+
value: 2,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
hex: '0x4285',
|
|
62
|
+
type: 'DocTypeReadVersion',
|
|
63
|
+
value: 2,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
26
67
|
{
|
|
27
68
|
type: 'main-segment',
|
|
28
69
|
children: [
|
|
@@ -196,7 +237,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
196
237
|
type: 'simple-block-or-block-segment',
|
|
197
238
|
length: 279307,
|
|
198
239
|
trackNumber: 1,
|
|
199
|
-
|
|
240
|
+
timecodeInMicroseconds: 0,
|
|
200
241
|
keyframe: true,
|
|
201
242
|
lacing: 0,
|
|
202
243
|
invisible: false,
|
|
@@ -206,7 +247,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
206
247
|
type: 'simple-block-or-block-segment',
|
|
207
248
|
length: 96,
|
|
208
249
|
trackNumber: 1,
|
|
209
|
-
|
|
250
|
+
timecodeInMicroseconds: 40000,
|
|
210
251
|
keyframe: false,
|
|
211
252
|
lacing: 0,
|
|
212
253
|
invisible: false,
|
|
@@ -216,7 +257,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
216
257
|
type: 'simple-block-or-block-segment',
|
|
217
258
|
length: 556,
|
|
218
259
|
trackNumber: 1,
|
|
219
|
-
|
|
260
|
+
timecodeInMicroseconds: 80000,
|
|
220
261
|
keyframe: false,
|
|
221
262
|
lacing: 0,
|
|
222
263
|
invisible: false,
|
|
@@ -226,7 +267,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
226
267
|
type: 'simple-block-or-block-segment',
|
|
227
268
|
length: 948,
|
|
228
269
|
trackNumber: 1,
|
|
229
|
-
|
|
270
|
+
timecodeInMicroseconds: 120000,
|
|
230
271
|
keyframe: false,
|
|
231
272
|
lacing: 0,
|
|
232
273
|
invisible: false,
|
|
@@ -236,7 +277,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
236
277
|
type: 'simple-block-or-block-segment',
|
|
237
278
|
length: 577,
|
|
238
279
|
trackNumber: 1,
|
|
239
|
-
|
|
280
|
+
timecodeInMicroseconds: 160000,
|
|
240
281
|
keyframe: false,
|
|
241
282
|
lacing: 0,
|
|
242
283
|
invisible: false,
|
|
@@ -246,7 +287,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
246
287
|
type: 'simple-block-or-block-segment',
|
|
247
288
|
length: 779,
|
|
248
289
|
trackNumber: 1,
|
|
249
|
-
|
|
290
|
+
timecodeInMicroseconds: 200000,
|
|
250
291
|
keyframe: false,
|
|
251
292
|
lacing: 0,
|
|
252
293
|
invisible: false,
|
|
@@ -256,7 +297,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
256
297
|
type: 'simple-block-or-block-segment',
|
|
257
298
|
length: 793,
|
|
258
299
|
trackNumber: 1,
|
|
259
|
-
|
|
300
|
+
timecodeInMicroseconds: 240000,
|
|
260
301
|
keyframe: false,
|
|
261
302
|
lacing: 0,
|
|
262
303
|
invisible: false,
|
|
@@ -266,7 +307,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
266
307
|
type: 'simple-block-or-block-segment',
|
|
267
308
|
length: 740,
|
|
268
309
|
trackNumber: 1,
|
|
269
|
-
|
|
310
|
+
timecodeInMicroseconds: 280000,
|
|
270
311
|
keyframe: false,
|
|
271
312
|
lacing: 0,
|
|
272
313
|
invisible: false,
|
|
@@ -276,7 +317,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
276
317
|
type: 'simple-block-or-block-segment',
|
|
277
318
|
length: 1095,
|
|
278
319
|
trackNumber: 1,
|
|
279
|
-
|
|
320
|
+
timecodeInMicroseconds: 320000,
|
|
280
321
|
keyframe: false,
|
|
281
322
|
lacing: 0,
|
|
282
323
|
invisible: false,
|
|
@@ -286,7 +327,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
286
327
|
type: 'simple-block-or-block-segment',
|
|
287
328
|
length: 1097,
|
|
288
329
|
trackNumber: 1,
|
|
289
|
-
|
|
330
|
+
timecodeInMicroseconds: 360000,
|
|
290
331
|
keyframe: false,
|
|
291
332
|
lacing: 0,
|
|
292
333
|
invisible: false,
|
|
@@ -296,7 +337,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
296
337
|
type: 'simple-block-or-block-segment',
|
|
297
338
|
length: 1155,
|
|
298
339
|
trackNumber: 1,
|
|
299
|
-
|
|
340
|
+
timecodeInMicroseconds: 400000,
|
|
300
341
|
keyframe: false,
|
|
301
342
|
lacing: 0,
|
|
302
343
|
invisible: false,
|
|
@@ -306,7 +347,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
306
347
|
type: 'simple-block-or-block-segment',
|
|
307
348
|
length: 1526,
|
|
308
349
|
trackNumber: 1,
|
|
309
|
-
|
|
350
|
+
timecodeInMicroseconds: 440000,
|
|
310
351
|
keyframe: false,
|
|
311
352
|
lacing: 0,
|
|
312
353
|
invisible: false,
|
|
@@ -316,7 +357,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
316
357
|
type: 'simple-block-or-block-segment',
|
|
317
358
|
length: 1487,
|
|
318
359
|
trackNumber: 1,
|
|
319
|
-
|
|
360
|
+
timecodeInMicroseconds: 480000,
|
|
320
361
|
keyframe: false,
|
|
321
362
|
lacing: 0,
|
|
322
363
|
invisible: false,
|
|
@@ -326,7 +367,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
326
367
|
type: 'simple-block-or-block-segment',
|
|
327
368
|
length: 2046,
|
|
328
369
|
trackNumber: 1,
|
|
329
|
-
|
|
370
|
+
timecodeInMicroseconds: 520000,
|
|
330
371
|
keyframe: false,
|
|
331
372
|
lacing: 0,
|
|
332
373
|
invisible: false,
|
|
@@ -336,7 +377,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
336
377
|
type: 'simple-block-or-block-segment',
|
|
337
378
|
length: 1372,
|
|
338
379
|
trackNumber: 1,
|
|
339
|
-
|
|
380
|
+
timecodeInMicroseconds: 560000,
|
|
340
381
|
keyframe: false,
|
|
341
382
|
lacing: 0,
|
|
342
383
|
invisible: false,
|
|
@@ -346,7 +387,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
346
387
|
type: 'simple-block-or-block-segment',
|
|
347
388
|
length: 1441,
|
|
348
389
|
trackNumber: 1,
|
|
349
|
-
|
|
390
|
+
timecodeInMicroseconds: 600000,
|
|
350
391
|
keyframe: false,
|
|
351
392
|
lacing: 0,
|
|
352
393
|
invisible: false,
|
|
@@ -356,7 +397,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
356
397
|
type: 'simple-block-or-block-segment',
|
|
357
398
|
length: 2947,
|
|
358
399
|
trackNumber: 1,
|
|
359
|
-
|
|
400
|
+
timecodeInMicroseconds: 640000,
|
|
360
401
|
keyframe: false,
|
|
361
402
|
lacing: 0,
|
|
362
403
|
invisible: false,
|
|
@@ -366,7 +407,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
366
407
|
type: 'simple-block-or-block-segment',
|
|
367
408
|
length: 2652,
|
|
368
409
|
trackNumber: 1,
|
|
369
|
-
|
|
410
|
+
timecodeInMicroseconds: 680000,
|
|
370
411
|
keyframe: false,
|
|
371
412
|
lacing: 0,
|
|
372
413
|
invisible: false,
|
|
@@ -376,7 +417,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
376
417
|
type: 'simple-block-or-block-segment',
|
|
377
418
|
length: 4199,
|
|
378
419
|
trackNumber: 1,
|
|
379
|
-
|
|
420
|
+
timecodeInMicroseconds: 720000,
|
|
380
421
|
keyframe: false,
|
|
381
422
|
lacing: 0,
|
|
382
423
|
invisible: false,
|
|
@@ -386,7 +427,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
386
427
|
type: 'simple-block-or-block-segment',
|
|
387
428
|
length: 3998,
|
|
388
429
|
trackNumber: 1,
|
|
389
|
-
|
|
430
|
+
timecodeInMicroseconds: 760000,
|
|
390
431
|
keyframe: false,
|
|
391
432
|
lacing: 0,
|
|
392
433
|
invisible: false,
|
|
@@ -396,7 +437,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
396
437
|
type: 'simple-block-or-block-segment',
|
|
397
438
|
length: 6373,
|
|
398
439
|
trackNumber: 1,
|
|
399
|
-
|
|
440
|
+
timecodeInMicroseconds: 800000,
|
|
400
441
|
keyframe: false,
|
|
401
442
|
lacing: 0,
|
|
402
443
|
invisible: false,
|
|
@@ -406,7 +447,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
406
447
|
type: 'simple-block-or-block-segment',
|
|
407
448
|
length: 5955,
|
|
408
449
|
trackNumber: 1,
|
|
409
|
-
|
|
450
|
+
timecodeInMicroseconds: 840000,
|
|
410
451
|
keyframe: false,
|
|
411
452
|
lacing: 0,
|
|
412
453
|
invisible: false,
|
|
@@ -416,7 +457,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
416
457
|
type: 'simple-block-or-block-segment',
|
|
417
458
|
length: 7943,
|
|
418
459
|
trackNumber: 1,
|
|
419
|
-
|
|
460
|
+
timecodeInMicroseconds: 880000,
|
|
420
461
|
keyframe: false,
|
|
421
462
|
lacing: 0,
|
|
422
463
|
invisible: false,
|
|
@@ -426,7 +467,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
426
467
|
type: 'simple-block-or-block-segment',
|
|
427
468
|
length: 8241,
|
|
428
469
|
trackNumber: 1,
|
|
429
|
-
|
|
470
|
+
timecodeInMicroseconds: 920000,
|
|
430
471
|
keyframe: false,
|
|
431
472
|
lacing: 0,
|
|
432
473
|
invisible: false,
|
|
@@ -436,7 +477,7 @@ test('Should get duration of AV1 video', async () => {
|
|
|
436
477
|
type: 'simple-block-or-block-segment',
|
|
437
478
|
length: 9506,
|
|
438
479
|
trackNumber: 1,
|
|
439
|
-
|
|
480
|
+
timecodeInMicroseconds: 960000,
|
|
440
481
|
keyframe: false,
|
|
441
482
|
lacing: 0,
|
|
442
483
|
invisible: false,
|
|
@@ -445,8 +486,9 @@ test('Should get duration of AV1 video', async () => {
|
|
|
445
486
|
],
|
|
446
487
|
},
|
|
447
488
|
{
|
|
448
|
-
|
|
449
|
-
type: '
|
|
489
|
+
hex: '0x1c53bb6b',
|
|
490
|
+
type: 'Cues',
|
|
491
|
+
value: undefined,
|
|
450
492
|
},
|
|
451
493
|
],
|
|
452
494
|
},
|
|
@@ -18,6 +18,7 @@ test('Parse stco box', () => {
|
|
|
18
18
|
iterator,
|
|
19
19
|
size: buf.length - 8,
|
|
20
20
|
offset: 0,
|
|
21
|
+
mode64Bit: false,
|
|
21
22
|
});
|
|
22
23
|
expect(result).toEqual({
|
|
23
24
|
type: 'stco-box',
|
|
@@ -46,6 +47,7 @@ test('Parse stco box with empty chunk', () => {
|
|
|
46
47
|
iterator,
|
|
47
48
|
size: buf.length - 8,
|
|
48
49
|
offset: 0,
|
|
50
|
+
mode64Bit: false,
|
|
49
51
|
});
|
|
50
52
|
expect(result).toEqual({
|
|
51
53
|
type: 'stco-box',
|
|
@@ -18,7 +18,7 @@ test('Should stream ISO base media', async () => {
|
|
|
18
18
|
tracks: true,
|
|
19
19
|
dimensions: true,
|
|
20
20
|
rotation: true,
|
|
21
|
-
|
|
21
|
+
unrotatedDimensions: true,
|
|
22
22
|
},
|
|
23
23
|
reader: nodeReader,
|
|
24
24
|
onVideoTrack: (track) => {
|
|
@@ -46,7 +46,7 @@ test('Should stream ISO base media', async () => {
|
|
|
46
46
|
expect(result.videoTracks.length).toBe(1);
|
|
47
47
|
expect(result.videoTracks[0].codec).toBe('hvc1.2.4.L150.b0');
|
|
48
48
|
expect(result.rotation).toBe(-90);
|
|
49
|
-
expect(result.
|
|
49
|
+
expect(result.unrotatedDimensions).toEqual({
|
|
50
50
|
height: 2160,
|
|
51
51
|
width: 3840,
|
|
52
52
|
});
|
|
@@ -258,7 +258,7 @@ test('Should stream variable fps video', async () => {
|
|
|
258
258
|
videoCodec: true,
|
|
259
259
|
audioCodec: true,
|
|
260
260
|
rotation: true,
|
|
261
|
-
|
|
261
|
+
unrotatedDimensions: true,
|
|
262
262
|
tracks: true,
|
|
263
263
|
boxes: true,
|
|
264
264
|
},
|
|
@@ -278,8 +278,8 @@ test('Should stream variable fps video', async () => {
|
|
|
278
278
|
|
|
279
279
|
expect(parsed.dimensions.width).toBe(1280);
|
|
280
280
|
expect(parsed.dimensions.height).toBe(720);
|
|
281
|
-
expect(parsed.
|
|
282
|
-
expect(parsed.
|
|
281
|
+
expect(parsed.unrotatedDimensions.width).toBe(1280);
|
|
282
|
+
expect(parsed.unrotatedDimensions.height).toBe(720);
|
|
283
283
|
expect(parsed.durationInSeconds).toBe(22.901);
|
|
284
284
|
expect(parsed.videoCodec).toBe('vp8');
|
|
285
285
|
expect(parsed.audioCodec).toBe('opus');
|
|
@@ -413,7 +413,7 @@ test('Should get duration of HEVC video', async () => {
|
|
|
413
413
|
audioCodec: true,
|
|
414
414
|
rotation: true,
|
|
415
415
|
tracks: true,
|
|
416
|
-
|
|
416
|
+
unrotatedDimensions: true,
|
|
417
417
|
videoCodec: true,
|
|
418
418
|
},
|
|
419
419
|
onVideoTrack: () => {
|
|
@@ -437,7 +437,7 @@ test('Should get duration of HEVC video', async () => {
|
|
|
437
437
|
expect(parsed.audioTracks.length).toBe(1);
|
|
438
438
|
expect(parsed.audioTracks[0].codec).toBe('mp4a.40.02');
|
|
439
439
|
expect(parsed.audioTracks[0].description).toEqual(new Uint8Array([18, 16]));
|
|
440
|
-
expect(parsed.
|
|
440
|
+
expect(parsed.unrotatedDimensions).toEqual({
|
|
441
441
|
width: 1920,
|
|
442
442
|
height: 1080,
|
|
443
443
|
});
|
|
@@ -456,7 +456,7 @@ test('Custom DAR', async () => {
|
|
|
456
456
|
tracks: true,
|
|
457
457
|
dimensions: true,
|
|
458
458
|
rotation: true,
|
|
459
|
-
|
|
459
|
+
unrotatedDimensions: true,
|
|
460
460
|
},
|
|
461
461
|
reader: nodeReader,
|
|
462
462
|
});
|
|
@@ -480,7 +480,7 @@ test('Custom DAR', async () => {
|
|
|
480
480
|
expect(parsed.videoTracks[0].codedWidth).toBe(1280);
|
|
481
481
|
expect(parsed.videoTracks[0].codedHeight).toBe(720);
|
|
482
482
|
expect(parsed.rotation).toBe(0);
|
|
483
|
-
expect(parsed.
|
|
483
|
+
expect(parsed.unrotatedDimensions).toEqual({
|
|
484
484
|
height: 720,
|
|
485
485
|
width: 405,
|
|
486
486
|
});
|
|
@@ -729,3 +729,17 @@ test('Should stream transparent video', async () => {
|
|
|
729
729
|
expect(videoSamples).toBe(39);
|
|
730
730
|
expect(keyFrames).toBe(1);
|
|
731
731
|
});
|
|
732
|
+
|
|
733
|
+
test('Acknowledge there are .avi file', () => {
|
|
734
|
+
const parsed = parseMedia({
|
|
735
|
+
src: RenderInternals.exampleVideos.avi,
|
|
736
|
+
fields: {
|
|
737
|
+
tracks: true,
|
|
738
|
+
boxes: true,
|
|
739
|
+
},
|
|
740
|
+
reader: nodeReader,
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
expect(parsed).rejects.toThrow('AVI');
|
|
744
|
+
expect(parsed).rejects.toThrow('not yet supported');
|
|
745
|
+
});
|
|
@@ -20,25 +20,29 @@ test('Should stream', async () => {
|
|
|
20
20
|
expect(result.videoCodec).toEqual('h264');
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
test(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
23
|
+
test(
|
|
24
|
+
'Should stream from Wikipedia',
|
|
25
|
+
async () => {
|
|
26
|
+
const result = await parseMedia({
|
|
27
|
+
src: 'https://upload.wikimedia.org/wikipedia/commons/transcoded/c/c0/Big_Buck_Bunny_4K.webm/Big_Buck_Bunny_4K.webm.720p.vp9.webm',
|
|
28
|
+
fields: {
|
|
29
|
+
durationInSeconds: true,
|
|
30
|
+
fps: true,
|
|
31
|
+
dimensions: true,
|
|
32
|
+
videoCodec: true,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
expect(result.durationInSeconds).toBe(634.571);
|
|
36
|
+
// TODO: Not yet implemented
|
|
37
|
+
expect(result.fps).toBe(null);
|
|
38
|
+
expect(result.dimensions).toEqual({
|
|
39
|
+
width: 1280,
|
|
40
|
+
height: 720,
|
|
41
|
+
});
|
|
42
|
+
expect(result.videoCodec).toEqual('vp9');
|
|
43
|
+
},
|
|
44
|
+
{timeout: 10000},
|
|
45
|
+
);
|
|
42
46
|
|
|
43
47
|
test('Should handle redirect', async () => {
|
|
44
48
|
const result = await parseMedia({
|
package/src/test/stsd.test.ts
CHANGED
|
@@ -49,6 +49,7 @@ test('Should be able to parse a STSD audio box correctly', async () => {
|
|
|
49
49
|
parserState: makeParserState({
|
|
50
50
|
hasAudioCallbacks: false,
|
|
51
51
|
hasVideoCallbacks: false,
|
|
52
|
+
signal: undefined,
|
|
52
53
|
}),
|
|
53
54
|
},
|
|
54
55
|
});
|
|
@@ -213,6 +214,7 @@ test('Should be able to parse a STSD video box correctly', async () => {
|
|
|
213
214
|
parserState: makeParserState({
|
|
214
215
|
hasAudioCallbacks: false,
|
|
215
216
|
hasVideoCallbacks: false,
|
|
217
|
+
signal: undefined,
|
|
216
218
|
}),
|
|
217
219
|
},
|
|
218
220
|
});
|