@remotion/vercel 4.0.539 → 4.0.540

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.
@@ -115,6 +115,12 @@ import { statSync } from "fs";
115
115
  import { RenderInternals } from "@remotion/renderer";
116
116
 
117
117
  // ../core/dist/esm/no-react.mjs
118
+ var validatePreferredEffectBackend = (value) => {
119
+ if (value !== "auto" && value !== "webgpu" && value !== "webgl2" && value !== "2d") {
120
+ throw new TypeError(\`preferredEffectBackend must be "auto", "webgpu", "webgl2" or "2d", got \${String(value)}\`);
121
+ }
122
+ return value;
123
+ };
118
124
  var evaluateSourceNumericValue = (expression, config) => {
119
125
  if (typeof expression === "number") {
120
126
  return expression;
@@ -2502,6 +2508,39 @@ var serializeScaleValue = ([x, y, z]) => {
2502
2508
  function truthy(value) {
2503
2509
  return Boolean(value);
2504
2510
  }
2511
+ var validateSelectedFrames = ({
2512
+ frames,
2513
+ durationInFrames
2514
+ }) => {
2515
+ if (!Array.isArray(frames)) {
2516
+ throw new TypeError("The \`frames\` option must be an array of frame numbers.");
2517
+ }
2518
+ if (frames.length === 0) {
2519
+ throw new TypeError("The \`frames\` option must contain at least one frame.");
2520
+ }
2521
+ for (const frame of frames) {
2522
+ if (typeof frame !== "number") {
2523
+ throw new TypeError(\`The \\\`frames\\\` option must contain only numbers, but got \${typeof frame}.\`);
2524
+ }
2525
+ if (!Number.isFinite(frame)) {
2526
+ throw new TypeError(\`The \\\`frames\\\` option must contain only finite numbers, but got \${frame}.\`);
2527
+ }
2528
+ if (!Number.isInteger(frame)) {
2529
+ throw new TypeError(\`The \\\`frames\\\` option must contain only integers, but got \${frame}.\`);
2530
+ }
2531
+ if (frame < 0) {
2532
+ throw new TypeError(\`The \\\`frames\\\` option must contain only non-negative numbers, but got \${frame}.\`);
2533
+ }
2534
+ if (durationInFrames !== null && frame >= durationInFrames) {
2535
+ throw new RangeError(\`Frame \${frame} is out of range, must be between 0 and \${durationInFrames - 1}.\`);
2536
+ }
2537
+ }
2538
+ const uniqueFrames = new Set(frames);
2539
+ if (uniqueFrames.size !== frames.length) {
2540
+ throw new TypeError("The \`frames\` option must not contain duplicate frames.");
2541
+ }
2542
+ return [...frames].sort((a, b) => a - b);
2543
+ };
2505
2544
  var validCodecs = [
2506
2545
  "h264",
2507
2546
  "h265",
@@ -2598,6 +2637,7 @@ var getOffthreadVideoSource = ({
2598
2637
  return \`http://localhost:\${window.remotion_proxyPort}/proxy?src=\${encodeURIComponent(getAbsoluteSrc(src))}&time=\${encodeURIComponent(Math.max(0, currentTime))}&transparent=\${String(transparent)}&toneMapped=\${String(toneMapped)}\`;
2599
2638
  };
2600
2639
  var NoReactInternals = {
2640
+ validatePreferredEffectBackend,
2601
2641
  DEFAULT_PREMOUNT_IN_SECONDS,
2602
2642
  DEFAULT_STUDIO_PREMOUNT_IN_SECONDS,
2603
2643
  DEFAULT_SEQUENCE_ACTIVITY_LIMIT,
@@ -2611,6 +2651,7 @@ var NoReactInternals = {
2611
2651
  validateDurationInFrames,
2612
2652
  validateDefaultAndInputProps,
2613
2653
  validateFrame,
2654
+ validateSelectedFrames,
2614
2655
  serializeJSONWithSpecialTypes,
2615
2656
  bundleName: "bundle.js",
2616
2657
  bundleMapName: "bundle.js.map",
@@ -2688,6 +2729,7 @@ try {
2688
2729
  }),
2689
2730
  chromeMode: config.chromeMode,
2690
2731
  mediaCacheSizeInBytes: config.mediaCacheSizeInBytes,
2732
+ preferredEffectBackend: config.preferredEffectBackend,
2691
2733
  offthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,
2692
2734
  offthreadVideoThreads: config.offthreadVideoThreads
2693
2735
  });
@@ -2716,8 +2758,10 @@ try {
2716
2758
  chromeMode: config.chromeMode,
2717
2759
  offthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,
2718
2760
  mediaCacheSizeInBytes: config.mediaCacheSizeInBytes,
2761
+ preferredEffectBackend: config.preferredEffectBackend,
2719
2762
  offthreadVideoThreads: config.offthreadVideoThreads,
2720
2763
  licenseKey: config.licenseKey,
2764
+ isProduction: config.isProduction,
2721
2765
  puppeteerInstance: browser,
2722
2766
  onBrowserLog: null,
2723
2767
  onDownload: null,
@@ -2727,7 +2771,6 @@ try {
2727
2771
  port: null,
2728
2772
  onArtifact: null,
2729
2773
  onLog: RenderInternals.defaultOnLog,
2730
- isProduction: true,
2731
2774
  onBrowserDownload: () => ({
2732
2775
  version: null,
2733
2776
  onProgress: noop
@@ -2751,6 +2794,12 @@ import { RenderInternals } from "@remotion/renderer";
2751
2794
  import { put } from "@vercel/blob";
2752
2795
 
2753
2796
  // ../core/dist/esm/no-react.mjs
2797
+ var validatePreferredEffectBackend = (value) => {
2798
+ if (value !== "auto" && value !== "webgpu" && value !== "webgl2" && value !== "2d") {
2799
+ throw new TypeError(\`preferredEffectBackend must be "auto", "webgpu", "webgl2" or "2d", got \${String(value)}\`);
2800
+ }
2801
+ return value;
2802
+ };
2754
2803
  var evaluateSourceNumericValue = (expression, config) => {
2755
2804
  if (typeof expression === "number") {
2756
2805
  return expression;
@@ -5138,6 +5187,39 @@ var serializeScaleValue = ([x, y, z]) => {
5138
5187
  function truthy(value) {
5139
5188
  return Boolean(value);
5140
5189
  }
5190
+ var validateSelectedFrames = ({
5191
+ frames,
5192
+ durationInFrames
5193
+ }) => {
5194
+ if (!Array.isArray(frames)) {
5195
+ throw new TypeError("The \`frames\` option must be an array of frame numbers.");
5196
+ }
5197
+ if (frames.length === 0) {
5198
+ throw new TypeError("The \`frames\` option must contain at least one frame.");
5199
+ }
5200
+ for (const frame of frames) {
5201
+ if (typeof frame !== "number") {
5202
+ throw new TypeError(\`The \\\`frames\\\` option must contain only numbers, but got \${typeof frame}.\`);
5203
+ }
5204
+ if (!Number.isFinite(frame)) {
5205
+ throw new TypeError(\`The \\\`frames\\\` option must contain only finite numbers, but got \${frame}.\`);
5206
+ }
5207
+ if (!Number.isInteger(frame)) {
5208
+ throw new TypeError(\`The \\\`frames\\\` option must contain only integers, but got \${frame}.\`);
5209
+ }
5210
+ if (frame < 0) {
5211
+ throw new TypeError(\`The \\\`frames\\\` option must contain only non-negative numbers, but got \${frame}.\`);
5212
+ }
5213
+ if (durationInFrames !== null && frame >= durationInFrames) {
5214
+ throw new RangeError(\`Frame \${frame} is out of range, must be between 0 and \${durationInFrames - 1}.\`);
5215
+ }
5216
+ }
5217
+ const uniqueFrames = new Set(frames);
5218
+ if (uniqueFrames.size !== frames.length) {
5219
+ throw new TypeError("The \`frames\` option must not contain duplicate frames.");
5220
+ }
5221
+ return [...frames].sort((a, b) => a - b);
5222
+ };
5141
5223
  var validCodecs = [
5142
5224
  "h264",
5143
5225
  "h265",
@@ -5234,6 +5316,7 @@ var getOffthreadVideoSource = ({
5234
5316
  return \`http://localhost:\${window.remotion_proxyPort}/proxy?src=\${encodeURIComponent(getAbsoluteSrc(src))}&time=\${encodeURIComponent(Math.max(0, currentTime))}&transparent=\${String(transparent)}&toneMapped=\${String(toneMapped)}\`;
5235
5317
  };
5236
5318
  var NoReactInternals = {
5319
+ validatePreferredEffectBackend,
5237
5320
  DEFAULT_PREMOUNT_IN_SECONDS,
5238
5321
  DEFAULT_STUDIO_PREMOUNT_IN_SECONDS,
5239
5322
  DEFAULT_SEQUENCE_ACTIVITY_LIMIT,
@@ -5247,6 +5330,7 @@ var NoReactInternals = {
5247
5330
  validateDurationInFrames,
5248
5331
  validateDefaultAndInputProps,
5249
5332
  validateFrame,
5333
+ validateSelectedFrames,
5250
5334
  serializeJSONWithSpecialTypes,
5251
5335
  bundleName: "bundle.js",
5252
5336
  bundleMapName: "bundle.js.map",
@@ -5365,6 +5449,7 @@ try {
5365
5449
  }),
5366
5450
  chromeMode: config.chromeMode,
5367
5451
  mediaCacheSizeInBytes: config.mediaCacheSizeInBytes,
5452
+ preferredEffectBackend: config.preferredEffectBackend,
5368
5453
  offthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,
5369
5454
  offthreadVideoThreads: config.offthreadVideoThreads
5370
5455
  });
@@ -5399,6 +5484,7 @@ try {
5399
5484
  binariesDirectory: config.binariesDirectory,
5400
5485
  metadata: config.metadata,
5401
5486
  licenseKey: config.licenseKey,
5487
+ isProduction: config.isProduction,
5402
5488
  videoBitrate: config.videoBitrate,
5403
5489
  audioBitrate: config.audioBitrate,
5404
5490
  encodingMaxRate: config.encodingMaxRate,
@@ -5418,6 +5504,7 @@ try {
5418
5504
  chromeMode: config.chromeMode,
5419
5505
  offthreadVideoCacheSizeInBytes: config.offthreadVideoCacheSizeInBytes,
5420
5506
  mediaCacheSizeInBytes: config.mediaCacheSizeInBytes,
5507
+ preferredEffectBackend: config.preferredEffectBackend,
5421
5508
  offthreadVideoThreads: config.offthreadVideoThreads,
5422
5509
  repro: config.repro,
5423
5510
  sampleRate: config.sampleRate,
@@ -5453,7 +5540,6 @@ try {
5453
5540
  compositionStart: 0,
5454
5541
  onArtifact: null,
5455
5542
  onLog: RenderInternals.defaultOnLog,
5456
- isProduction: true,
5457
5543
  onBrowserDownload: () => ({
5458
5544
  version: null,
5459
5545
  onProgress: noop
@@ -5892,6 +5978,7 @@ var internalRenderMediaOnVercel = async (options) => {
5892
5978
  concurrency,
5893
5979
  metadata,
5894
5980
  licenseKey,
5981
+ isProduction,
5895
5982
  videoBitrate,
5896
5983
  audioBitrate,
5897
5984
  encodingMaxRate,
@@ -5910,6 +5997,7 @@ var internalRenderMediaOnVercel = async (options) => {
5910
5997
  hardwareAcceleration = "disable",
5911
5998
  offthreadVideoCacheSizeInBytes,
5912
5999
  mediaCacheSizeInBytes,
6000
+ preferredEffectBackend,
5913
6001
  offthreadVideoThreads,
5914
6002
  sampleRate,
5915
6003
  detached = false,
@@ -5942,6 +6030,7 @@ var internalRenderMediaOnVercel = async (options) => {
5942
6030
  concurrency: concurrency ?? null,
5943
6031
  metadata: metadata ?? null,
5944
6032
  licenseKey: licenseKey ?? null,
6033
+ isProduction: isProduction ?? null,
5945
6034
  videoBitrate: videoBitrate ?? null,
5946
6035
  audioBitrate: audioBitrate ?? null,
5947
6036
  encodingMaxRate: encodingMaxRate ?? null,
@@ -5960,6 +6049,7 @@ var internalRenderMediaOnVercel = async (options) => {
5960
6049
  hardwareAcceleration,
5961
6050
  offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
5962
6051
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
6052
+ preferredEffectBackend: preferredEffectBackend ?? "auto",
5963
6053
  offthreadVideoThreads: offthreadVideoThreads ?? null,
5964
6054
  chromeMode: "headless-shell",
5965
6055
  browserExecutable: null,
@@ -6024,8 +6114,10 @@ async function renderStillOnVercel({
6024
6114
  timeoutInMilliseconds = 30000,
6025
6115
  offthreadVideoCacheSizeInBytes,
6026
6116
  mediaCacheSizeInBytes,
6117
+ preferredEffectBackend,
6027
6118
  offthreadVideoThreads,
6028
- licenseKey
6119
+ licenseKey,
6120
+ isProduction
6029
6121
  }) {
6030
6122
  const serveUrl = `/vercel/sandbox/${REMOTION_SANDBOX_BUNDLE_DIR}`;
6031
6123
  const renderConfig = {
@@ -6043,8 +6135,10 @@ async function renderStillOnVercel({
6043
6135
  timeoutInMilliseconds,
6044
6136
  offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes ?? null,
6045
6137
  mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
6138
+ preferredEffectBackend: preferredEffectBackend ?? "auto",
6046
6139
  offthreadVideoThreads: offthreadVideoThreads ?? null,
6047
6140
  licenseKey: licenseKey ?? null,
6141
+ isProduction: isProduction ?? null,
6048
6142
  chromeMode: "headless-shell",
6049
6143
  browserExecutable: null,
6050
6144
  binariesDirectory: null
@@ -1,8 +1,8 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
2
  /**
3
- * Remotion does not officially support glibc 2.34, but it can be patched.
3
+ * Remotion does not officially support glibc 2.34 on x64, but it can be patched.
4
4
  *
5
- * Vercel Sandbox runs Amazon Linux 2023 which ships glibc 2.34,
5
+ * Vercel Sandbox runs Amazon Linux 2023 on x64, which ships glibc 2.34,
6
6
  * but the compositor binary requires glibc 2.35.
7
7
  * We download Ubuntu 22.04's libc6 package and use patchelf to
8
8
  * point the compositor at the bundled glibc.
@@ -1,4 +1,5 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
+ import type { PreferredEffectBackend } from 'remotion';
2
3
  import type { AudioCodec, Bitrate, ChromiumOptions, Codec, ColorSpace, FrameRange, HardwareAccelerationOption, LogLevel, PixelFormat, ProResProfile, RenderMediaOnVercelProgress, VercelBlobUploadOptions, VideoImageFormat, X264Preset } from './types';
3
4
  type RenderMediaOnVercelBaseOptions = {
4
5
  sandbox: Sandbox;
@@ -23,6 +24,7 @@ type RenderMediaOnVercelBaseOptions = {
23
24
  concurrency?: number | string | null;
24
25
  metadata?: Record<string, string> | null;
25
26
  licenseKey?: string | null;
27
+ isProduction?: boolean;
26
28
  videoBitrate?: Bitrate | null;
27
29
  audioBitrate?: Bitrate | null;
28
30
  encodingMaxRate?: Bitrate | null;
@@ -41,6 +43,7 @@ type RenderMediaOnVercelBaseOptions = {
41
43
  hardwareAcceleration?: HardwareAccelerationOption;
42
44
  offthreadVideoCacheSizeInBytes?: number | null;
43
45
  mediaCacheSizeInBytes?: number | null;
46
+ preferredEffectBackend?: PreferredEffectBackend;
44
47
  offthreadVideoThreads?: number | null;
45
48
  sampleRate?: number;
46
49
  detachedSandboxTimeoutInMilliseconds?: number;
@@ -1,6 +1,7 @@
1
1
  import type { Sandbox } from '@vercel/sandbox';
2
+ import type { PreferredEffectBackend } from 'remotion';
2
3
  import type { ChromiumOptions, LogLevel, RenderStillOnVercelProgress, StillImageFormat } from './types';
3
- export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, onProgress, outputFile, frame, imageFormat, jpegQuality, envVariables, chromiumOptions, scale, logLevel, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, offthreadVideoThreads, licenseKey, }: {
4
+ export declare function renderStillOnVercel({ sandbox, compositionId, inputProps, onProgress, outputFile, frame, imageFormat, jpegQuality, envVariables, chromiumOptions, scale, logLevel, timeoutInMilliseconds, offthreadVideoCacheSizeInBytes, mediaCacheSizeInBytes, preferredEffectBackend, offthreadVideoThreads, licenseKey, isProduction, }: {
4
5
  sandbox: Sandbox;
5
6
  compositionId: string;
6
7
  inputProps: Record<string, unknown>;
@@ -16,8 +17,10 @@ export declare function renderStillOnVercel({ sandbox, compositionId, inputProps
16
17
  timeoutInMilliseconds?: number;
17
18
  offthreadVideoCacheSizeInBytes?: number | null;
18
19
  mediaCacheSizeInBytes?: number | null;
20
+ preferredEffectBackend?: PreferredEffectBackend;
19
21
  offthreadVideoThreads?: number | null;
20
22
  licenseKey?: string | null;
23
+ isProduction?: boolean;
21
24
  }): Promise<{
22
25
  sandboxFilePath: string;
23
26
  contentType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/vercel",
3
- "version": "4.0.539",
3
+ "version": "4.0.540",
4
4
  "description": "Render Remotion videos on Vercel Sandbox",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "url": "https://github.com/remotion-dev/remotion/issues"
24
24
  },
25
25
  "dependencies": {
26
- "@remotion/renderer": "4.0.539",
27
- "remotion": "4.0.539"
26
+ "@remotion/renderer": "4.0.540",
27
+ "remotion": "4.0.540"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@vercel/sandbox": ">=1.0.0"
@@ -38,7 +38,7 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "devDependencies": {
41
- "@remotion/eslint-config-internal": "4.0.539",
41
+ "@remotion/eslint-config-internal": "4.0.540",
42
42
  "@vercel/blob": "2.3.0",
43
43
  "@vercel/sandbox": "1.6.0",
44
44
  "eslint": "9.19.0",