@remotion/renderer 4.0.208 → 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.
@@ -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');
package/dist/client.d.ts CHANGED
@@ -467,19 +467,19 @@ export declare const BrowserSafeApis: {
467
467
  cliFlag: "gl";
468
468
  docLink: string;
469
469
  name: string;
470
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
470
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
471
471
  ssrName: string;
472
472
  description: () => import("react/jsx-runtime").JSX.Element;
473
473
  getValue: ({ commandLine }: {
474
474
  commandLine: Record<string, unknown>;
475
475
  }) => {
476
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
476
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
477
477
  source: string;
478
478
  } | {
479
479
  value: null;
480
480
  source: string;
481
481
  };
482
- setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
482
+ setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
483
483
  };
484
484
  enableLambdaInsights: {
485
485
  name: string;
package/dist/index.d.ts CHANGED
@@ -141,8 +141,8 @@ export declare const RenderInternals: {
141
141
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
142
142
  DEFAULT_BROWSER: "chrome";
143
143
  validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
144
- DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
145
- validateOpenGlRenderer: (option: unknown) => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
144
+ DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
145
+ validateOpenGlRenderer: (option: unknown) => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
146
146
  validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "h264-ts", "gif"];
147
147
  DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
148
148
  validateJpegQuality: (q: unknown) => void;
@@ -338,7 +338,7 @@ export declare const RenderInternals: {
338
338
  makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif")[]>;
339
339
  defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "h264-ts" | "gif">;
340
340
  getExecutablePath: ({ indent, logLevel, type, binariesDirectory, }: {
341
- type: "compositor" | "ffmpeg" | "ffprobe";
341
+ type: "ffmpeg" | "ffprobe" | "compositor";
342
342
  indent: boolean;
343
343
  logLevel: "verbose" | "info" | "warn" | "error";
344
344
  binariesDirectory: string | null;
@@ -354,8 +354,8 @@ export declare const RenderInternals: {
354
354
  }) => execa.ExecaChildProcess<string>;
355
355
  validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
356
356
  validVideoImageFormats: readonly ["png", "jpeg", "none"];
357
- DEFAULT_STILL_IMAGE_FORMAT: "png" | "jpeg" | "pdf" | "webp";
358
- DEFAULT_VIDEO_IMAGE_FORMAT: "png" | "jpeg" | "none";
357
+ DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
358
+ DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
359
359
  DEFAULT_JPEG_QUALITY: number;
360
360
  chalk: {
361
361
  enabled: () => boolean;
@@ -453,7 +453,7 @@ export declare const RenderInternals: {
453
453
  frame: number;
454
454
  serializedInputPropsWithCustomSchema: string;
455
455
  serializedResolvedPropsWithCustomSchema: string;
456
- imageFormat: "png" | "jpeg" | "pdf" | "webp";
456
+ imageFormat: "jpeg" | "png" | "webp" | "pdf";
457
457
  jpegQuality: number;
458
458
  puppeteerInstance: HeadlessBrowser | null;
459
459
  envVariables: Record<string, string>;
@@ -754,7 +754,7 @@ export declare const RenderInternals: {
754
754
  onFrameUpdate: ((framesRendered: number, frameIndex: number, timeToRenderInMilliseconds: number) => void) | null;
755
755
  outputDir: string | null;
756
756
  envVariables: Record<string, string>;
757
- imageFormat: "png" | "jpeg" | "none";
757
+ imageFormat: "jpeg" | "png" | "none";
758
758
  jpegQuality: number;
759
759
  frameRange: import("./frame-range").FrameRange | null;
760
760
  everyNthFrame: number;
@@ -767,7 +767,7 @@ export declare const RenderInternals: {
767
767
  scale: number;
768
768
  port: number | null;
769
769
  cancelSignal: import("./make-cancel-signal").CancelSignal | undefined;
770
- composition: Omit<import("remotion").VideoConfig, "props" | "defaultProps">;
770
+ composition: Omit<import("remotion").VideoConfig, "defaultProps" | "props">;
771
771
  indent: boolean;
772
772
  server: import("./prepare-server").RemotionServer | undefined;
773
773
  muted: boolean;
@@ -1,19 +1,19 @@
1
1
  export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
2
2
  export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
3
3
  export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
4
- export declare const getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
4
+ export declare const getChromiumOpenGlRenderer: () => "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
5
5
  export declare const setChromiumOpenGlRenderer: (renderer: OpenGlRenderer) => void;
6
6
  export declare const glOption: {
7
7
  cliFlag: "gl";
8
8
  docLink: string;
9
9
  name: string;
10
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
10
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
11
11
  ssrName: string;
12
12
  description: () => import("react/jsx-runtime").JSX.Element;
13
13
  getValue: ({ commandLine }: {
14
14
  commandLine: Record<string, unknown>;
15
15
  }) => {
16
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
16
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
17
17
  source: string;
18
18
  } | {
19
19
  value: null;
@@ -245,19 +245,19 @@ export declare const allOptions: {
245
245
  cliFlag: "gl";
246
246
  docLink: string;
247
247
  name: string;
248
- type: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
248
+ type: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null;
249
249
  ssrName: string;
250
250
  description: () => import("react/jsx-runtime").JSX.Element;
251
251
  getValue: ({ commandLine }: {
252
252
  commandLine: Record<string, unknown>;
253
253
  }) => {
254
- value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
254
+ value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl";
255
255
  source: string;
256
256
  } | {
257
257
  value: null;
258
258
  source: string;
259
259
  };
260
- setConfig: (value: "swangle" | "angle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
260
+ setConfig: (value: "angle" | "swangle" | "egl" | "swiftshader" | "vulkan" | "angle-egl" | null) => void;
261
261
  };
262
262
  enableLambdaInsights: {
263
263
  name: string;
@@ -2,5 +2,5 @@ import type { Codec } from './codec';
2
2
  export declare const validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
3
3
  export type PixelFormat = (typeof validPixelFormats)[number];
4
4
  export declare const DEFAULT_PIXEL_FORMAT: PixelFormat;
5
- export declare const validPixelFormatsForCodec: (codec: Codec) => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuv422p" | "yuv444p" | "yuva420p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
5
+ export declare const validPixelFormatsForCodec: (codec: Codec) => readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"] | ("yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le")[];
6
6
  export declare const validateSelectedPixelFormatAndCodecCombination: (pixelFormat: PixelFormat | undefined, codec: Codec) => undefined;
@@ -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
- if (NoReactInternals.ENABLE_V5_BREAKING_CHANGES) {
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.208",
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.208",
22
- "@remotion/streaming": "4.0.208"
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-x64": "4.0.208",
38
- "@remotion/compositor-darwin-arm64": "4.0.208",
39
- "@remotion/compositor-linux-arm64-gnu": "4.0.208",
40
- "@remotion/compositor-linux-arm64-musl": "4.0.208",
41
- "@remotion/compositor-linux-x64-gnu": "4.0.208",
42
- "@remotion/compositor-win32-x64-msvc": "4.0.208",
43
- "@remotion/compositor-linux-x64-musl": "4.0.208"
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",