@remotion/renderer 4.0.213 → 4.0.214
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/assets/read-file.d.ts +0 -1
- package/dist/assets/truncate-utf8-bytes.js +1 -2
- package/dist/browser/BrowserRunner.d.ts +0 -1
- package/dist/browser/ExecutionContext.js +1 -1
- package/dist/browser/JSHandle.js +2 -2
- package/dist/browser/mitt/index.js +1 -1
- package/dist/browser/util.d.ts +0 -1
- package/dist/browser/util.js +13 -13
- package/dist/call-ffmpeg.d.ts +4 -5
- package/dist/client.d.ts +90 -90
- package/dist/compositor/compose.d.ts +1 -4
- package/dist/compositor/get-executable-path.d.ts +1 -1
- package/dist/compositor/get-executable-path.js +2 -2
- package/dist/get-extension-from-codec.d.ts +1 -1
- package/dist/get-silent-parts.d.ts +4 -4
- package/dist/image-format.d.ts +1 -1
- package/dist/index.d.ts +84 -86
- package/dist/mime-types.js +3 -3
- package/dist/offthread-video-server.d.ts +0 -1
- package/dist/options/audio-codec.d.ts +3 -3
- package/dist/options/color-space.d.ts +8 -4
- package/dist/options/gl.d.ts +3 -3
- package/dist/options/index.d.ts +18 -18
- package/dist/options/log-level.d.ts +2 -2
- package/dist/options/option.d.ts +0 -1
- package/dist/options/options-map.d.ts +61 -61
- package/dist/options/video-codec.d.ts +1 -1
- package/dist/options/x264-preset.d.ts +2 -2
- package/dist/p-limit.d.ts +1 -1
- package/dist/pixel-format.d.ts +1 -1
- package/dist/port-config.d.ts +0 -9
- package/dist/provide-screenshot.d.ts +0 -1
- package/dist/puppeteer-evaluate.js +2 -3
- package/dist/puppeteer-screenshot.d.ts +0 -1
- package/dist/pure.d.ts +4 -4
- package/dist/render-frames.d.ts +0 -1
- package/dist/render-frames.js +1 -1
- package/dist/render-has-audio.d.ts +1 -1
- package/dist/render-media.d.ts +0 -1
- package/dist/render-media.js +1 -1
- package/dist/render-still.d.ts +0 -1
- package/dist/screenshot-dom-element.d.ts +0 -1
- package/dist/screenshot-task.d.ts +2 -3
- package/dist/serve-handler/index.d.ts +0 -1
- package/dist/serve-handler/range-parser.d.ts +2 -2
- package/dist/stitch-frames-to-video.d.ts +0 -1
- package/dist/take-frame-and-compose.d.ts +0 -1
- package/dist/take-frame-and-compose.js +1 -1
- package/dist/to-megabytes.js +1 -2
- package/dist/truthy.js +1 -2
- package/dist/validate-output-filename.d.ts +2 -1
- package/dist/ws/ws-types.d.ts +0 -1
- package/package.json +11 -11
- package/dist/browser/is-target-closed-err.d.ts +0 -1
- package/dist/browser/is-target-closed-err.js +0 -9
- package/dist/is-delay-render-error-with.retry.d.ts +0 -2
- package/dist/is-delay-render-error-with.retry.js +0 -37
- package/dist/streaming.d.ts +0 -11
- package/dist/streaming.js +0 -140
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { ClipRegion } from 'remotion/no-react';
|
|
3
2
|
import type { Page } from './browser/BrowserPage';
|
|
4
3
|
import type { StillImageFormat } from './image-format';
|
|
5
4
|
export declare const screenshotTask: ({ format, height, omitBackground, page, width, path, jpegQuality, clipRegion, scale, }: {
|
|
6
5
|
page: Page;
|
|
7
6
|
format: StillImageFormat;
|
|
8
|
-
path?: string
|
|
9
|
-
jpegQuality?: number
|
|
7
|
+
path?: string;
|
|
8
|
+
jpegQuality?: number;
|
|
10
9
|
omitBackground: boolean;
|
|
11
10
|
width: number;
|
|
12
11
|
height: number;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
5
5
|
* MIT Licensed
|
|
6
6
|
*/
|
|
7
|
-
export declare const rangeParser: (size: number, str: string) =>
|
|
7
|
+
export declare const rangeParser: (size: number, str: string) => {
|
|
8
8
|
type: string;
|
|
9
9
|
ranges: {
|
|
10
10
|
start: number;
|
|
11
11
|
end: number;
|
|
12
12
|
}[];
|
|
13
|
-
} | -2;
|
|
13
|
+
} | -1 | -2;
|
|
@@ -46,7 +46,7 @@ const takeFrameAndCompose = async ({ freePage, imageFormat, jpegQuality, frame,
|
|
|
46
46
|
jpegQuality,
|
|
47
47
|
options: {
|
|
48
48
|
frame,
|
|
49
|
-
output: shouldMakeBuffer ? null : (_a = needsComposing === null || needsComposing === void 0 ? void 0 : needsComposing.tmpFile) !== null && _a !== void 0 ? _a : output,
|
|
49
|
+
output: shouldMakeBuffer ? null : ((_a = needsComposing === null || needsComposing === void 0 ? void 0 : needsComposing.tmpFile) !== null && _a !== void 0 ? _a : output),
|
|
50
50
|
},
|
|
51
51
|
height,
|
|
52
52
|
width,
|
package/dist/to-megabytes.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toMegabytes =
|
|
3
|
+
exports.toMegabytes = toMegabytes;
|
|
4
4
|
function toMegabytes(bytes) {
|
|
5
5
|
const mb = bytes / 1024 / 1024;
|
|
6
6
|
return `${Math.round(mb * 10) / 10} Mb`;
|
|
7
7
|
}
|
|
8
|
-
exports.toMegabytes = toMegabytes;
|
package/dist/truthy.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Codec } from './codec';
|
|
1
2
|
import type { AudioCodec } from './options/audio-codec';
|
|
2
|
-
export declare const validateOutputFilename: <T extends
|
|
3
|
+
export declare const validateOutputFilename: <T extends Codec>({ codec, audioCodecSetting, extension, preferLossless, separateAudioTo, }: {
|
|
3
4
|
codec: T;
|
|
4
5
|
audioCodecSetting: AudioCodec | null;
|
|
5
6
|
extension: string;
|
package/dist/ws/ws-types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/renderer",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.214",
|
|
7
7
|
"description": "Render Remotion videos using Node.js or Bun",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.17.1",
|
|
21
|
-
"remotion": "4.0.
|
|
22
|
-
"@remotion/streaming": "4.0.
|
|
21
|
+
"remotion": "4.0.214",
|
|
22
|
+
"@remotion/streaming": "4.0.214"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": ">=16.8.0",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@types/ws": "8.5.10"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@remotion/compositor-darwin-
|
|
38
|
-
"@remotion/compositor-
|
|
39
|
-
"@remotion/compositor-linux-arm64-
|
|
40
|
-
"@remotion/compositor-linux-
|
|
41
|
-
"@remotion/compositor-
|
|
42
|
-
"@remotion/compositor-
|
|
43
|
-
"@remotion/compositor-
|
|
37
|
+
"@remotion/compositor-darwin-x64": "4.0.214",
|
|
38
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.214",
|
|
39
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.214",
|
|
40
|
+
"@remotion/compositor-linux-x64-musl": "4.0.214",
|
|
41
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.214",
|
|
42
|
+
"@remotion/compositor-darwin-arm64": "4.0.214",
|
|
43
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.214"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"remotion",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"formatting": "prettier src --check",
|
|
58
58
|
"lint": "eslint src --ext ts,tsx",
|
|
59
59
|
"test": "bun test src",
|
|
60
|
-
"
|
|
60
|
+
"make": "node build.mjs --debug",
|
|
61
61
|
"build-all": "node build.mjs --all"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isTargetClosedErr: (error: Error | undefined) => boolean | undefined;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTargetClosedErr = void 0;
|
|
4
|
-
const isTargetClosedErr = (error) => {
|
|
5
|
-
var _a, _b;
|
|
6
|
-
return (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('Target closed')) ||
|
|
7
|
-
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('Session closed')));
|
|
8
|
-
};
|
|
9
|
-
exports.isTargetClosedErr = isTargetClosedErr;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRetriesLeftFromError = exports.isDelayRenderErrorWithRetry = void 0;
|
|
4
|
-
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
const isDelayRenderErrorWithRetry = (error) => {
|
|
6
|
-
var _a;
|
|
7
|
-
if (!error) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
const shouldRetryError = (_a = error.stack) === null || _a === void 0 ? void 0 : _a.includes(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
11
|
-
return shouldRetryError;
|
|
12
|
-
};
|
|
13
|
-
exports.isDelayRenderErrorWithRetry = isDelayRenderErrorWithRetry;
|
|
14
|
-
const getRetriesLeftFromError = (error) => {
|
|
15
|
-
if (!error) {
|
|
16
|
-
throw new Error('Expected stack');
|
|
17
|
-
}
|
|
18
|
-
const { stack } = error;
|
|
19
|
-
if (!stack) {
|
|
20
|
-
throw new Error('Expected stack: ' + JSON.stringify(error));
|
|
21
|
-
}
|
|
22
|
-
const beforeIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN);
|
|
23
|
-
if (beforeIndex === -1) {
|
|
24
|
-
throw new Error('Expected to find attempt token in stack');
|
|
25
|
-
}
|
|
26
|
-
const afterIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
27
|
-
if (afterIndex === -1) {
|
|
28
|
-
throw new Error('Expected to find retry token in stack');
|
|
29
|
-
}
|
|
30
|
-
const inbetween = stack.substring(beforeIndex + no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
|
|
31
|
-
const parsed = Number(inbetween);
|
|
32
|
-
if (Number.isNaN(parsed)) {
|
|
33
|
-
throw new Error(`Expected to find a number in the stack ${stack}`);
|
|
34
|
-
}
|
|
35
|
-
return parsed;
|
|
36
|
-
};
|
|
37
|
-
exports.getRetriesLeftFromError = getRetriesLeftFromError;
|
package/dist/streaming.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const streamingKey = "remotion_buffer:";
|
|
2
|
-
export declare const makeStreamer: (onMessage: (statusType: 'success' | 'error', nonce: string, data: Uint8Array) => void) => {
|
|
3
|
-
onData: (data: Uint8Array) => void;
|
|
4
|
-
getOutputBuffer: () => Uint8Array;
|
|
5
|
-
clear: () => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const makeStreamPayloadMessage: ({ status, body, nonce, }: {
|
|
8
|
-
nonce: string;
|
|
9
|
-
status: 0 | 1;
|
|
10
|
-
body: Uint8Array;
|
|
11
|
-
}) => Uint8Array;
|
package/dist/streaming.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeStreamPayloadMessage = exports.makeStreamer = exports.streamingKey = void 0;
|
|
4
|
-
exports.streamingKey = 'remotion_buffer:';
|
|
5
|
-
const magicWordStr = 'remotion_buffer:';
|
|
6
|
-
const makeStreamer = (onMessage) => {
|
|
7
|
-
const separator = new Uint8Array(magicWordStr.length);
|
|
8
|
-
for (let i = 0; i < magicWordStr.length; i++) {
|
|
9
|
-
separator[i] = magicWordStr.charCodeAt(i);
|
|
10
|
-
}
|
|
11
|
-
let unprocessedBuffers = [];
|
|
12
|
-
let outputBuffer = new Uint8Array(0);
|
|
13
|
-
let missingData = null;
|
|
14
|
-
const processInput = () => {
|
|
15
|
-
let separatorIndex = outputBuffer.indexOf(separator[0]); // Start checking for the first byte of the separator
|
|
16
|
-
if (separatorIndex === -1 ||
|
|
17
|
-
outputBuffer
|
|
18
|
-
.subarray(separatorIndex, separatorIndex + separator.length)
|
|
19
|
-
.toString() !== separator.toString()) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
separatorIndex += separator.length;
|
|
23
|
-
let nonceString = '';
|
|
24
|
-
let lengthString = '';
|
|
25
|
-
let statusString = '';
|
|
26
|
-
// eslint-disable-next-line no-constant-condition
|
|
27
|
-
while (true) {
|
|
28
|
-
if (separatorIndex > outputBuffer.length - 1) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
32
|
-
separatorIndex++;
|
|
33
|
-
if (nextDigit === 0x3a) {
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
nonceString += String.fromCharCode(nextDigit);
|
|
37
|
-
}
|
|
38
|
-
// eslint-disable-next-line no-constant-condition
|
|
39
|
-
while (true) {
|
|
40
|
-
if (separatorIndex > outputBuffer.length - 1) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
44
|
-
separatorIndex++;
|
|
45
|
-
if (nextDigit === 0x3a) {
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
lengthString += String.fromCharCode(nextDigit);
|
|
49
|
-
}
|
|
50
|
-
// eslint-disable-next-line no-constant-condition
|
|
51
|
-
while (true) {
|
|
52
|
-
if (separatorIndex > outputBuffer.length - 1) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const nextDigit = outputBuffer[separatorIndex];
|
|
56
|
-
if (nextDigit === 0x3a) {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
separatorIndex++;
|
|
60
|
-
statusString += String.fromCharCode(nextDigit);
|
|
61
|
-
}
|
|
62
|
-
const length = Number(lengthString);
|
|
63
|
-
const status = Number(statusString);
|
|
64
|
-
const dataLength = outputBuffer.length - separatorIndex - 1;
|
|
65
|
-
if (dataLength < length) {
|
|
66
|
-
missingData = {
|
|
67
|
-
dataMissing: length - dataLength,
|
|
68
|
-
};
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const data = outputBuffer.subarray(separatorIndex + 1, separatorIndex + 1 + Number(lengthString));
|
|
72
|
-
onMessage(status === 1 ? 'error' : 'success', nonceString, data);
|
|
73
|
-
missingData = null;
|
|
74
|
-
outputBuffer = outputBuffer.subarray(separatorIndex + Number(lengthString) + 1);
|
|
75
|
-
processInput();
|
|
76
|
-
};
|
|
77
|
-
const onData = (data) => {
|
|
78
|
-
unprocessedBuffers.push(data);
|
|
79
|
-
const separatorIndex = data.indexOf(separator[0]);
|
|
80
|
-
if (separatorIndex === -1) {
|
|
81
|
-
if (missingData) {
|
|
82
|
-
missingData.dataMissing -= data.length;
|
|
83
|
-
}
|
|
84
|
-
if (!missingData || missingData.dataMissing > 0) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
unprocessedBuffers.unshift(outputBuffer);
|
|
89
|
-
outputBuffer = new Uint8Array(unprocessedBuffers.reduce((acc, val) => acc + val.length, 0));
|
|
90
|
-
let offset = 0;
|
|
91
|
-
for (const buf of unprocessedBuffers) {
|
|
92
|
-
outputBuffer.set(buf, offset);
|
|
93
|
-
offset += buf.length;
|
|
94
|
-
}
|
|
95
|
-
unprocessedBuffers = [];
|
|
96
|
-
processInput();
|
|
97
|
-
};
|
|
98
|
-
return {
|
|
99
|
-
onData,
|
|
100
|
-
getOutputBuffer: () => outputBuffer,
|
|
101
|
-
clear: () => {
|
|
102
|
-
unprocessedBuffers = [];
|
|
103
|
-
outputBuffer = new Uint8Array(0);
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
exports.makeStreamer = makeStreamer;
|
|
108
|
-
const makeStreamPayloadMessage = ({ status, body, nonce, }) => {
|
|
109
|
-
const nonceArr = new TextEncoder().encode(nonce);
|
|
110
|
-
const magicWordArr = new TextEncoder().encode(magicWordStr);
|
|
111
|
-
const separatorArr = new TextEncoder().encode(':');
|
|
112
|
-
const bodyLengthArr = new TextEncoder().encode(body.length.toString());
|
|
113
|
-
const statusArr = new TextEncoder().encode(String(status));
|
|
114
|
-
// Calculate total length of new Uint8Array
|
|
115
|
-
const totalLength = nonceArr.length +
|
|
116
|
-
magicWordArr.length +
|
|
117
|
-
separatorArr.length * 3 +
|
|
118
|
-
bodyLengthArr.length +
|
|
119
|
-
statusArr.length +
|
|
120
|
-
body.length;
|
|
121
|
-
// Create a new Uint8Array to hold all combined parts
|
|
122
|
-
const concat = new Uint8Array(totalLength);
|
|
123
|
-
let offset = 0;
|
|
124
|
-
// Function to append data to concat
|
|
125
|
-
const appendToConcat = (data) => {
|
|
126
|
-
concat.set(data, offset);
|
|
127
|
-
offset += data.length;
|
|
128
|
-
};
|
|
129
|
-
// Building the final Uint8Array
|
|
130
|
-
appendToConcat(magicWordArr);
|
|
131
|
-
appendToConcat(nonceArr);
|
|
132
|
-
appendToConcat(separatorArr);
|
|
133
|
-
appendToConcat(bodyLengthArr);
|
|
134
|
-
appendToConcat(separatorArr);
|
|
135
|
-
appendToConcat(statusArr);
|
|
136
|
-
appendToConcat(separatorArr);
|
|
137
|
-
appendToConcat(body);
|
|
138
|
-
return concat;
|
|
139
|
-
};
|
|
140
|
-
exports.makeStreamPayloadMessage = makeStreamPayloadMessage;
|