@remotion/webcodecs 4.0.251 → 4.0.252
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/auto-select-writer.d.ts +1 -1
- package/dist/can-copy-video-track.js +2 -1
- package/dist/choose-correct-hevc-profile.d.ts +5 -0
- package/dist/choose-correct-hevc-profile.js +42 -0
- package/dist/convert-media.d.ts +3 -4
- package/dist/convert-media.js +7 -5
- package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.d.ts +11 -0
- package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.js +29 -11
- package/dist/create/iso-base-media/codec-specific/hvc1.d.ts +2 -0
- package/dist/create/iso-base-media/codec-specific/hvc1.js +48 -0
- package/dist/create/iso-base-media/create-iso-base-media.js +8 -4
- package/dist/create/iso-base-media/serialize-track.js +3 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-hvcc.d.ts +1 -0
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-hvcc.js +16 -0
- package/dist/create/matroska/cluster.d.ts +1 -1
- package/dist/create/matroska/create-matroska-media.js +8 -4
- package/dist/create/matroska/matroska-trackentry.js +3 -0
- package/dist/create/matroska/matroska-utils.d.ts +1 -1
- package/dist/create/media-fn.d.ts +2 -3
- package/dist/create/wav/create-wav.js +8 -4
- package/dist/esm/buffer.mjs +5 -22
- package/dist/esm/index.mjs +426 -62
- package/dist/esm/web-fs.mjs +4 -22
- package/dist/get-available-containers.d.ts +1 -2
- package/dist/get-available-containers.js +3 -3
- package/dist/get-available-video-codecs.d.ts +1 -2
- package/dist/get-available-video-codecs.js +3 -4
- package/dist/get-codec-string.d.ts +7 -0
- package/dist/get-codec-string.js +21 -0
- package/dist/hevc-levels.d.ts +13 -0
- package/dist/hevc-levels.js +233 -0
- package/dist/index.d.ts +0 -1
- package/dist/on-audio-track.js +1 -0
- package/dist/select-container-creator.d.ts +1 -1
- package/dist/test/remux-serverside.test.js +2 -2
- package/dist/video-encoder-config.js +4 -6
- package/dist/video-encoder.js +4 -0
- package/dist/writers/buffer-implementation/writer.d.ts +1 -1
- package/dist/writers/buffer-implementation/writer.js +5 -4
- package/dist/writers/buffer.d.ts +1 -1
- package/dist/writers/web-fs.d.ts +1 -1
- package/dist/writers/web-fs.js +4 -4
- package/package.json +5 -5
package/dist/esm/web-fs.mjs
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
18
|
-
|
|
19
1
|
// src/writers/web-fs.ts
|
|
20
2
|
var createContent = async ({ filename }) => {
|
|
21
3
|
const directoryHandle = await navigator.storage.getDirectory();
|
|
@@ -49,11 +31,14 @@ var createContent = async ({ filename }) => {
|
|
|
49
31
|
writPromise = writPromise.then(() => write(arr));
|
|
50
32
|
return writPromise;
|
|
51
33
|
},
|
|
52
|
-
|
|
34
|
+
finish: async () => {
|
|
35
|
+
await writPromise;
|
|
53
36
|
try {
|
|
54
37
|
await writable.close();
|
|
55
38
|
} catch {
|
|
56
39
|
}
|
|
40
|
+
},
|
|
41
|
+
async getBlob() {
|
|
57
42
|
const newHandle = await directoryHandle.getFileHandle(actualFilename, {
|
|
58
43
|
create: true
|
|
59
44
|
});
|
|
@@ -65,9 +50,6 @@ var createContent = async ({ filename }) => {
|
|
|
65
50
|
writPromise = writPromise.then(() => updateDataAt(position, data));
|
|
66
51
|
return writPromise;
|
|
67
52
|
},
|
|
68
|
-
waitForFinish: async () => {
|
|
69
|
-
await writPromise;
|
|
70
|
-
},
|
|
71
53
|
remove
|
|
72
54
|
};
|
|
73
55
|
return writer;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
declare const availableContainers: readonly ["webm", "mp4", "wav"];
|
|
1
|
+
export declare const availableContainers: readonly ["webm", "mp4", "wav"];
|
|
2
2
|
export type ConvertMediaContainer = (typeof availableContainers)[number];
|
|
3
3
|
export declare const getAvailableContainers: () => readonly ConvertMediaContainer[];
|
|
4
|
-
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAvailableContainers = void 0;
|
|
4
|
-
|
|
3
|
+
exports.getAvailableContainers = exports.availableContainers = void 0;
|
|
4
|
+
exports.availableContainers = ['webm', 'mp4', 'wav'];
|
|
5
5
|
const getAvailableContainers = () => {
|
|
6
|
-
return availableContainers;
|
|
6
|
+
return exports.availableContainers;
|
|
7
7
|
};
|
|
8
8
|
exports.getAvailableContainers = getAvailableContainers;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ConvertMediaContainer } from './get-available-containers';
|
|
2
|
-
declare const availableVideoCodecs: readonly ["vp8", "vp9", "h264"];
|
|
2
|
+
export declare const availableVideoCodecs: readonly ["vp8", "vp9", "h264", "h265"];
|
|
3
3
|
export type ConvertMediaVideoCodec = (typeof availableVideoCodecs)[number];
|
|
4
4
|
export declare const getAvailableVideoCodecs: ({ container, }: {
|
|
5
5
|
container: ConvertMediaContainer;
|
|
6
6
|
}) => ConvertMediaVideoCodec[];
|
|
7
|
-
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAvailableVideoCodecs = void 0;
|
|
4
|
-
|
|
5
|
-
const availableVideoCodecs = ['vp8', 'vp9', 'h264'];
|
|
3
|
+
exports.getAvailableVideoCodecs = exports.availableVideoCodecs = void 0;
|
|
4
|
+
exports.availableVideoCodecs = ['vp8', 'vp9', 'h264', 'h265'];
|
|
6
5
|
const getAvailableVideoCodecs = ({ container, }) => {
|
|
7
6
|
if (container === 'mp4') {
|
|
8
|
-
return ['h264'];
|
|
7
|
+
return ['h264', 'h265'];
|
|
9
8
|
}
|
|
10
9
|
if (container === 'webm') {
|
|
11
10
|
return ['vp8', 'vp9'];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCodecStringForEncoder = void 0;
|
|
4
|
+
const choose_correct_avc1_profile_1 = require("./choose-correct-avc1-profile");
|
|
5
|
+
const choose_correct_hevc_profile_1 = require("./choose-correct-hevc-profile");
|
|
6
|
+
const getCodecStringForEncoder = ({ codec, fps, height, width, }) => {
|
|
7
|
+
if (codec === 'h264') {
|
|
8
|
+
return (0, choose_correct_avc1_profile_1.chooseCorrectAvc1Profile)({ fps, height, width });
|
|
9
|
+
}
|
|
10
|
+
if (codec === 'h265') {
|
|
11
|
+
return (0, choose_correct_hevc_profile_1.chooseCorrectHevcProfile)({ fps, height, width });
|
|
12
|
+
}
|
|
13
|
+
if (codec === 'vp8') {
|
|
14
|
+
return 'vp8';
|
|
15
|
+
}
|
|
16
|
+
if (codec === 'vp9') {
|
|
17
|
+
return 'vp09.00.10.08';
|
|
18
|
+
}
|
|
19
|
+
throw new Error(`Unknown codec: ${codec}`);
|
|
20
|
+
};
|
|
21
|
+
exports.getCodecStringForEncoder = getCodecStringForEncoder;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type MaxRes = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
fps: number;
|
|
5
|
+
};
|
|
6
|
+
interface HEVCLevel {
|
|
7
|
+
level: string;
|
|
8
|
+
maxBitrateMainTier: number;
|
|
9
|
+
maxBitrateHighTier: number | null;
|
|
10
|
+
maxResolutionsAndFrameRates: MaxRes[];
|
|
11
|
+
}
|
|
12
|
+
export declare const hevcLevels: HEVCLevel[];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hevcLevels = void 0;
|
|
4
|
+
exports.hevcLevels = [
|
|
5
|
+
{
|
|
6
|
+
level: '3.1',
|
|
7
|
+
maxBitrateMainTier: 10000,
|
|
8
|
+
maxBitrateHighTier: null,
|
|
9
|
+
maxResolutionsAndFrameRates: [
|
|
10
|
+
{
|
|
11
|
+
width: 720,
|
|
12
|
+
height: 480,
|
|
13
|
+
fps: 84.3,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
width: 720,
|
|
17
|
+
height: 576,
|
|
18
|
+
fps: 75,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
width: 960,
|
|
22
|
+
height: 540,
|
|
23
|
+
fps: 60,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
width: 1280,
|
|
27
|
+
height: 720,
|
|
28
|
+
fps: 33.7,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
level: '4',
|
|
34
|
+
maxBitrateMainTier: 12000,
|
|
35
|
+
maxBitrateHighTier: 30000,
|
|
36
|
+
maxResolutionsAndFrameRates: [
|
|
37
|
+
{
|
|
38
|
+
width: 1280,
|
|
39
|
+
height: 720,
|
|
40
|
+
fps: 68,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
width: 1920,
|
|
44
|
+
height: 1080,
|
|
45
|
+
fps: 32,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
width: 2048,
|
|
49
|
+
height: 1080,
|
|
50
|
+
fps: 30,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
level: '4.1',
|
|
56
|
+
maxBitrateMainTier: 20000,
|
|
57
|
+
maxBitrateHighTier: 50000,
|
|
58
|
+
maxResolutionsAndFrameRates: [
|
|
59
|
+
{
|
|
60
|
+
width: 1280,
|
|
61
|
+
height: 720,
|
|
62
|
+
fps: 136,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
width: 1920,
|
|
66
|
+
height: 1080,
|
|
67
|
+
fps: 64,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
width: 2048,
|
|
71
|
+
height: 1080,
|
|
72
|
+
fps: 60,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
level: '5',
|
|
78
|
+
maxBitrateMainTier: 25000,
|
|
79
|
+
maxBitrateHighTier: 100000,
|
|
80
|
+
maxResolutionsAndFrameRates: [
|
|
81
|
+
{
|
|
82
|
+
width: 1920,
|
|
83
|
+
height: 1080,
|
|
84
|
+
fps: 128,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
width: 2048,
|
|
88
|
+
height: 1080,
|
|
89
|
+
fps: 120,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
width: 3840,
|
|
93
|
+
height: 2160,
|
|
94
|
+
fps: 32,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
width: 4096,
|
|
98
|
+
height: 2160,
|
|
99
|
+
fps: 30,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
level: '5.1',
|
|
105
|
+
maxBitrateMainTier: 40000,
|
|
106
|
+
maxBitrateHighTier: 160000,
|
|
107
|
+
maxResolutionsAndFrameRates: [
|
|
108
|
+
{
|
|
109
|
+
width: 1920,
|
|
110
|
+
height: 1080,
|
|
111
|
+
fps: 256,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
width: 2048,
|
|
115
|
+
height: 1080,
|
|
116
|
+
fps: 240,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
width: 3840,
|
|
120
|
+
height: 2160,
|
|
121
|
+
fps: 64,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
width: 4096,
|
|
125
|
+
height: 2160,
|
|
126
|
+
fps: 60,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
level: '5.2',
|
|
132
|
+
maxBitrateMainTier: 60000,
|
|
133
|
+
maxBitrateHighTier: 240000,
|
|
134
|
+
maxResolutionsAndFrameRates: [
|
|
135
|
+
{
|
|
136
|
+
width: 2048,
|
|
137
|
+
height: 1080,
|
|
138
|
+
fps: 300,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
width: 3840,
|
|
142
|
+
height: 2160,
|
|
143
|
+
fps: 128,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
width: 4096,
|
|
147
|
+
height: 2160,
|
|
148
|
+
fps: 120,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
level: '6',
|
|
154
|
+
maxBitrateMainTier: 60000,
|
|
155
|
+
maxBitrateHighTier: 240000,
|
|
156
|
+
maxResolutionsAndFrameRates: [
|
|
157
|
+
{
|
|
158
|
+
width: 3840,
|
|
159
|
+
height: 2160,
|
|
160
|
+
fps: 128,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
width: 4096,
|
|
164
|
+
height: 2160,
|
|
165
|
+
fps: 120,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
width: 7680,
|
|
169
|
+
height: 4320,
|
|
170
|
+
fps: 32,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
width: 8192,
|
|
174
|
+
height: 4320,
|
|
175
|
+
fps: 30,
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
level: '6.1',
|
|
181
|
+
maxBitrateMainTier: 120000,
|
|
182
|
+
maxBitrateHighTier: 480000,
|
|
183
|
+
maxResolutionsAndFrameRates: [
|
|
184
|
+
{
|
|
185
|
+
width: 3840,
|
|
186
|
+
height: 2160,
|
|
187
|
+
fps: 256,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
width: 4096,
|
|
191
|
+
height: 2160,
|
|
192
|
+
fps: 240,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
width: 7680,
|
|
196
|
+
height: 4320,
|
|
197
|
+
fps: 64,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
width: 8192,
|
|
201
|
+
height: 4320,
|
|
202
|
+
fps: 60,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
level: '6.2',
|
|
208
|
+
maxBitrateMainTier: 240000,
|
|
209
|
+
maxBitrateHighTier: 800000,
|
|
210
|
+
maxResolutionsAndFrameRates: [
|
|
211
|
+
{
|
|
212
|
+
width: 3840,
|
|
213
|
+
height: 2160,
|
|
214
|
+
fps: 512,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
width: 4096,
|
|
218
|
+
height: 2160,
|
|
219
|
+
fps: 480,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
width: 7680,
|
|
223
|
+
height: 4320,
|
|
224
|
+
fps: 128,
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
width: 8192,
|
|
228
|
+
height: 4320,
|
|
229
|
+
fps: 120,
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
];
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export { ConvertMediaOnVideoTrackHandler, VideoOperation, } from './on-video-tra
|
|
|
17
17
|
export type { ResizeOperation } from './resizing/mode';
|
|
18
18
|
export { createVideoDecoder, WebCodecsVideoDecoder } from './video-decoder';
|
|
19
19
|
export { createVideoEncoder, WebCodecsVideoEncoder } from './video-encoder';
|
|
20
|
-
export { WriterInterface } from './writers/writer';
|
|
21
20
|
export declare const WebCodecsInternals: {
|
|
22
21
|
rotateAndResizeVideoFrame: ({ frame, rotation, videoCodec, resizeOperation, }: {
|
|
23
22
|
frame: VideoFrame;
|
package/dist/on-audio-track.js
CHANGED
|
@@ -85,6 +85,7 @@ const makeAudioTrackHandler = ({ state, defaultAudioCodec: audioCodec, controlle
|
|
|
85
85
|
audioObjectType: 2,
|
|
86
86
|
sampleRate: track.sampleRate,
|
|
87
87
|
channelConfiguration: track.numberOfChannels,
|
|
88
|
+
codecPrivate: null,
|
|
88
89
|
})
|
|
89
90
|
: null;
|
|
90
91
|
const { trackNumber } = await state.addTrack({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ConvertMediaContainer } from './get-available-containers';
|
|
2
|
-
export declare const selectContainerCreator: (container: ConvertMediaContainer) => ({
|
|
2
|
+
export declare const selectContainerCreator: (container: ConvertMediaContainer) => ({ filename, logLevel, onBytesProgress, onMillisecondsProgress, writer, progressTracker, }: import("./create/media-fn").MediaFnGeneratorInput) => Promise<import("./create/media-fn").MediaFn>;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const example_videos_1 = require("@remotion/example-videos");
|
|
4
4
|
const node_1 = require("@remotion/media-parser/node");
|
|
5
|
+
const node_writer_1 = require("@remotion/media-parser/node-writer");
|
|
5
6
|
const bun_test_1 = require("bun:test");
|
|
6
7
|
const node_fs_1 = require("node:fs");
|
|
7
8
|
const convert_media_1 = require("../convert-media");
|
|
8
|
-
const node_2 = require("../writers/node");
|
|
9
9
|
(0, bun_test_1.test)('should be able to remux server side', async () => {
|
|
10
10
|
// bun file descriptor problem
|
|
11
11
|
if (process.platform === 'win32') {
|
|
@@ -15,7 +15,7 @@ const node_2 = require("../writers/node");
|
|
|
15
15
|
src: example_videos_1.exampleVideos.bigBuckBunny,
|
|
16
16
|
reader: node_1.nodeReader,
|
|
17
17
|
container: 'mp4',
|
|
18
|
-
writer: (0,
|
|
18
|
+
writer: (0, node_writer_1.nodeWriter)('outputbun.mp4'),
|
|
19
19
|
});
|
|
20
20
|
const data = await save();
|
|
21
21
|
(0, bun_test_1.expect)(data.size).toBe(15306323);
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getVideoEncoderConfig = void 0;
|
|
4
4
|
const browser_quirks_1 = require("./browser-quirks");
|
|
5
|
-
const
|
|
5
|
+
const get_codec_string_1 = require("./get-codec-string");
|
|
6
6
|
const getVideoEncoderConfig = async ({ codec, height, width, fps, }) => {
|
|
7
7
|
if (typeof VideoEncoder === 'undefined') {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
const config = {
|
|
11
|
-
codec: codec
|
|
12
|
-
? (0, choose_correct_avc1_profile_1.chooseCorrectAvc1Profile)({ fps, height, width })
|
|
13
|
-
: codec === 'vp9'
|
|
14
|
-
? 'vp09.00.10.08'
|
|
15
|
-
: codec,
|
|
11
|
+
codec: (0, get_codec_string_1.getCodecStringForEncoder)({ codec, fps, height, width }),
|
|
16
12
|
height,
|
|
17
13
|
width,
|
|
18
14
|
bitrate: (0, browser_quirks_1.isSafari)() ? 3000000 : undefined,
|
|
15
|
+
bitrateMode: codec === 'vp9' && !(0, browser_quirks_1.isSafari)() ? 'quantizer' : undefined,
|
|
16
|
+
framerate: fps !== null && fps !== void 0 ? fps : undefined,
|
|
19
17
|
};
|
|
20
18
|
const hardware = {
|
|
21
19
|
...config,
|
package/dist/video-encoder.js
CHANGED
|
@@ -72,6 +72,10 @@ const createVideoEncoder = ({ onChunk, onError, signal, config, logLevel, output
|
|
|
72
72
|
const keyFrame = framesProcessed % 40 === 0;
|
|
73
73
|
encoder.encode((0, convert_to_correct_videoframe_1.convertToCorrectVideoFrame)({ videoFrame: frame, outputCodec }), {
|
|
74
74
|
keyFrame,
|
|
75
|
+
// @ts-expect-error
|
|
76
|
+
vp9: {
|
|
77
|
+
quantizer: 36,
|
|
78
|
+
},
|
|
75
79
|
});
|
|
76
80
|
ioSynchronizer.inputItem(frame.timestamp, keyFrame);
|
|
77
81
|
framesProcessed++;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CreateContent } from '
|
|
1
|
+
import type { CreateContent } from '@remotion/media-parser';
|
|
2
2
|
export declare const createContent: CreateContent;
|
|
@@ -27,10 +27,14 @@ const createContent = ({ filename, mimeType }) => {
|
|
|
27
27
|
writPromise = writPromise.then(() => write(arr));
|
|
28
28
|
return writPromise;
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
finish: async () => {
|
|
31
|
+
await writPromise;
|
|
31
32
|
if (removed) {
|
|
32
33
|
return Promise.reject(new Error('Already called .remove() on the result'));
|
|
33
34
|
}
|
|
35
|
+
return Promise.resolve();
|
|
36
|
+
},
|
|
37
|
+
getBlob() {
|
|
34
38
|
const arr = new Uint8Array(buf);
|
|
35
39
|
return Promise.resolve(
|
|
36
40
|
// TODO: Unhardcode MIME type and file name
|
|
@@ -45,9 +49,6 @@ const createContent = ({ filename, mimeType }) => {
|
|
|
45
49
|
writPromise = writPromise.then(() => updateDataAt(position, newData));
|
|
46
50
|
return writPromise;
|
|
47
51
|
},
|
|
48
|
-
waitForFinish: async () => {
|
|
49
|
-
await writPromise;
|
|
50
|
-
},
|
|
51
52
|
};
|
|
52
53
|
return Promise.resolve(writer);
|
|
53
54
|
};
|
package/dist/writers/buffer.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { WriterInterface } from '
|
|
1
|
+
import type { WriterInterface } from '@remotion/media-parser';
|
|
2
2
|
export declare const bufferWriter: WriterInterface;
|
package/dist/writers/web-fs.d.ts
CHANGED
package/dist/writers/web-fs.js
CHANGED
|
@@ -33,13 +33,16 @@ const createContent = async ({ filename }) => {
|
|
|
33
33
|
writPromise = writPromise.then(() => write(arr));
|
|
34
34
|
return writPromise;
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
finish: async () => {
|
|
37
|
+
await writPromise;
|
|
37
38
|
try {
|
|
38
39
|
await writable.close();
|
|
39
40
|
}
|
|
40
41
|
catch (_a) {
|
|
41
42
|
// Ignore, could already be closed
|
|
42
43
|
}
|
|
44
|
+
},
|
|
45
|
+
async getBlob() {
|
|
43
46
|
const newHandle = await directoryHandle.getFileHandle(actualFilename, {
|
|
44
47
|
create: true,
|
|
45
48
|
});
|
|
@@ -51,9 +54,6 @@ const createContent = async ({ filename }) => {
|
|
|
51
54
|
writPromise = writPromise.then(() => updateDataAt(position, data));
|
|
52
55
|
return writPromise;
|
|
53
56
|
},
|
|
54
|
-
waitForFinish: async () => {
|
|
55
|
-
await writPromise;
|
|
56
|
-
},
|
|
57
57
|
remove,
|
|
58
58
|
};
|
|
59
59
|
return writer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/webcodecs",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.252",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
18
18
|
"license": "Remotion License (See https://remotion.dev/docs/webcodecs#license)",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@remotion/media-parser": "4.0.
|
|
21
|
-
"@remotion/licensing": "4.0.
|
|
20
|
+
"@remotion/media-parser": "4.0.252",
|
|
21
|
+
"@remotion/licensing": "4.0.252"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/dom-webcodecs": "0.1.11",
|
|
26
26
|
"eslint": "9.14.0",
|
|
27
|
-
"@remotion/example-videos": "4.0.
|
|
28
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
27
|
+
"@remotion/example-videos": "4.0.252",
|
|
28
|
+
"@remotion/eslint-config-internal": "4.0.252"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [],
|
|
31
31
|
"publishConfig": {
|