@remotion/cloudrun 4.0.350 → 4.0.352

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.
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @remotion/cloudrun@4.0.350 make /Users/jonathanburger/remotion/packages/cloudrun
3
+ > @remotion/cloudrun@4.0.352 make /Users/jonathanburger/remotion/packages/cloudrun
4
4
  > tsc -d && cp src/shared/sa-permissions.json dist/shared/sa-permissions.json
5
5
 
@@ -1,24 +1,27 @@
1
1
 
2
- $ bun test src
3
- bun test v1.2.21 (7c45ed97)
2
+ 
3
+ > @remotion/cloudrun@4.0.311 test /Users/jonathanburger/remotion/packages/cloudrun
4
+ > bun test src
5
+
6
+ bun test v1.2.14 (6a363a38)
4
7
  
5
8
  src/api/test/service-names.test.ts:
6
- ✓ Parse service names [1.35ms]
9
+ ✓ Parse service names [0.48ms]
7
10
  
8
11
  src/api/test/running-in-what-server.test.ts:
9
12
  ✓ is running in cloud tasks = true
10
- ✓ is running in cloud tasks = false [0.03ms]
11
- ✓ which project Id = remotion-test [0.06ms]
12
- ✓ which project Id = remotion-test-cloudtask [0.01ms]
13
+ ✓ is running in cloud tasks = false [0.06ms]
14
+ ✓ which project Id = remotion-test [0.01ms]
15
+ ✓ which project Id = remotion-test-cloudtask
13
16
  
14
17
  src/api/test/payloads.test.ts:
15
- ✓ CloudRunPayload should work with and without optional webhook fields [2.48ms]
18
+ ✓ CloudRunPayload should work with and without optional webhook fields [0.71ms]
16
19
  
17
20
  src/api/test/make-console.test.ts:
18
- ✓ app is in cloud tasks [0.34ms]
19
- ✓ app is not in cloud tasks [0.03ms]
21
+ ✓ app is in cloud tasks [0.06ms]
22
+ ✓ app is not in cloud tasks [0.01ms]
20
23
 
21
24
   8 pass
22
25
   0 fail
23
26
  17 expect() calls
24
- Ran 8 tests across 4 files. [99.00ms]
27
+ Ran 8 tests across 4 files. [22.00ms]
@@ -70,7 +70,7 @@ export type RenderMediaOnCloudrunInput = {
70
70
  renderIdOverride?: z.infer<typeof CloudRunPayload>['renderIdOverride'];
71
71
  renderStatusWebhook?: z.infer<typeof CloudRunPayload>['renderStatusWebhook'];
72
72
  } & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnCloudRun>>;
73
- declare const internalRenderMediaOnCloudrunRaw: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, renderIdOverride, renderStatusWebhook, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, colorSpace, downloadBehavior, metadata, }: InternalRenderMediaOnCloudrun) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
73
+ declare const internalRenderMediaOnCloudrunRaw: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, renderIdOverride, renderStatusWebhook, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, colorSpace, downloadBehavior, metadata, mediaCacheSizeInBytes, }: InternalRenderMediaOnCloudrun) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
74
74
  export declare const internalRenderMediaOnCloudrun: typeof internalRenderMediaOnCloudrunRaw;
75
- export declare const renderMediaOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, downloadBehavior, metadata, renderIdOverride, renderStatusWebhook, offthreadVideoThreads, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
75
+ export declare const renderMediaOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, downloadBehavior, metadata, renderIdOverride, renderStatusWebhook, offthreadVideoThreads, mediaCacheSizeInBytes, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
76
76
  export {};
@@ -11,7 +11,7 @@ const validate_serveurl_1 = require("../shared/validate-serveurl");
11
11
  const get_or_create_bucket_1 = require("./get-or-create-bucket");
12
12
  const get_auth_client_for_url_1 = require("./helpers/get-auth-client-for-url");
13
13
  const get_cloudrun_endpoint_1 = require("./helpers/get-cloudrun-endpoint");
