@remotion/renderer 4.0.207 → 4.0.209
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/browser/BrowserFetcher.js +0 -2
- package/dist/browser/browser-download-progress-bar.js +0 -1
- package/dist/get-local-browser.d.ts +1 -1
- package/dist/get-local-browser.js +1 -37
- package/dist/is-delay-render-error-with-retry.d.ts +1 -0
- package/dist/is-delay-render-error-with-retry.js +28 -0
- package/dist/open-browser.d.ts +4 -0
- package/dist/options/headless.js +1 -1
- package/dist/render-frames.js +1 -1
- package/dist/render-media.js +5 -0
- package/dist/streaming.d.ts +11 -0
- package/dist/streaming.js +140 -0
- package/ensure-browser.mjs +1 -693
- package/package.json +10 -10
|
@@ -49,7 +49,6 @@ const extract_zip_1 = __importDefault(require("extract-zip"));
|
|
|
49
49
|
const node_util_1 = require("node:util");
|
|
50
50
|
const download_file_1 = require("../assets/download-file");
|
|
51
51
|
const make_file_executable_1 = require("../compositor/make-file-executable");
|
|
52
|
-
const logger_1 = require("../logger");
|
|
53
52
|
const get_download_destination_1 = require("./get-download-destination");
|
|
54
53
|
const TESTED_VERSION = '123.0.6312.86';
|
|
55
54
|
// https://github.com/microsoft/playwright/tree/v1.42.0
|
|
@@ -128,7 +127,6 @@ const downloadBrowser = async ({ logLevel, indent, onProgress, version, }) => {
|
|
|
128
127
|
indent,
|
|
129
128
|
logLevel,
|
|
130
129
|
});
|
|
131
|
-
logger_1.Log.info({ indent, logLevel });
|
|
132
130
|
await (0, extract_zip_1.default)(archivePath, { dir: outputPath });
|
|
133
131
|
const chromePath = path.join(outputPath, 'chrome-linux', 'chrome');
|
|
134
132
|
const chromeHeadlessShellPath = path.join(outputPath, 'chrome-linux', 'chrome-headless-shell');
|
|
@@ -4,7 +4,6 @@ exports.defaultBrowserDownloadProgress = void 0;
|
|
|
4
4
|
const logger_1 = require("../logger");
|
|
5
5
|
const to_megabytes_1 = require("../to-megabytes");
|
|
6
6
|
const defaultBrowserDownloadProgress = ({ indent, logLevel, api, }) => () => {
|
|
7
|
-
logger_1.Log.info({ indent, logLevel }, 'No local browser could be found.');
|
|
8
7
|
logger_1.Log.info({ indent, logLevel }, 'Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell');
|
|
9
8
|
logger_1.Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
|
|
10
9
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getLocalBrowser: () =>
|
|
1
|
+
export declare const getLocalBrowser: () => null;
|
|
@@ -5,44 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getLocalBrowser = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const node_os_1 = require("node:os");
|
|
9
|
-
const no_react_1 = require("remotion/no-react");
|
|
10
8
|
const getSearchPathsForProduct = () => {
|
|
11
|
-
|
|
12
|
-
if (no_react_1.NoReactInternals.ENABLE_V5_BREAKING_CHANGES) {
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
return [
|
|
16
|
-
(_a = process.env.PUPPETEER_EXECUTABLE_PATH) !== null && _a !== void 0 ? _a : null,
|
|
17
|
-
process.platform === 'darwin'
|
|
18
|
-
? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
|
19
|
-
: null,
|
|
20
|
-
process.platform === 'linux' ? '/usr/bin/google-chrome' : null,
|
|
21
|
-
process.platform === 'linux' ? '/usr/bin/chromium-browser' : null,
|
|
22
|
-
process.platform === 'linux' ? '/usr/bin/chromium' : null, // Debian
|
|
23
|
-
process.platform === 'linux'
|
|
24
|
-
? '/app/.apt/usr/bin/google-chrome-stable'
|
|
25
|
-
: null,
|
|
26
|
-
process.platform === 'win32'
|
|
27
|
-
? 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
|
|
28
|
-
: null,
|
|
29
|
-
process.platform === 'win32'
|
|
30
|
-
? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
|
|
31
|
-
: null,
|
|
32
|
-
process.platform === 'win32'
|
|
33
|
-
? (0, node_os_1.homedir)() + '\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe'
|
|
34
|
-
: null,
|
|
35
|
-
process.platform === 'win32'
|
|
36
|
-
? 'C:\\Program Files\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
37
|
-
: null,
|
|
38
|
-
process.platform === 'win32'
|
|
39
|
-
? 'C:\\Program Files (x86)\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
40
|
-
: null,
|
|
41
|
-
process.platform === 'win32'
|
|
42
|
-
? (0, node_os_1.homedir)() +
|
|
43
|
-
'\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe'
|
|
44
|
-
: null,
|
|
45
|
-
].filter(Boolean);
|
|
9
|
+
return [];
|
|
46
10
|
};
|
|
47
11
|
const getLocalBrowser = () => {
|
|
48
12
|
for (const p of getSearchPathsForProduct()) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRetriesLeftFromError: (error: Error | undefined) => number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRetriesLeftFromError = void 0;
|
|
4
|
+
const no_react_1 = require("remotion/no-react");
|
|
5
|
+
const getRetriesLeftFromError = (error) => {
|
|
6
|
+
if (!error) {
|
|
7
|
+
throw new Error('Expected stack');
|
|
8
|
+
}
|
|
9
|
+
const { stack } = error;
|
|
10
|
+
if (!stack) {
|
|
11
|
+
throw new Error('Expected stack: ' + JSON.stringify(error));
|
|
12
|
+
}
|
|
13
|
+
const beforeIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN);
|
|
14
|
+
if (beforeIndex === -1) {
|
|
15
|
+
throw new Error('Expected to find attempt token in stack');
|
|
16
|
+
}
|
|
17
|
+
const afterIndex = stack.indexOf(no_react_1.NoReactInternals.DELAY_RENDER_RETRY_TOKEN);
|
|
18
|
+
if (afterIndex === -1) {
|
|
19
|
+
throw new Error('Expected to find retry token in stack');
|
|
20
|
+
}
|
|
21
|
+
const inbetween = stack.substring(beforeIndex + no_react_1.NoReactInternals.DELAY_RENDER_ATTEMPT_TOKEN.length, afterIndex);
|
|
22
|
+
const parsed = Number(inbetween);
|
|
23
|
+
if (Number.isNaN(parsed)) {
|
|
24
|
+
throw new Error(`Expected to find a number in the stack ${stack}`);
|
|
25
|
+
}
|
|
26
|
+
return parsed;
|
|
27
|
+
};
|
|
28
|
+
exports.getRetriesLeftFromError = getRetriesLeftFromError;
|
package/dist/open-browser.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ import type { validOpenGlRenderers } from './options/gl';
|
|
|
7
7
|
import type { OnBrowserDownload } from './options/on-browser-download';
|
|
8
8
|
type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
|
|
9
9
|
type OnlyV4Options = typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? {} : {
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated - Will be removed in v5.
|
|
12
|
+
* Chrome Headless shell does not allow disabling headless mode anymore.
|
|
13
|
+
*/
|
|
10
14
|
headless?: boolean;
|
|
11
15
|
};
|
|
12
16
|
export type ChromiumOptions = {
|
package/dist/options/headless.js
CHANGED
|
@@ -8,7 +8,7 @@ const cliFlag = 'disable-headless';
|
|
|
8
8
|
exports.headlessOption = {
|
|
9
9
|
name: 'Disable Headless Mode',
|
|
10
10
|
cliFlag,
|
|
11
|
-
description: () => ((0, jsx_runtime_1.
|
|
11
|
+
description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Deprecated - will be removed in 5.0.0. With the migration to", ' ', (0, jsx_runtime_1.jsx)("a", { href: "/docs/miscellaneous/chrome-headless-shell", children: "Chrome Headless Shell" }), ", this option is not functional anymore.", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), " If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode."] })),
|
|
12
12
|
ssrName: 'headless',
|
|
13
13
|
docLink: 'https://www.remotion.dev/docs/chromium-flags#--disable-headless',
|
|
14
14
|
type: false,
|
package/dist/render-frames.js
CHANGED
|
@@ -23,7 +23,7 @@ const get_duration_from_frame_range_1 = require("./get-duration-from-frame-range
|
|
|
23
23
|
const get_extra_frames_to_capture_1 = require("./get-extra-frames-to-capture");
|
|
24
24
|
const get_frame_padded_index_1 = require("./get-frame-padded-index");
|
|
25
25
|
const get_frame_to_render_1 = require("./get-frame-to-render");
|
|
26
|
-
const is_delay_render_error_with_retry_1 = require("./is-delay-render-error-with
|
|
26
|
+
const is_delay_render_error_with_retry_1 = require("./is-delay-render-error-with-retry");
|
|
27
27
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
28
28
|
const logger_1 = require("./logger");
|
|
29
29
|
const make_cancel_signal_1 = require("./make-cancel-signal");
|
package/dist/render-media.js
CHANGED
|
@@ -128,6 +128,11 @@ const internalRenderMediaRaw = ({ proResProfile, x264Preset, crf, composition, s
|
|
|
128
128
|
logLevel,
|
|
129
129
|
tag: 'renderMedia()',
|
|
130
130
|
}, 'Using concurrency:', resolvedConcurrency);
|
|
131
|
+
logger_1.Log.verbose({
|
|
132
|
+
indent,
|
|
133
|
+
logLevel,
|
|
134
|
+
tag: 'renderMedia()',
|
|
135
|
+
}, 'delayRender() timeout:', timeoutInMilliseconds);
|
|
131
136
|
logger_1.Log.verbose({
|
|
132
137
|
indent,
|
|
133
138
|
logLevel,
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,140 @@
|
|
|
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;
|
package/ensure-browser.mjs
CHANGED
|
@@ -3104,7 +3104,6 @@ var downloadBrowser = async ({
|
|
|
3104
3104
|
indent,
|
|
3105
3105
|
logLevel
|
|
3106
3106
|
});
|
|
3107
|
-
Log.info({ indent, logLevel });
|
|
3108
3107
|
await import_extract_zip.default(archivePath, { dir: outputPath });
|
|
3109
3108
|
const chromePath = path3.join(outputPath, "chrome-linux", "chrome");
|
|
3110
3109
|
const chromeHeadlessShellPath = path3.join(outputPath, "chrome-linux", "chrome-headless-shell");
|
|
@@ -3160,7 +3159,6 @@ var defaultBrowserDownloadProgress = ({
|
|
|
3160
3159
|
logLevel,
|
|
3161
3160
|
api
|
|
3162
3161
|
}) => () => {
|
|
3163
|
-
Log.info({ indent, logLevel }, "No local browser could be found.");
|
|
3164
3162
|
Log.info({ indent, logLevel }, "Downloading Chrome Headless Shell https://www.remotion.dev/docs/miscellaneous/chrome-headless-shell");
|
|
3165
3163
|
Log.info({ indent, logLevel }, `Customize this behavior by adding a onBrowserDownload function to ${api}.`);
|
|
3166
3164
|
return {
|
|
@@ -3177,698 +3175,8 @@ var defaultBrowserDownloadProgress = ({
|
|
|
3177
3175
|
|
|
3178
3176
|
// src/get-local-browser.ts
|
|
3179
3177
|
import fs4 from "fs";
|
|
3180
|
-
import {homedir} from "node:os";
|
|
3181
|
-
|
|
3182
|
-
// /Users/jonathanburger/remotion/packages/renderer/node_modules/remotion/dist/esm/no-react.mjs
|
|
3183
|
-
var interpolate = function(input, inputRange, outputRange, options) {
|
|
3184
|
-
if (typeof input === "undefined") {
|
|
3185
|
-
throw new Error("input can not be undefined");
|
|
3186
|
-
}
|
|
3187
|
-
if (typeof inputRange === "undefined") {
|
|
3188
|
-
throw new Error("inputRange can not be undefined");
|
|
3189
|
-
}
|
|
3190
|
-
if (typeof outputRange === "undefined") {
|
|
3191
|
-
throw new Error("outputRange can not be undefined");
|
|
3192
|
-
}
|
|
3193
|
-
if (inputRange.length !== outputRange.length) {
|
|
3194
|
-
throw new Error("inputRange (" + inputRange.length + ") and outputRange (" + outputRange.length + ") must have the same length");
|
|
3195
|
-
}
|
|
3196
|
-
checkInfiniteRange("inputRange", inputRange);
|
|
3197
|
-
checkInfiniteRange("outputRange", outputRange);
|
|
3198
|
-
checkValidInputRange(inputRange);
|
|
3199
|
-
const easing = options?.easing ?? ((num) => num);
|
|
3200
|
-
let extrapolateLeft = "extend";
|
|
3201
|
-
if (options?.extrapolateLeft !== undefined) {
|
|
3202
|
-
extrapolateLeft = options.extrapolateLeft;
|
|
3203
|
-
}
|
|
3204
|
-
let extrapolateRight = "extend";
|
|
3205
|
-
if (options?.extrapolateRight !== undefined) {
|
|
3206
|
-
extrapolateRight = options.extrapolateRight;
|
|
3207
|
-
}
|
|
3208
|
-
if (typeof input !== "number") {
|
|
3209
|
-
throw new TypeError("Cannot interpolate an input which is not a number");
|
|
3210
|
-
}
|
|
3211
|
-
const range = findRange(input, inputRange);
|
|
3212
|
-
return interpolateFunction(input, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
3213
|
-
easing,
|
|
3214
|
-
extrapolateLeft,
|
|
3215
|
-
extrapolateRight
|
|
3216
|
-
});
|
|
3217
|
-
};
|
|
3218
|
-
var truthy4 = function(value) {
|
|
3219
|
-
return Boolean(value);
|
|
3220
|
-
};
|
|
3221
|
-
var processColor = function(color) {
|
|
3222
|
-
const normalizedColor = normalizeColor(color);
|
|
3223
|
-
return (normalizedColor << 24 | normalizedColor >>> 8) >>> 0;
|
|
3224
|
-
};
|
|
3225
|
-
var validateDimension = function(amount, nameOfProp, location) {
|
|
3226
|
-
if (typeof amount !== "number") {
|
|
3227
|
-
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
3228
|
-
}
|
|
3229
|
-
if (isNaN(amount)) {
|
|
3230
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
3231
|
-
}
|
|
3232
|
-
if (!Number.isFinite(amount)) {
|
|
3233
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
3234
|
-
}
|
|
3235
|
-
if (amount % 1 !== 0) {
|
|
3236
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
3237
|
-
}
|
|
3238
|
-
if (amount <= 0) {
|
|
3239
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
3240
|
-
}
|
|
3241
|
-
};
|
|
3242
|
-
var validateDurationInFrames = function(durationInFrames, options) {
|
|
3243
|
-
const { allowFloats, component } = options;
|
|
3244
|
-
if (typeof durationInFrames === "undefined") {
|
|
3245
|
-
throw new Error(`The "durationInFrames" prop ${component} is missing.`);
|
|
3246
|
-
}
|
|
3247
|
-
if (typeof durationInFrames !== "number") {
|
|
3248
|
-
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
3249
|
-
}
|
|
3250
|
-
if (durationInFrames <= 0) {
|
|
3251
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
3252
|
-
}
|
|
3253
|
-
if (!allowFloats && durationInFrames % 1 !== 0) {
|
|
3254
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
3255
|
-
}
|
|
3256
|
-
if (!Number.isFinite(durationInFrames)) {
|
|
3257
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
3258
|
-
}
|
|
3259
|
-
};
|
|
3260
|
-
var validateFps = function(fps, location, isGif) {
|
|
3261
|
-
if (typeof fps !== "number") {
|
|
3262
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
3263
|
-
}
|
|
3264
|
-
if (!Number.isFinite(fps)) {
|
|
3265
|
-
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
3266
|
-
}
|
|
3267
|
-
if (isNaN(fps)) {
|
|
3268
|
-
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
3269
|
-
}
|
|
3270
|
-
if (fps <= 0) {
|
|
3271
|
-
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
3272
|
-
}
|
|
3273
|
-
if (isGif && fps > 50) {
|
|
3274
|
-
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
3275
|
-
}
|
|
3276
|
-
};
|
|
3277
|
-
var interpolateFunction = function(input, inputRange, outputRange, options) {
|
|
3278
|
-
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
3279
|
-
let result = input;
|
|
3280
|
-
const [inputMin, inputMax] = inputRange;
|
|
3281
|
-
const [outputMin, outputMax] = outputRange;
|
|
3282
|
-
if (result < inputMin) {
|
|
3283
|
-
if (extrapolateLeft === "identity") {
|
|
3284
|
-
return result;
|
|
3285
|
-
}
|
|
3286
|
-
if (extrapolateLeft === "clamp") {
|
|
3287
|
-
result = inputMin;
|
|
3288
|
-
} else if (extrapolateLeft === "wrap") {
|
|
3289
|
-
const range = inputMax - inputMin;
|
|
3290
|
-
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
3291
|
-
} else if (extrapolateLeft === "extend") {
|
|
3292
|
-
}
|
|
3293
|
-
}
|
|
3294
|
-
if (result > inputMax) {
|
|
3295
|
-
if (extrapolateRight === "identity") {
|
|
3296
|
-
return result;
|
|
3297
|
-
}
|
|
3298
|
-
if (extrapolateRight === "clamp") {
|
|
3299
|
-
result = inputMax;
|
|
3300
|
-
} else if (extrapolateRight === "wrap") {
|
|
3301
|
-
const range = inputMax - inputMin;
|
|
3302
|
-
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
3303
|
-
} else if (extrapolateRight === "extend") {
|
|
3304
|
-
}
|
|
3305
|
-
}
|
|
3306
|
-
if (outputMin === outputMax) {
|
|
3307
|
-
return outputMin;
|
|
3308
|
-
}
|
|
3309
|
-
result = (result - inputMin) / (inputMax - inputMin);
|
|
3310
|
-
result = easing(result);
|
|
3311
|
-
result = result * (outputMax - outputMin) + outputMin;
|
|
3312
|
-
return result;
|
|
3313
|
-
};
|
|
3314
|
-
var findRange = function(input, inputRange) {
|
|
3315
|
-
let i;
|
|
3316
|
-
for (i = 1;i < inputRange.length - 1; ++i) {
|
|
3317
|
-
if (inputRange[i] >= input) {
|
|
3318
|
-
break;
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
return i - 1;
|
|
3322
|
-
};
|
|
3323
|
-
var checkValidInputRange = function(arr) {
|
|
3324
|
-
for (let i = 1;i < arr.length; ++i) {
|
|
3325
|
-
if (!(arr[i] > arr[i - 1])) {
|
|
3326
|
-
throw new Error(`inputRange must be strictly monotonically increasing but got [${arr.join(",")}]`);
|
|
3327
|
-
}
|
|
3328
|
-
}
|
|
3329
|
-
};
|
|
3330
|
-
var checkInfiniteRange = function(name, arr) {
|
|
3331
|
-
if (arr.length < 2) {
|
|
3332
|
-
throw new Error(name + " must have at least 2 elements");
|
|
3333
|
-
}
|
|
3334
|
-
for (const element of arr) {
|
|
3335
|
-
if (typeof element !== "number") {
|
|
3336
|
-
throw new Error(`${name} must contain only numbers`);
|
|
3337
|
-
}
|
|
3338
|
-
if (!Number.isFinite(element)) {
|
|
3339
|
-
throw new Error(`${name} must contain only finite numbers, but got [${arr.join(",")}]`);
|
|
3340
|
-
}
|
|
3341
|
-
}
|
|
3342
|
-
};
|
|
3343
|
-
if (typeof window !== "undefined") {
|
|
3344
|
-
window.remotion_renderReady = false;
|
|
3345
|
-
}
|
|
3346
|
-
if (typeof window !== "undefined") {
|
|
3347
|
-
window.remotion_delayRenderTimeouts = {};
|
|
3348
|
-
}
|
|
3349
|
-
var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
|
|
3350
|
-
var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
|
|
3351
|
-
var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
|
|
3352
|
-
var problematicCharacters = {
|
|
3353
|
-
"%3A": ":",
|
|
3354
|
-
"%2F": "/",
|
|
3355
|
-
"%3F": "?",
|
|
3356
|
-
"%23": "#",
|
|
3357
|
-
"%5B": "[",
|
|
3358
|
-
"%5D": "]",
|
|
3359
|
-
"%40": "@",
|
|
3360
|
-
"%21": "!",
|
|
3361
|
-
"%24": "$",
|
|
3362
|
-
"%26": "&",
|
|
3363
|
-
"%27": "'",
|
|
3364
|
-
"%28": "(",
|
|
3365
|
-
"%29": ")",
|
|
3366
|
-
"%2A": "*",
|
|
3367
|
-
"%2B": "+",
|
|
3368
|
-
"%2C": ",",
|
|
3369
|
-
"%3B": ";"
|
|
3370
|
-
};
|
|
3371
|
-
var didWarn = {};
|
|
3372
|
-
var warnOnce = (message) => {
|
|
3373
|
-
if (didWarn[message]) {
|
|
3374
|
-
return;
|
|
3375
|
-
}
|
|
3376
|
-
console.warn(message);
|
|
3377
|
-
didWarn[message] = true;
|
|
3378
|
-
};
|
|
3379
|
-
var includesHexOfUnsafeChar = (path4) => {
|
|
3380
|
-
for (const key of Object.keys(problematicCharacters)) {
|
|
3381
|
-
if (path4.includes(key)) {
|
|
3382
|
-
return { containsHex: true, hexCode: key };
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
return { containsHex: false };
|
|
3386
|
-
};
|
|
3387
|
-
var trimLeadingSlash = (path4) => {
|
|
3388
|
-
if (path4.startsWith("/")) {
|
|
3389
|
-
return trimLeadingSlash(path4.substring(1));
|
|
3390
|
-
}
|
|
3391
|
-
return path4;
|
|
3392
|
-
};
|
|
3393
|
-
var inner = (path4) => {
|
|
3394
|
-
if (typeof window !== "undefined" && window.remotion_staticBase) {
|
|
3395
|
-
if (path4.startsWith(window.remotion_staticBase)) {
|
|
3396
|
-
throw new Error(`The value "${path4}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);
|
|
3397
|
-
}
|
|
3398
|
-
return `${window.remotion_staticBase}/${trimLeadingSlash(path4)}`;
|
|
3399
|
-
}
|
|
3400
|
-
return `/${trimLeadingSlash(path4)}`;
|
|
3401
|
-
};
|
|
3402
|
-
var encodeBySplitting = (path4) => {
|
|
3403
|
-
const splitBySlash = path4.split("/");
|
|
3404
|
-
const encodedArray = splitBySlash.map((element) => {
|
|
3405
|
-
return encodeURIComponent(element);
|
|
3406
|
-
});
|
|
3407
|
-
const merged = encodedArray.join("/");
|
|
3408
|
-
return merged;
|
|
3409
|
-
};
|
|
3410
|
-
var staticFile = (path4) => {
|
|
3411
|
-
if (path4.startsWith("http://") || path4.startsWith("https://")) {
|
|
3412
|
-
throw new TypeError(`staticFile() does not support remote URLs - got "${path4}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);
|
|
3413
|
-
}
|
|
3414
|
-
if (path4.startsWith("..") || path4.startsWith("./")) {
|
|
3415
|
-
throw new TypeError(`staticFile() does not support relative paths - got "${path4}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);
|
|
3416
|
-
}
|
|
3417
|
-
if (path4.startsWith("/Users") || path4.startsWith("/home") || path4.startsWith("/tmp") || path4.startsWith("/etc") || path4.startsWith("/opt") || path4.startsWith("/var") || path4.startsWith("C:") || path4.startsWith("D:") || path4.startsWith("E:")) {
|
|
3418
|
-
throw new TypeError(`staticFile() does not support absolute paths - got "${path4}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);
|
|
3419
|
-
}
|
|
3420
|
-
if (path4.startsWith("public/")) {
|
|
3421
|
-
throw new TypeError(`Do not include the public/ prefix when using staticFile() - got "${path4}". See: https://remotion.dev/docs/staticfile-relative-paths`);
|
|
3422
|
-
}
|
|
3423
|
-
const includesHex = includesHexOfUnsafeChar(path4);
|
|
3424
|
-
if (includesHex.containsHex) {
|
|
3425
|
-
warnOnce(`WARNING: You seem to pass an already encoded path (path contains ${includesHex.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);
|
|
3426
|
-
}
|
|
3427
|
-
const preprocessed = encodeBySplitting(path4);
|
|
3428
|
-
const preparsed = inner(preprocessed);
|
|
3429
|
-
if (!preparsed.startsWith("/")) {
|
|
3430
|
-
return `/${preparsed}`;
|
|
3431
|
-
}
|
|
3432
|
-
return preparsed;
|
|
3433
|
-
};
|
|
3434
|
-
var DATE_TOKEN = "remotion-date:";
|
|
3435
|
-
var FILE_TOKEN = "remotion-file:";
|
|
3436
|
-
var serializeJSONWithDate = ({
|
|
3437
|
-
data,
|
|
3438
|
-
indent,
|
|
3439
|
-
staticBase
|
|
3440
|
-
}) => {
|
|
3441
|
-
let customDateUsed = false;
|
|
3442
|
-
let customFileUsed = false;
|
|
3443
|
-
let mapUsed = false;
|
|
3444
|
-
let setUsed = false;
|
|
3445
|
-
try {
|
|
3446
|
-
const serializedString = JSON.stringify(data, function(key, value) {
|
|
3447
|
-
const item = this[key];
|
|
3448
|
-
if (item instanceof Date) {
|
|
3449
|
-
customDateUsed = true;
|
|
3450
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
3451
|
-
}
|
|
3452
|
-
if (item instanceof Map) {
|
|
3453
|
-
mapUsed = true;
|
|
3454
|
-
return value;
|
|
3455
|
-
}
|
|
3456
|
-
if (item instanceof Set) {
|
|
3457
|
-
setUsed = true;
|
|
3458
|
-
return value;
|
|
3459
|
-
}
|
|
3460
|
-
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
3461
|
-
customFileUsed = true;
|
|
3462
|
-
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
3463
|
-
}
|
|
3464
|
-
return value;
|
|
3465
|
-
}, indent);
|
|
3466
|
-
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
3467
|
-
} catch (err) {
|
|
3468
|
-
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
3469
|
-
}
|
|
3470
|
-
};
|
|
3471
|
-
var deserializeJSONWithCustomFields = (data) => {
|
|
3472
|
-
return JSON.parse(data, (_, value) => {
|
|
3473
|
-
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
3474
|
-
return new Date(value.replace(DATE_TOKEN, ""));
|
|
3475
|
-
}
|
|
3476
|
-
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
3477
|
-
return staticFile(value.replace(FILE_TOKEN, ""));
|
|
3478
|
-
}
|
|
3479
|
-
return value;
|
|
3480
|
-
});
|
|
3481
|
-
};
|
|
3482
|
-
var call = function(...args) {
|
|
3483
|
-
return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
|
|
3484
|
-
};
|
|
3485
|
-
var getMatchers = function() {
|
|
3486
|
-
const cachedMatchers = {
|
|
3487
|
-
rgb: undefined,
|
|
3488
|
-
rgba: undefined,
|
|
3489
|
-
hsl: undefined,
|
|
3490
|
-
hsla: undefined,
|
|
3491
|
-
hex3: undefined,
|
|
3492
|
-
hex4: undefined,
|
|
3493
|
-
hex5: undefined,
|
|
3494
|
-
hex6: undefined,
|
|
3495
|
-
hex8: undefined
|
|
3496
|
-
};
|
|
3497
|
-
if (cachedMatchers.rgb === undefined) {
|
|
3498
|
-
cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
|
|
3499
|
-
cachedMatchers.rgba = new RegExp("rgba" + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
|
3500
|
-
cachedMatchers.hsl = new RegExp("hsl" + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
|
3501
|
-
cachedMatchers.hsla = new RegExp("hsla" + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
|
3502
|
-
cachedMatchers.hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
3503
|
-
cachedMatchers.hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
|
3504
|
-
cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
|
|
3505
|
-
cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
|
|
3506
|
-
}
|
|
3507
|
-
return cachedMatchers;
|
|
3508
|
-
};
|
|
3509
|
-
var hue2rgb = function(p, q, t) {
|
|
3510
|
-
if (t < 0) {
|
|
3511
|
-
t += 1;
|
|
3512
|
-
}
|
|
3513
|
-
if (t > 1) {
|
|
3514
|
-
t -= 1;
|
|
3515
|
-
}
|
|
3516
|
-
if (t < 1 / 6) {
|
|
3517
|
-
return p + (q - p) * 6 * t;
|
|
3518
|
-
}
|
|
3519
|
-
if (t < 1 / 2) {
|
|
3520
|
-
return q;
|
|
3521
|
-
}
|
|
3522
|
-
if (t < 2 / 3) {
|
|
3523
|
-
return p + (q - p) * (2 / 3 - t) * 6;
|
|
3524
|
-
}
|
|
3525
|
-
return p;
|
|
3526
|
-
};
|
|
3527
|
-
var hslToRgb = function(h, s, l) {
|
|
3528
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
3529
|
-
const p = 2 * l - q;
|
|
3530
|
-
const r = hue2rgb(p, q, h + 1 / 3);
|
|
3531
|
-
const g = hue2rgb(p, q, h);
|
|
3532
|
-
const b = hue2rgb(p, q, h - 1 / 3);
|
|
3533
|
-
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
|
3534
|
-
};
|
|
3535
|
-
var parse255 = function(str) {
|
|
3536
|
-
const int = Number.parseInt(str, 10);
|
|
3537
|
-
if (int < 0) {
|
|
3538
|
-
return 0;
|
|
3539
|
-
}
|
|
3540
|
-
if (int > 255) {
|
|
3541
|
-
return 255;
|
|
3542
|
-
}
|
|
3543
|
-
return int;
|
|
3544
|
-
};
|
|
3545
|
-
var parse360 = function(str) {
|
|
3546
|
-
const int = Number.parseFloat(str);
|
|
3547
|
-
return (int % 360 + 360) % 360 / 360;
|
|
3548
|
-
};
|
|
3549
|
-
var parse1 = function(str) {
|
|
3550
|
-
const num = Number.parseFloat(str);
|
|
3551
|
-
if (num < 0) {
|
|
3552
|
-
return 0;
|
|
3553
|
-
}
|
|
3554
|
-
if (num > 1) {
|
|
3555
|
-
return 255;
|
|
3556
|
-
}
|
|
3557
|
-
return Math.round(num * 255);
|
|
3558
|
-
};
|
|
3559
|
-
var parsePercentage = function(str) {
|
|
3560
|
-
const int = Number.parseFloat(str);
|
|
3561
|
-
if (int < 0) {
|
|
3562
|
-
return 0;
|
|
3563
|
-
}
|
|
3564
|
-
if (int > 100) {
|
|
3565
|
-
return 1;
|
|
3566
|
-
}
|
|
3567
|
-
return int / 100;
|
|
3568
|
-
};
|
|
3569
|
-
var normalizeColor = function(color) {
|
|
3570
|
-
const matchers = getMatchers();
|
|
3571
|
-
let match;
|
|
3572
|
-
if (matchers.hex6) {
|
|
3573
|
-
if (match = matchers.hex6.exec(color)) {
|
|
3574
|
-
return Number.parseInt(match[1] + "ff", 16) >>> 0;
|
|
3575
|
-
}
|
|
3576
|
-
}
|
|
3577
|
-
if (colorNames[color] !== undefined) {
|
|
3578
|
-
return colorNames[color];
|
|
3579
|
-
}
|
|
3580
|
-
if (matchers.rgb) {
|
|
3581
|
-
if (match = matchers.rgb.exec(color)) {
|
|
3582
|
-
return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 255) >>> 0;
|
|
3583
|
-
}
|
|
3584
|
-
}
|
|
3585
|
-
if (matchers.rgba) {
|
|
3586
|
-
if (match = matchers.rgba.exec(color)) {
|
|
3587
|
-
return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0;
|
|
3588
|
-
}
|
|
3589
|
-
}
|
|
3590
|
-
if (matchers.hex3) {
|
|
3591
|
-
if (match = matchers.hex3.exec(color)) {
|
|
3592
|
-
return Number.parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + "ff", 16) >>> 0;
|
|
3593
|
-
}
|
|
3594
|
-
}
|
|
3595
|
-
if (matchers.hex8) {
|
|
3596
|
-
if (match = matchers.hex8.exec(color)) {
|
|
3597
|
-
return Number.parseInt(match[1], 16) >>> 0;
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
if (matchers.hex4) {
|
|
3601
|
-
if (match = matchers.hex4.exec(color)) {
|
|
3602
|
-
return Number.parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0;
|
|
3603
|
-
}
|
|
3604
|
-
}
|
|
3605
|
-
if (matchers.hsl) {
|
|
3606
|
-
if (match = matchers.hsl.exec(color)) {
|
|
3607
|
-
return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 255) >>> 0;
|
|
3608
|
-
}
|
|
3609
|
-
}
|
|
3610
|
-
if (matchers.hsla) {
|
|
3611
|
-
if (match = matchers.hsla.exec(color)) {
|
|
3612
|
-
return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0;
|
|
3613
|
-
}
|
|
3614
|
-
}
|
|
3615
|
-
throw new Error(`invalid color string ${color} provided`);
|
|
3616
|
-
};
|
|
3617
|
-
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
3618
|
-
var PERCENTAGE = NUMBER + "%";
|
|
3619
|
-
var colorNames = {
|
|
3620
|
-
transparent: 0,
|
|
3621
|
-
aliceblue: 4042850303,
|
|
3622
|
-
antiquewhite: 4209760255,
|
|
3623
|
-
aqua: 16777215,
|
|
3624
|
-
aquamarine: 2147472639,
|
|
3625
|
-
azure: 4043309055,
|
|
3626
|
-
beige: 4126530815,
|
|
3627
|
-
bisque: 4293182719,
|
|
3628
|
-
black: 255,
|
|
3629
|
-
blanchedalmond: 4293643775,
|
|
3630
|
-
blue: 65535,
|
|
3631
|
-
blueviolet: 2318131967,
|
|
3632
|
-
brown: 2771004159,
|
|
3633
|
-
burlywood: 3736635391,
|
|
3634
|
-
burntsienna: 3934150143,
|
|
3635
|
-
cadetblue: 1604231423,
|
|
3636
|
-
chartreuse: 2147418367,
|
|
3637
|
-
chocolate: 3530104575,
|
|
3638
|
-
coral: 4286533887,
|
|
3639
|
-
cornflowerblue: 1687547391,
|
|
3640
|
-
cornsilk: 4294499583,
|
|
3641
|
-
crimson: 3692313855,
|
|
3642
|
-
cyan: 16777215,
|
|
3643
|
-
darkblue: 35839,
|
|
3644
|
-
darkcyan: 9145343,
|
|
3645
|
-
darkgoldenrod: 3095792639,
|
|
3646
|
-
darkgray: 2846468607,
|
|
3647
|
-
darkgreen: 6553855,
|
|
3648
|
-
darkgrey: 2846468607,
|
|
3649
|
-
darkkhaki: 3182914559,
|
|
3650
|
-
darkmagenta: 2332068863,
|
|
3651
|
-
darkolivegreen: 1433087999,
|
|
3652
|
-
darkorange: 4287365375,
|
|
3653
|
-
darkorchid: 2570243327,
|
|
3654
|
-
darkred: 2332033279,
|
|
3655
|
-
darksalmon: 3918953215,
|
|
3656
|
-
darkseagreen: 2411499519,
|
|
3657
|
-
darkslateblue: 1211993087,
|
|
3658
|
-
darkslategray: 793726975,
|
|
3659
|
-
darkslategrey: 793726975,
|
|
3660
|
-
darkturquoise: 13554175,
|
|
3661
|
-
darkviolet: 2483082239,
|
|
3662
|
-
deeppink: 4279538687,
|
|
3663
|
-
deepskyblue: 12582911,
|
|
3664
|
-
dimgray: 1768516095,
|
|
3665
|
-
dimgrey: 1768516095,
|
|
3666
|
-
dodgerblue: 512819199,
|
|
3667
|
-
firebrick: 2988581631,
|
|
3668
|
-
floralwhite: 4294635775,
|
|
3669
|
-
forestgreen: 579543807,
|
|
3670
|
-
fuchsia: 4278255615,
|
|
3671
|
-
gainsboro: 3705462015,
|
|
3672
|
-
ghostwhite: 4177068031,
|
|
3673
|
-
gold: 4292280575,
|
|
3674
|
-
goldenrod: 3668254975,
|
|
3675
|
-
gray: 2155905279,
|
|
3676
|
-
green: 8388863,
|
|
3677
|
-
greenyellow: 2919182335,
|
|
3678
|
-
grey: 2155905279,
|
|
3679
|
-
honeydew: 4043305215,
|
|
3680
|
-
hotpink: 4285117695,
|
|
3681
|
-
indianred: 3445382399,
|
|
3682
|
-
indigo: 1258324735,
|
|
3683
|
-
ivory: 4294963455,
|
|
3684
|
-
khaki: 4041641215,
|
|
3685
|
-
lavender: 3873897215,
|
|
3686
|
-
lavenderblush: 4293981695,
|
|
3687
|
-
lawngreen: 2096890111,
|
|
3688
|
-
lemonchiffon: 4294626815,
|
|
3689
|
-
lightblue: 2916673279,
|
|
3690
|
-
lightcoral: 4034953471,
|
|
3691
|
-
lightcyan: 3774873599,
|
|
3692
|
-
lightgoldenrodyellow: 4210742015,
|
|
3693
|
-
lightgray: 3553874943,
|
|
3694
|
-
lightgreen: 2431553791,
|
|
3695
|
-
lightgrey: 3553874943,
|
|
3696
|
-
lightpink: 4290167295,
|
|
3697
|
-
lightsalmon: 4288707327,
|
|
3698
|
-
lightseagreen: 548580095,
|
|
3699
|
-
lightskyblue: 2278488831,
|
|
3700
|
-
lightslategray: 2005441023,
|
|
3701
|
-
lightslategrey: 2005441023,
|
|
3702
|
-
lightsteelblue: 2965692159,
|
|
3703
|
-
lightyellow: 4294959359,
|
|
3704
|
-
lime: 16711935,
|
|
3705
|
-
limegreen: 852308735,
|
|
3706
|
-
linen: 4210091775,
|
|
3707
|
-
magenta: 4278255615,
|
|
3708
|
-
maroon: 2147483903,
|
|
3709
|
-
mediumaquamarine: 1724754687,
|
|
3710
|
-
mediumblue: 52735,
|
|
3711
|
-
mediumorchid: 3126187007,
|
|
3712
|
-
mediumpurple: 2473647103,
|
|
3713
|
-
mediumseagreen: 1018393087,
|
|
3714
|
-
mediumslateblue: 2070474495,
|
|
3715
|
-
mediumspringgreen: 16423679,
|
|
3716
|
-
mediumturquoise: 1221709055,
|
|
3717
|
-
mediumvioletred: 3340076543,
|
|
3718
|
-
midnightblue: 421097727,
|
|
3719
|
-
mintcream: 4127193855,
|
|
3720
|
-
mistyrose: 4293190143,
|
|
3721
|
-
moccasin: 4293178879,
|
|
3722
|
-
navajowhite: 4292783615,
|
|
3723
|
-
navy: 33023,
|
|
3724
|
-
oldlace: 4260751103,
|
|
3725
|
-
olive: 2155872511,
|
|
3726
|
-
olivedrab: 1804477439,
|
|
3727
|
-
orange: 4289003775,
|
|
3728
|
-
orangered: 4282712319,
|
|
3729
|
-
orchid: 3664828159,
|
|
3730
|
-
palegoldenrod: 4008225535,
|
|
3731
|
-
palegreen: 2566625535,
|
|
3732
|
-
paleturquoise: 2951671551,
|
|
3733
|
-
palevioletred: 3681588223,
|
|
3734
|
-
papayawhip: 4293907967,
|
|
3735
|
-
peachpuff: 4292524543,
|
|
3736
|
-
peru: 3448061951,
|
|
3737
|
-
pink: 4290825215,
|
|
3738
|
-
plum: 3718307327,
|
|
3739
|
-
powderblue: 2967529215,
|
|
3740
|
-
purple: 2147516671,
|
|
3741
|
-
rebeccapurple: 1714657791,
|
|
3742
|
-
red: 4278190335,
|
|
3743
|
-
rosybrown: 3163525119,
|
|
3744
|
-
royalblue: 1097458175,
|
|
3745
|
-
saddlebrown: 2336560127,
|
|
3746
|
-
salmon: 4202722047,
|
|
3747
|
-
sandybrown: 4104413439,
|
|
3748
|
-
seagreen: 780883967,
|
|
3749
|
-
seashell: 4294307583,
|
|
3750
|
-
sienna: 2689740287,
|
|
3751
|
-
silver: 3233857791,
|
|
3752
|
-
skyblue: 2278484991,
|
|
3753
|
-
slateblue: 1784335871,
|
|
3754
|
-
slategray: 1887473919,
|
|
3755
|
-
slategrey: 1887473919,
|
|
3756
|
-
snow: 4294638335,
|
|
3757
|
-
springgreen: 16744447,
|
|
3758
|
-
steelblue: 1182971135,
|
|
3759
|
-
tan: 3535047935,
|
|
3760
|
-
teal: 8421631,
|
|
3761
|
-
thistle: 3636451583,
|
|
3762
|
-
tomato: 4284696575,
|
|
3763
|
-
turquoise: 1088475391,
|
|
3764
|
-
violet: 4001558271,
|
|
3765
|
-
wheat: 4125012991,
|
|
3766
|
-
white: 4294967295,
|
|
3767
|
-
whitesmoke: 4126537215,
|
|
3768
|
-
yellow: 4294902015,
|
|
3769
|
-
yellowgreen: 2597139199
|
|
3770
|
-
};
|
|
3771
|
-
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
3772
|
-
var validateFrame = ({
|
|
3773
|
-
allowFloats,
|
|
3774
|
-
durationInFrames,
|
|
3775
|
-
frame
|
|
3776
|
-
}) => {
|
|
3777
|
-
if (typeof frame === "undefined") {
|
|
3778
|
-
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
3779
|
-
}
|
|
3780
|
-
if (typeof frame !== "number") {
|
|
3781
|
-
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
3782
|
-
}
|
|
3783
|
-
if (!Number.isFinite(frame)) {
|
|
3784
|
-
throw new RangeError(`Frame ${frame} is not finite`);
|
|
3785
|
-
}
|
|
3786
|
-
if (frame % 1 !== 0 && !allowFloats) {
|
|
3787
|
-
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
3788
|
-
}
|
|
3789
|
-
if (frame < 0 && frame < -durationInFrames) {
|
|
3790
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
|
|
3791
|
-
}
|
|
3792
|
-
if (frame > durationInFrames - 1) {
|
|
3793
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
3794
|
-
}
|
|
3795
|
-
};
|
|
3796
|
-
var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
3797
|
-
if (!defaultProps) {
|
|
3798
|
-
return;
|
|
3799
|
-
}
|
|
3800
|
-
if (typeof defaultProps !== "object") {
|
|
3801
|
-
throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
|
|
3802
|
-
}
|
|
3803
|
-
if (Array.isArray(defaultProps)) {
|
|
3804
|
-
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
3805
|
-
}
|
|
3806
|
-
};
|
|
3807
|
-
var getExpectedMediaFrameUncorrected = ({
|
|
3808
|
-
frame,
|
|
3809
|
-
playbackRate,
|
|
3810
|
-
startFrom
|
|
3811
|
-
}) => {
|
|
3812
|
-
return interpolate(frame, [-1, startFrom, startFrom + 1], [-1, startFrom, startFrom + playbackRate]);
|
|
3813
|
-
};
|
|
3814
|
-
var getAbsoluteSrc = (relativeSrc) => {
|
|
3815
|
-
if (typeof window === "undefined") {
|
|
3816
|
-
return relativeSrc;
|
|
3817
|
-
}
|
|
3818
|
-
return new URL(relativeSrc, window.origin).href;
|
|
3819
|
-
};
|
|
3820
|
-
var getOffthreadVideoSource = ({
|
|
3821
|
-
src,
|
|
3822
|
-
transparent,
|
|
3823
|
-
currentTime,
|
|
3824
|
-
toneMapped
|
|
3825
|
-
}) => {
|
|
3826
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
|
|
3827
|
-
};
|
|
3828
|
-
var NoReactInternals = {
|
|
3829
|
-
processColor,
|
|
3830
|
-
truthy: truthy4,
|
|
3831
|
-
validateFps,
|
|
3832
|
-
validateDimension,
|
|
3833
|
-
validateDurationInFrames,
|
|
3834
|
-
validateDefaultAndInputProps,
|
|
3835
|
-
validateFrame,
|
|
3836
|
-
serializeJSONWithDate,
|
|
3837
|
-
bundleName: "bundle.js",
|
|
3838
|
-
bundleMapName: "bundle.js.map",
|
|
3839
|
-
deserializeJSONWithCustomFields,
|
|
3840
|
-
DELAY_RENDER_CALLSTACK_TOKEN,
|
|
3841
|
-
DELAY_RENDER_RETRY_TOKEN,
|
|
3842
|
-
DELAY_RENDER_ATTEMPT_TOKEN: DELAY_RENDER_RETRIES_LEFT,
|
|
3843
|
-
getOffthreadVideoSource,
|
|
3844
|
-
getExpectedMediaFrameUncorrected,
|
|
3845
|
-
ENABLE_V5_BREAKING_CHANGES,
|
|
3846
|
-
MIN_NODE_VERSION: ENABLE_V5_BREAKING_CHANGES ? 18 : 16,
|
|
3847
|
-
MIN_BUN_VERSION: ENABLE_V5_BREAKING_CHANGES ? "1.1.3" : "1.0.3",
|
|
3848
|
-
colorNames,
|
|
3849
|
-
DATE_TOKEN,
|
|
3850
|
-
FILE_TOKEN
|
|
3851
|
-
};
|
|
3852
|
-
|
|
3853
|
-
// src/get-local-browser.ts
|
|
3854
3178
|
var getSearchPathsForProduct = () => {
|
|
3855
|
-
|
|
3856
|
-
return [];
|
|
3857
|
-
}
|
|
3858
|
-
return [
|
|
3859
|
-
process.env.PUPPETEER_EXECUTABLE_PATH ?? null,
|
|
3860
|
-
process.platform === "darwin" ? "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" : null,
|
|
3861
|
-
process.platform === "linux" ? "/usr/bin/google-chrome" : null,
|
|
3862
|
-
process.platform === "linux" ? "/usr/bin/chromium-browser" : null,
|
|
3863
|
-
process.platform === "linux" ? "/usr/bin/chromium" : null,
|
|
3864
|
-
process.platform === "linux" ? "/app/.apt/usr/bin/google-chrome-stable" : null,
|
|
3865
|
-
process.platform === "win32" ? "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" : null,
|
|
3866
|
-
process.platform === "win32" ? "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" : null,
|
|
3867
|
-
process.platform === "win32" ? homedir() + "\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe" : null,
|
|
3868
|
-
process.platform === "win32" ? "C:\\Program Files\\Google\\Chrome SxS\\Application\\chrome.exe" : null,
|
|
3869
|
-
process.platform === "win32" ? "C:\\Program Files (x86)\\Google\\Chrome SxS\\Application\\chrome.exe" : null,
|
|
3870
|
-
process.platform === "win32" ? homedir() + "\\AppData\\Local\\Google\\Chrome SxS\\Application\\chrome.exe" : null
|
|
3871
|
-
].filter(Boolean);
|
|
3179
|
+
return [];
|
|
3872
3180
|
};
|
|
3873
3181
|
var getLocalBrowser = () => {
|
|
3874
3182
|
for (const p of getSearchPathsForProduct()) {
|
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.209",
|
|
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
|
-
"
|
|
21
|
+
"@remotion/streaming": "4.0.209",
|
|
22
|
+
"remotion": "4.0.209"
|
|
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-arm64": "4.0.
|
|
38
|
-
"@remotion/compositor-
|
|
39
|
-
"@remotion/compositor-
|
|
40
|
-
"@remotion/compositor-linux-
|
|
41
|
-
"@remotion/compositor-linux-x64-
|
|
42
|
-
"@remotion/compositor-win32-x64-msvc": "4.0.
|
|
43
|
-
"@remotion/compositor-linux-
|
|
37
|
+
"@remotion/compositor-darwin-arm64": "4.0.209",
|
|
38
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.209",
|
|
39
|
+
"@remotion/compositor-darwin-x64": "4.0.209",
|
|
40
|
+
"@remotion/compositor-linux-x64-musl": "4.0.209",
|
|
41
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.209",
|
|
42
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.209",
|
|
43
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.209"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"remotion",
|