@remotion/media-parser 4.0.230 → 4.0.231
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/boxes/webm/parse-webm-header.js +23 -4
- package/dist/boxes/webm/segments/parse-children.d.ts +12 -7
- package/dist/boxes/webm/segments/parse-children.js +67 -57
- package/dist/boxes/webm/segments.d.ts +8 -3
- package/dist/boxes/webm/segments.js +70 -39
- package/dist/create/iso-base-media/create-iso-base-media.d.ts +1 -1
- package/dist/create/iso-base-media/create-iso-base-media.js +4 -5
- package/dist/create/matroska/cluster.d.ts +7 -1
- package/dist/create/matroska/cluster.js +8 -5
- package/dist/create/matroska/create-matroska-media.d.ts +1 -1
- package/dist/create/matroska/create-matroska-media.js +27 -10
- package/dist/create/media-fn.d.ts +1 -0
- package/dist/emit-available-info.d.ts +1 -1
- package/dist/emit-available-info.js +23 -10
- package/dist/esm/buffer.mjs +2 -2
- package/dist/esm/index.mjs +591 -465
- package/dist/esm/web-fs.mjs +2 -2
- package/dist/get-audio-codec.d.ts +1 -1
- package/dist/get-audio-codec.js +2 -7
- package/dist/get-duration.d.ts +5 -0
- package/dist/get-duration.js +7 -3
- package/dist/get-fps.js +7 -0
- package/dist/get-video-codec.d.ts +2 -2
- package/dist/get-video-codec.js +2 -6
- package/dist/has-all-info.d.ts +1 -1
- package/dist/has-all-info.js +8 -8
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -1
- package/dist/options.d.ts +8 -1
- package/dist/parse-media.js +41 -14
- package/dist/parse-result.d.ts +15 -0
- package/dist/parse-video.d.ts +1 -1
- package/dist/parse-video.js +3 -0
- package/dist/readers/reader.d.ts +2 -2
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/writers/buffer-implementation/writer.d.ts +2 -2
- package/dist/writers/buffer-implementation/writer.js +2 -2
- package/dist/writers/web-fs.js +2 -3
- package/dist/writers/writer.d.ts +5 -3
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
13
13
|
const keys = Object.keys(hasInfo);
|
|
14
14
|
for (const key of keys) {
|
|
15
15
|
if (key === 'boxes') {
|
|
16
|
-
if (hasInfo.boxes && returnValue.boxes === undefined) {
|
|
16
|
+
if (parseResult && hasInfo.boxes && returnValue.boxes === undefined) {
|
|
17
17
|
(_a = moreFields.onBoxes) === null || _a === void 0 ? void 0 : _a.call(moreFields, parseResult.segments);
|
|
18
18
|
returnValue.boxes = parseResult.segments;
|
|
19
19
|
}
|
|
@@ -21,7 +21,8 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
21
21
|
}
|
|
22
22
|
if (key === 'durationInSeconds') {
|
|
23
23
|
if (hasInfo.durationInSeconds &&
|
|
24
|
-
returnValue.durationInSeconds === undefined
|
|
24
|
+
returnValue.durationInSeconds === undefined &&
|
|
25
|
+
parseResult) {
|
|
25
26
|
const durationInSeconds = (0, get_duration_1.getDuration)(parseResult.segments, state);
|
|
26
27
|
(_b = moreFields.onDurationInSeconds) === null || _b === void 0 ? void 0 : _b.call(moreFields, durationInSeconds);
|
|
27
28
|
returnValue.durationInSeconds = durationInSeconds;
|
|
@@ -29,7 +30,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
29
30
|
continue;
|
|
30
31
|
}
|
|
31
32
|
if (key === 'dimensions') {
|
|
32
|
-
if (hasInfo.dimensions &&
|
|
33
|
+
if (hasInfo.dimensions &&
|
|
34
|
+
returnValue.dimensions === undefined &&
|
|
35
|
+
parseResult) {
|
|
33
36
|
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(parseResult.segments, state);
|
|
34
37
|
const dimensions = {
|
|
35
38
|
height: dimensionsQueried.height,
|
|
@@ -42,7 +45,8 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
42
45
|
}
|
|
43
46
|
if (key === 'unrotatedDimensions') {
|
|
44
47
|
if (returnValue.unrotatedDimensions === undefined &&
|
|
45
|
-
hasInfo.unrotatedDimensions
|
|
48
|
+
hasInfo.unrotatedDimensions &&
|
|
49
|
+
parseResult) {
|
|
46
50
|
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(parseResult.segments, state);
|
|
47
51
|
const unrotatedDimensions = {
|
|
48
52
|
height: dimensionsQueried.unrotatedHeight,
|
|
@@ -54,7 +58,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
54
58
|
continue;
|
|
55
59
|
}
|
|
56
60
|
if (key === 'rotation') {
|
|
57
|
-
if (returnValue.rotation === undefined &&
|
|
61
|
+
if (returnValue.rotation === undefined &&
|
|
62
|
+
hasInfo.rotation &&
|
|
63
|
+
parseResult) {
|
|
58
64
|
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(parseResult.segments, state);
|
|
59
65
|
const { rotation } = dimensionsQueried;
|
|
60
66
|
(_e = moreFields.onRotation) === null || _e === void 0 ? void 0 : _e.call(moreFields, rotation);
|
|
@@ -63,7 +69,7 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
63
69
|
continue;
|
|
64
70
|
}
|
|
65
71
|
if (key === 'fps') {
|
|
66
|
-
if (returnValue.fps === undefined && hasInfo.fps) {
|
|
72
|
+
if (returnValue.fps === undefined && hasInfo.fps && parseResult) {
|
|
67
73
|
const fps = (0, get_fps_1.getFps)(parseResult.segments);
|
|
68
74
|
(_f = moreFields.onFps) === null || _f === void 0 ? void 0 : _f.call(moreFields, fps);
|
|
69
75
|
returnValue.fps = fps;
|
|
@@ -71,7 +77,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
71
77
|
continue;
|
|
72
78
|
}
|
|
73
79
|
if (key === 'videoCodec') {
|
|
74
|
-
if (returnValue.videoCodec === undefined &&
|
|
80
|
+
if (returnValue.videoCodec === undefined &&
|
|
81
|
+
hasInfo.videoCodec &&
|
|
82
|
+
parseResult) {
|
|
75
83
|
const videoCodec = (0, get_video_codec_1.getVideoCodec)(parseResult.segments);
|
|
76
84
|
(_g = moreFields.onVideoCodec) === null || _g === void 0 ? void 0 : _g.call(moreFields, videoCodec);
|
|
77
85
|
returnValue.videoCodec = videoCodec;
|
|
@@ -79,7 +87,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
79
87
|
continue;
|
|
80
88
|
}
|
|
81
89
|
if (key === 'audioCodec') {
|
|
82
|
-
if (returnValue.audioCodec === undefined &&
|
|
90
|
+
if (returnValue.audioCodec === undefined &&
|
|
91
|
+
hasInfo.audioCodec &&
|
|
92
|
+
parseResult) {
|
|
83
93
|
const audioCodec = (0, get_audio_codec_1.getAudioCodec)(parseResult.segments, state);
|
|
84
94
|
(_h = moreFields.onAudioCodec) === null || _h === void 0 ? void 0 : _h.call(moreFields, audioCodec);
|
|
85
95
|
returnValue.audioCodec = audioCodec;
|
|
@@ -89,7 +99,8 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
89
99
|
if (key === 'tracks') {
|
|
90
100
|
if (hasInfo.tracks &&
|
|
91
101
|
returnValue.videoTracks === undefined &&
|
|
92
|
-
returnValue.audioTracks === undefined
|
|
102
|
+
returnValue.audioTracks === undefined &&
|
|
103
|
+
parseResult) {
|
|
93
104
|
const { videoTracks, audioTracks } = (0, get_tracks_1.getTracks)(parseResult.segments, state);
|
|
94
105
|
(_j = moreFields.onTracks) === null || _j === void 0 ? void 0 : _j.call(moreFields, { videoTracks, audioTracks });
|
|
95
106
|
returnValue.videoTracks = videoTracks;
|
|
@@ -120,7 +131,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, moreFields, state, returnValu
|
|
|
120
131
|
continue;
|
|
121
132
|
}
|
|
122
133
|
if (key === 'container') {
|
|
123
|
-
if (returnValue.container === undefined &&
|
|
134
|
+
if (returnValue.container === undefined &&
|
|
135
|
+
hasInfo.container &&
|
|
136
|
+
parseResult) {
|
|
124
137
|
const container = (0, get_container_1.getContainer)(parseResult.segments);
|
|
125
138
|
(_o = moreFields.onContainer) === null || _o === void 0 ? void 0 : _o.call(moreFields, container);
|
|
126
139
|
returnValue.container = container;
|
package/dist/esm/buffer.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/writers/buffer-implementation/writer.ts
|
|
2
|
-
var createContent = () => {
|
|
2
|
+
var createContent = ({ filename, mimeType }) => {
|
|
3
3
|
const buf = new ArrayBuffer(0, {
|
|
4
4
|
maxByteLength: 2000000000
|
|
5
5
|
});
|
|
@@ -29,7 +29,7 @@ var createContent = () => {
|
|
|
29
29
|
return Promise.reject(new Error("Already called .remove() on the result"));
|
|
30
30
|
}
|
|
31
31
|
const arr = new Uint8Array(buf);
|
|
32
|
-
return Promise.resolve(new File([arr.slice()],
|
|
32
|
+
return Promise.resolve(new File([arr.slice()], filename, { type: mimeType }));
|
|
33
33
|
},
|
|
34
34
|
remove() {
|
|
35
35
|
removed = true;
|