14
- const internalRenderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, renderIdOverride, renderStatusWebhook, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, colorSpace, downloadBehavior, metadata, }) => {
14
+ const internalRenderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, renderIdOverride, renderStatusWebhook, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, colorSpace, downloadBehavior, metadata, mediaCacheSizeInBytes, }) => {
15
15
  const actualCodec = (0, validate_gcp_codec_1.validateCloudrunCodec)(codec);
16
16
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
17
17
  if (privacy)
@@ -68,6 +68,7 @@ const internalRenderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, regi
68
68
  metadata: metadata !== null && metadata !== void 0 ? metadata : null,
69
69
  renderIdOverride,
70
70
  renderStatusWebhook,
71
+ mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
71
72
  };
72
73
  const client = await (0, get_auth_client_for_url_1.getAuthClientForUrl)(cloudRunEndpoint);
73
74
  const postResponse = await client.request({
@@ -137,7 +138,7 @@ exports.internalRenderMediaOnCloudrun = (0, error_handling_1.wrapWithErrorHandli
137
138
  * @description Initiates a media rendering process on the Remotion Cloud Run service, facilitating configurations like service region, project composition, and output settings.
138
139
  * @see [Documentation](https://remotion.dev/docs/cloudrun/rendermediaoncloudrun)
139
140
  */
140
- const renderMediaOnCloudrun = ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, downloadBehavior, metadata, renderIdOverride, renderStatusWebhook, offthreadVideoThreads, }) => {
141
+ const renderMediaOnCloudrun = ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, downloadBehavior, metadata, renderIdOverride, renderStatusWebhook, offthreadVideoThreads, mediaCacheSizeInBytes, }) => {
141
142
  return (0, exports.internalRenderMediaOnCloudrun)({
142
143
  cloudRunUrl: cloudRunUrl !== null && cloudRunUrl !== void 0 ? cloudRunUrl : undefined,
143
144
  serviceName: serviceName !== null && serviceName !== void 0 ? serviceName : undefined,
@@ -185,6 +186,7 @@ const renderMediaOnCloudrun = ({ cloudRunUrl, serviceName, region, serveUrl, com
185
186
  renderIdOverride: renderIdOverride !== null && renderIdOverride !== void 0 ? renderIdOverride : undefined,
186
187
  renderStatusWebhook: renderStatusWebhook !== null && renderStatusWebhook !== void 0 ? renderStatusWebhook : undefined,
187
188
  offthreadVideoThreads: offthreadVideoThreads !== null && offthreadVideoThreads !== void 0 ? offthreadVideoThreads : null,
189
+ mediaCacheSizeInBytes: mediaCacheSizeInBytes !== null && mediaCacheSizeInBytes !== void 0 ? mediaCacheSizeInBytes : null,
188
190
  });
189
191
  };
190
192
  exports.renderMediaOnCloudrun = renderMediaOnCloudrun;
@@ -29,21 +29,21 @@ type OptionalParameters = {
29
29
  } & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnCloudRun>;
30
30
  export type RenderStillOnCloudrunInput = Partial<OptionalParameters> & MandatoryParameters;
31
31
  export declare const renderStillOnCloudrun: (options: RenderStillOnCloudrunInput) => Promise<{
32
+ name: string;
33
+ message: string;
34
+ type: "error";
35
+ stack: string;
36
+ } | {
37
+ bucketName: string;
32
38
  type: "success";
33
39
  privacy: "public-read" | "project-private";
34
40
  cloudStorageUri: string;
35
41
  size: number;
36
- bucketName: string;
37
42
  renderId: string;
38
43
  publicUrl?: string | null | undefined;
39
44
  } | {
40
- type: "error";
41
- message: string;
42
- name: string;
43
- stack: string;
44
- } | {
45
- type: "crash";
46
45
  message: "Service crashed without sending a response. Check the logs in GCP console.";
46
+ type: "crash";
47
47
  cloudRunEndpoint: string;
48
48
  requestStartTime: string;
49
49
  requestCrashTime: string;
@@ -35,7 +35,7 @@ const get_cloudrun_endpoint_1 = require("./helpers/get-cloudrun-endpoint");
35
35
  * @param params.metadata Metadata to be attached to the output file.
36
36
  * @returns {Promise<RenderStillOnCloudrunOutput>} See documentation for detailed structure
37
37
  */
38
- const internalRenderStillOnCloudRun = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, forceBucketName, privacy, outName, imageFormat, envVariables, frame, jpegQuality, chromiumOptions, scale, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, downloadBehavior, renderIdOverride, renderStatusWebhook, }) => {
38
+ const internalRenderStillOnCloudRun = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, forceBucketName, privacy, outName, imageFormat, envVariables, frame, jpegQuality, chromiumOptions, scale, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, downloadBehavior, renderIdOverride, renderStatusWebhook, mediaCacheSizeInBytes, }) => {
39
39
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
40
40
  if (privacy)
41
41
  (0, validate_privacy_1.validatePrivacy)(privacy);
@@ -73,6 +73,7 @@ const internalRenderStillOnCloudRun = async ({ cloudRunUrl, serviceName, region,
73
73
  downloadBehavior,
74
74
  renderIdOverride,
75
75
  renderStatusWebhook,
76
+ mediaCacheSizeInBytes,
76
77
  };
77
78
  const client = await (0, get_auth_client_for_url_1.getAuthClientForUrl)(cloudRunEndpoint);
78
79
  const postResponse = await client.request({
@@ -132,7 +133,7 @@ const internalRenderStillOnCloudRun = async ({ cloudRunUrl, serviceName, region,
132
133
  };
133
134
  const errorHandled = (0, error_handling_1.wrapWithErrorHandling)(internalRenderStillOnCloudRun);
134
135
  const renderStillOnCloudrun = (options) => {
135
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
136
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
136
137
  return errorHandled({
137
138
  chromiumOptions: (_a = options.chromiumOptions) !== null && _a !== void 0 ? _a : {},
138
139
  cloudRunUrl: (_b = options.cloudRunUrl) !== null && _b !== void 0 ? _b : null,
@@ -159,6 +160,7 @@ const renderStillOnCloudrun = (options) => {
159
160
  downloadBehavior: (_u = options.downloadBehavior) !== null && _u !== void 0 ? _u : { type: 'play-in-browser' },
160
161
  renderIdOverride: (_v = options.renderIdOverride) !== null && _v !== void 0 ? _v : undefined,
161
162
  renderStatusWebhook: (_w = options.renderStatusWebhook) !== null && _w !== void 0 ? _w : undefined,
163
+ mediaCacheSizeInBytes: (_x = options.mediaCacheSizeInBytes) !== null && _x !== void 0 ? _x : null,
162
164
  });
163
165
  };
164
166
  exports.renderStillOnCloudrun = renderStillOnCloudrun;
@@ -20,6 +20,7 @@ const payloads_1 = require("../../functions/helpers/payloads");
20
20
  outName: null,
21
21
  offthreadVideoCacheSizeInBytes: null,
22
22
  offthreadVideoThreads: null,
23
+ mediaCacheSizeInBytes: null,
23
24
  serializedInputPropsWithCustomSchema: JSON.stringify({}),
24
25
  };
25
26
  const withWebhook = {
@@ -14,7 +14,7 @@ const cloudrun_crash_logs_1 = require("../../helpers/cloudrun-crash-logs");
14
14
  const log_1 = require("../../log");
15
15
  const renderArgsCheck_1 = require("./helpers/renderArgsCheck");
16
16
  exports.RENDER_COMMAND = 'render';
17
- const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, numberOfGifLoopsOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, metadataOption, } = client_1.BrowserSafeApis.options;
17
+ const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, offthreadVideoThreadsOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, numberOfGifLoopsOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, metadataOption, mediaCacheSizeInBytesOption, } = client_1.BrowserSafeApis.options;
18
18
  const renderCommand = async (args, remotionRoot, logLevel) => {
19
19
  var _a, _b, _c, _d;
20
20
  const { serveUrl, cloudRunUrl, outName, forceBucketName, downloadName, privacy, region, } = await (0, renderArgsCheck_1.renderArgsCheck)(exports.RENDER_COMMAND, args, logLevel);
@@ -53,6 +53,9 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
53
53
  const binariesDirectory = binariesDirectoryOption.getValue({
54
54
  commandLine: cli_1.CliInternals.parsedCli,
55
55
  }).value;
56
+ const mediaCacheSizeInBytes = mediaCacheSizeInBytesOption.getValue({
57
+ commandLine: cli_1.CliInternals.parsedCli,
58
+ }).value;
56
59
  let composition = args[1];
57
60
  const chromiumOptions = {
58
61
  disableWebSecurity,
@@ -109,6 +112,7 @@ const renderCommand = async (args, remotionRoot, logLevel) => {
109
112
  quiet: cli_1.CliInternals.quietFlagProvided(),
110
113
  }),
111
114
  chromeMode: 'headless-shell',
115
+ mediaCacheSizeInBytes,
112
116
  });
113
117
  composition = compositionId;
114
118
  }
@@ -251,6 +255,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
251
255
  }
252
256
  : null,
253
257
  offthreadVideoThreads,
258
+ mediaCacheSizeInBytes,
254
259
  });
255
260
  if (res.type === 'crash') {
256
261
  (0, cloudrun_crash_logs_1.displayCrashLogs)(res, logLevel);
@@ -13,7 +13,7 @@ const cloudrun_crash_logs_1 = require("../helpers/cloudrun-crash-logs");
13
13
  const log_1 = require("../log");
14
14
  const renderArgsCheck_1 = require("./render/helpers/renderArgsCheck");
15
15
  exports.STILL_COMMAND = 'still';
16
- const { offthreadVideoCacheSizeInBytesOption, scaleOption, jpegQualityOption, enableMultiprocessOnLinuxOption, glOption, delayRenderTimeoutInMillisecondsOption, headlessOption, binariesDirectoryOption, } = client_1.BrowserSafeApis.options;
16
+ const { offthreadVideoCacheSizeInBytesOption, scaleOption, jpegQualityOption, enableMultiprocessOnLinuxOption, glOption, delayRenderTimeoutInMillisecondsOption, headlessOption, binariesDirectoryOption, mediaCacheSizeInBytesOption, } = client_1.BrowserSafeApis.options;
17
17
  const stillCommand = async (args, remotionRoot, logLevel) => {
18
18
  var _a, _b;
19
19
  const { serveUrl, cloudRunUrl, outName, forceBucketName, privacy, downloadName, region, } = await (0, renderArgsCheck_1.renderArgsCheck)(exports.STILL_COMMAND, args, logLevel);
@@ -47,6 +47,9 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
47
47
  const binariesDirectory = binariesDirectoryOption.getValue({
48
48
  commandLine: cli_1.CliInternals.parsedCli,
49
49
  }).value;
50
+ const mediaCacheSizeInBytes = mediaCacheSizeInBytesOption.getValue({
51
+ commandLine: cli_1.CliInternals.parsedCli,
52
+ }).value;
50
53
  if (!composition) {
51
54
  log_1.Log.info({ indent: false, logLevel }, 'No compositions passed. Fetching compositions...');
52
55
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
@@ -94,6 +97,7 @@ const stillCommand = async (args, remotionRoot, logLevel) => {
94
97
  }),
95
98
  chromeMode: 'headless-shell',
96
99
  offthreadVideoThreads: 1,
100
+ mediaCacheSizeInBytes,
97
101
  });
98
102
  composition = compositionId;
99
103
  }
@@ -29,6 +29,7 @@ const getCompositionFromBody = async (body) => {
29
29
  },
30
30
  onServeUrlVisited: () => undefined,
31
31
  chromeMode: 'headless-shell',
32
+ mediaCacheSizeInBytes: body.mediaCacheSizeInBytes,
32
33
  });
33
34
  if (propsSize > 10000000) {
34
35
  renderer_1.RenderInternals.Log.warn({ indent: false, logLevel: body.logLevel }, `The props of your composition are large (${propsSize} bytes). This may cause slowdown.`);
@@ -69,6 +69,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
69
69
  enforceAudioTrack: z.ZodBoolean;
70
70
  preferLossless: z.ZodBoolean;
71
71
  offthreadVideoCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
72
+ mediaCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
72
73
  offthreadVideoThreads: z.ZodNullable<z.ZodNumber>;
73
74
  colorSpace: z.ZodNullable<z.ZodEnum<["default", "bt709", "bt2020-ncl"]>>;
74
75
  clientVersion: z.ZodString;
@@ -130,12 +131,13 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
130
131
  envVariables: Record<string, string>;
131
132
  muted: boolean;
132
133
  outputBucket: string;
133
- logLevel: "error" | "trace" | "verbose" | "info" | "warn";
134
+ logLevel: "trace" | "verbose" | "info" | "warn" | "error";
134
135
  delayRenderTimeoutInMilliseconds: number | null;
135
136
  concurrency: string | number | null;
136
137
  enforceAudioTrack: boolean;
137
138
  preferLossless: boolean;
138
139
  offthreadVideoCacheSizeInBytes: number | null;
140
+ mediaCacheSizeInBytes: number | null;
139
141
  offthreadVideoThreads: number | null;
140
142
  colorSpace: "default" | "bt709" | "bt2020-ncl" | null;
141
143
  clientVersion: string;
@@ -188,12 +190,13 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
188
190
  envVariables: Record<string, string>;
189
191
  muted: boolean;
190
192
  outputBucket: string;
191
- logLevel: "error" | "trace" | "verbose" | "info" | "warn";
193
+ logLevel: "trace" | "verbose" | "info" | "warn" | "error";
192
194
  delayRenderTimeoutInMilliseconds: number | null;
193
195
  concurrency: string | number | null;
194
196
  enforceAudioTrack: boolean;
195
197
  preferLossless: boolean;
196
198
  offthreadVideoCacheSizeInBytes: number | null;
199
+ mediaCacheSizeInBytes: number | null;
197
200
  offthreadVideoThreads: number | null;
198
201
  colorSpace: "default" | "bt709" | "bt2020-ncl" | null;
199
202
  clientVersion: string;
@@ -258,6 +261,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
258
261
  frame: z.ZodNumber;
259
262
  delayRenderTimeoutInMilliseconds: z.ZodNumber;
260
263
  logLevel: z.ZodEnum<["trace", "verbose", "info", "warn", "error"]>;
264
+ mediaCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
261
265
  offthreadVideoCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
262
266
  offthreadVideoThreads: z.ZodNullable<z.ZodNumber>;
263
267
  clientVersion: z.ZodString;
@@ -306,9 +310,10 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
306
310
  outputBucket: string;
307
311
  outName: string | null;
308
312
  privacy: "public" | "private" | "no-acl";
309
- logLevel: "error" | "trace" | "verbose" | "info" | "warn";
313
+ logLevel: "trace" | "verbose" | "info" | "warn" | "error";
310
314
  delayRenderTimeoutInMilliseconds: number;
311
315
  offthreadVideoCacheSizeInBytes: number | null;
316
+ mediaCacheSizeInBytes: number | null;
312
317
  offthreadVideoThreads: number | null;
313
318
  clientVersion: string;
314
319
  downloadBehavior: {
@@ -347,9 +352,10 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
347
352
  outputBucket: string;
348
353
  outName: string | null;
349
354
  privacy: "public" | "private" | "no-acl";
350
- logLevel: "error" | "trace" | "verbose" | "info" | "warn";
355
+ logLevel: "trace" | "verbose" | "info" | "warn" | "error";
351
356
  delayRenderTimeoutInMilliseconds: number;
352
357
  offthreadVideoCacheSizeInBytes: number | null;
358
+ mediaCacheSizeInBytes: number | null;
353
359
  offthreadVideoThreads: number | null;
354
360
  clientVersion: string;
355
361
  downloadBehavior: {
@@ -384,14 +390,14 @@ declare const renderFailResponsePayload: z.ZodObject<{
384
390
  name: z.ZodString;
385
391
  stack: z.ZodString;
386
392
  }, "strip", z.ZodTypeAny, {
387
- type: "error";
388
- message: string;
389
393
  name: string;
394
+ message: string;
395
+ type: "error";
390
396
  stack: string;
391
397
  }, {
392
- type: "error";
393
- message: string;
394
398
  name: string;
399
+ message: string;
400
+ type: "error";
395
401
  stack: string;
396
402
  }>;
397
403
  declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
@@ -403,19 +409,19 @@ declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
403
409
  renderId: z.ZodString;
404
410
  privacy: z.ZodEnum<["public-read", "project-private"]>;
405
411
  }, "strip", z.ZodTypeAny, {
412
+ bucketName: string;
406
413
  type: "success";
407
414
  privacy: "public-read" | "project-private";
408
415
  cloudStorageUri: string;
409
416
  size: number;
410
- bucketName: string;
411
417
  renderId: string;
412
418
  publicUrl?: string | null | undefined;
413
419
  }, {
420
+ bucketName: string;
414
421
  type: "success";
415
422
  privacy: "public-read" | "project-private";
416
423
  cloudStorageUri: string;
417
424
  size: number;
418
- bucketName: string;
419
425
  renderId: string;
420
426
  publicUrl?: string | null | undefined;
421
427
  }>;
@@ -428,19 +434,19 @@ declare const renderMediaOnCloudrunResponsePayload: z.ZodObject<{
428
434
  renderId: z.ZodString;
429
435
  privacy: z.ZodEnum<["public-read", "project-private"]>;
430
436
  }, "strip", z.ZodTypeAny, {
437
+ bucketName: string;
431
438
  type: "success";
432
439
  privacy: "public-read" | "project-private";
433
440
  cloudStorageUri: string;
434
441
  size: number;
435
- bucketName: string;
436
442
  renderId: string;
437
443
  publicUrl?: string | null | undefined;
438
444
  }, {
445
+ bucketName: string;
439
446
  type: "success";
440
447
  privacy: "public-read" | "project-private";
441
448
  cloudStorageUri: string;
442
449
  size: number;
443
- bucketName: string;
444
450
  renderId: string;
445
451
  publicUrl?: string | null | undefined;
446
452
  }>;
@@ -452,15 +458,15 @@ declare const cloudRunCrashResponse: z.ZodObject<{
452
458
  requestCrashTime: z.ZodString;
453
459
  requestElapsedTimeInSeconds: z.ZodNumber;
454
460
  }, "strip", z.ZodTypeAny, {
455
- type: "crash";
456
461
  message: "Service crashed without sending a response. Check the logs in GCP console.";
462
+ type: "crash";
457
463
  cloudRunEndpoint: string;
458
464
  requestStartTime: string;
459
465
  requestCrashTime: string;
460
466
  requestElapsedTimeInSeconds: number;
461
467
  }, {
462
- type: "crash";
463
468
  message: "Service crashed without sending a response. Check the logs in GCP console.";
469
+ type: "crash";
464
470
  cloudRunEndpoint: string;
465
471
  requestStartTime: string;
466
472
  requestCrashTime: string;
@@ -63,6 +63,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
63
63
  enforceAudioTrack: zod_1.z.boolean(),
64
64
  preferLossless: zod_1.z.boolean(),
65
65
  offthreadVideoCacheSizeInBytes: zod_1.z.number().nullable(),
66
+ mediaCacheSizeInBytes: zod_1.z.number().nullable(),
66
67
  offthreadVideoThreads: zod_1.z.number().nullable(),
67
68
  colorSpace: zod_1.z.enum(client_1.BrowserSafeApis.validColorSpaces).nullable(),
68
69
  clientVersion: zod_1.z.string(),
@@ -97,6 +98,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
97
98
  frame: zod_1.z.number(),
98
99
  delayRenderTimeoutInMilliseconds: zod_1.z.number(),
99
100
  logLevel,
101
+ mediaCacheSizeInBytes: zod_1.z.number().nullable(),
100
102
  offthreadVideoCacheSizeInBytes: zod_1.z.number().nullable(),
101
103
  offthreadVideoThreads: zod_1.z.number().nullable(),
102
104
  clientVersion: zod_1.z.string(),
@@ -130,6 +130,7 @@ const renderMediaSingleThread = async (body, res) => {
130
130
  puppeteerInstance: undefined,
131
131
  server: undefined,
132
132
  offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,
133
+ mediaCacheSizeInBytes: body.mediaCacheSizeInBytes,
133
134
  offthreadVideoThreads: body.offthreadVideoThreads,
134
135
  colorSpace: body.colorSpace,
135
136
  repro: false,
@@ -74,6 +74,7 @@ const renderStillSingleThread = async (body, res) => {
74
74
  throw new Error('Emitting artifacts is not supported in Cloud Run');
75
75
  },
76
76
  chromeMode: 'headless-shell',
77
+ mediaCacheSizeInBytes: body.mediaCacheSizeInBytes,
77
78
  });
78
79
  log_1.Log.info({ indent: false, logLevel: body.logLevel }, 'Still rendered');
79
80
  const storage = new storage_1.Storage();
package/dist/index.d.ts CHANGED
@@ -16,26 +16,26 @@ import type { GcpRegion } from './pricing/gcp-regions';
16
16
  /**
17
17
  * @deprecated Import this from `@remotion/cloudrun/client` instead
18
18
  */
19
- declare const renderMediaOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, downloadBehavior, metadata, renderIdOverride, renderStatusWebhook, offthreadVideoThreads, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | import("./functions/helpers/payloads").CloudRunCrashResponse>;
19
+ declare const renderMediaOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, encodingMaxRate, encodingBufferSize, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, downloadBehavior, metadata, renderIdOverride, renderStatusWebhook, offthreadVideoThreads, mediaCacheSizeInBytes, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | import("./functions/helpers/payloads").CloudRunCrashResponse>;
20
20
  /**
21
21
  * @deprecated Import this from `@remotion/cloudrun/client` instead
22
22
  */
23
23
  declare const renderStillOnCloudrun: (options: import("./api/render-still-on-cloudrun").RenderStillOnCloudrunInput) => Promise<{
24
+ name: string;
25
+ message: string;
26
+ type: "error";
27
+ stack: string;
28
+ } | {
29
+ bucketName: string;
24
30
  type: "success";
25
31
  privacy: "public-read" | "project-private";
26
32
  cloudStorageUri: string;
27
33
  size: number;
28
- bucketName: string;
29
34
  renderId: string;
30
35
  publicUrl?: string | null | undefined;
31
36
  } | {
32
- type: "error";
33
- message: string;
34
- name: string;
35
- stack: string;
36
- } | {
37
- type: "crash";
38
37
  message: "Service crashed without sending a response. Check the logs in GCP console.";
38
+ type: "crash";
39
39
  cloudRunEndpoint: string;
40
40
  requestStartTime: string;
41
41
  requestCrashTime: string;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/cloudrun"
4
4
  },
5
5
  "name": "@remotion/cloudrun",
6
- "version": "4.0.350",
6
+ "version": "4.0.352",
7
7
  "description": "Render Remotion videos on Google Cloud Run",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -16,16 +16,16 @@
16
16
  "@google-cloud/logging": "11.2.0",
17
17
  "google-auth-library": "8.7.0",
18
18
  "zod": "3.22.3",
19
- "remotion": "4.0.350",
20
- "@remotion/cli": "4.0.350",
21
- "@remotion/renderer": "4.0.350",
22
- "@remotion/bundler": "4.0.350"
19
+ "@remotion/bundler": "4.0.352",
20
+ "@remotion/cli": "4.0.352",
21
+ "@remotion/renderer": "4.0.352",
22
+ "remotion": "4.0.352"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/minimist": "1.2.2",
26
26
  "eslint": "9.19.0",
27
- "@remotion/eslint-config-internal": "4.0.350",
28
- "@remotion/compositor-linux-x64-gnu": "4.0.350"
27
+ "@remotion/eslint-config-internal": "4.0.352",
28
+ "@remotion/compositor-linux-x64-gnu": "4.0.352"
29
29
  },
30
30
  "exports": {
31
31
  "./package.json": "./package.json",