@remotion/cloudrun 4.0.214 → 4.0.216
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/.turbo/turbo-build.log +6 -0
- package/.turbo/turbo-make.log +1 -1
- package/dist/api/render-media-on-cloudrun.d.ts +5 -2
- package/dist/api/render-media-on-cloudrun.js +5 -2
- package/dist/api/render-still-on-cloudrun.d.ts +7 -7
- package/dist/api/render-still-on-cloudrun.js +1 -0
- package/dist/cli/commands/render/index.js +5 -1
- package/dist/functions/helpers/payloads.d.ts +20 -14
- package/dist/functions/helpers/payloads.js +2 -0
- package/dist/functions/render-media-single-thread.js +3 -2
- package/dist/index.d.ts +8 -8
- package/package.json +6 -6
package/.turbo/turbo-make.log
CHANGED
|
@@ -31,6 +31,7 @@ type InternalRenderMediaOnCloudrun = {
|
|
|
31
31
|
indent: boolean;
|
|
32
32
|
logLevel: LogLevel;
|
|
33
33
|
downloadBehavior: DownloadBehavior;
|
|
34
|
+
metadata?: Record<string, string> | null;
|
|
34
35
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnCloudRun>>;
|
|
35
36
|
export type RenderMediaOnCloudrunInput = {
|
|
36
37
|
cloudRunUrl?: string;
|
|
@@ -59,8 +60,9 @@ export type RenderMediaOnCloudrunInput = {
|
|
|
59
60
|
concurrency?: number | string | null;
|
|
60
61
|
preferLossless?: boolean;
|
|
61
62
|
downloadBehavior?: DownloadBehavior;
|
|
63
|
+
metadata?: Record<string, string> | null;
|
|
62
64
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnCloudRun>>;
|
|
63
|
-
declare const internalRenderMediaOnCloudrunRaw: ({ 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, }: InternalRenderMediaOnCloudrun) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
|
|
65
|
+
declare const internalRenderMediaOnCloudrunRaw: ({ 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, }: InternalRenderMediaOnCloudrun) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
|
|
64
66
|
export declare const internalRenderMediaOnCloudrun: typeof internalRenderMediaOnCloudrunRaw;
|
|
65
67
|
/**
|
|
66
68
|
* @description Triggers a render on a GCP Cloud Run service given a composition and a Cloud Run URL.
|
|
@@ -101,7 +103,8 @@ export declare const internalRenderMediaOnCloudrun: typeof internalRenderMediaOn
|
|
|
101
103
|
* @param params.concurrency A number or a string describing how many browser tabs should be opened. Default "50%".
|
|
102
104
|
* @param params.enforceAudioTrack Render a silent audio track if there wouldn't be any otherwise.
|
|
103
105
|
* @param params.preferLossless Uses a lossless audio codec, if one is available for the codec. If you set audioCodec, it takes priority over preferLossless.
|
|
106
|
+
* @param params.metadata Metadata to be attached to the output file.
|
|
104
107
|
* @returns {Promise<RenderMediaOnCloudrunOutput>} See documentation for detailed structure
|
|
105
108
|
*/
|
|
106
|
-
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, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
|
|
109
|
+
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, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
|
|
107
110
|
export {};
|
|
@@ -10,7 +10,7 @@ const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
|
10
10
|
const get_or_create_bucket_1 = require("./get-or-create-bucket");
|
|
11
11
|
const get_auth_client_for_url_1 = require("./helpers/get-auth-client-for-url");
|
|
12
12
|
const get_cloudrun_endpoint_1 = require("./helpers/get-cloudrun-endpoint");
|
|
13
|
-
const internalRenderMediaOnCloudrunRaw = async ({ 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, }) => {
|
|
13
|
+
const internalRenderMediaOnCloudrunRaw = async ({ 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, }) => {
|
|
14
14
|
const actualCodec = (0, validate_gcp_codec_1.validateCloudrunCodec)(codec);
|
|
15
15
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
16
16
|
if (privacy)
|
|
@@ -63,6 +63,7 @@ const internalRenderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, regi
|
|
|
63
63
|
colorSpace: colorSpace !== null && colorSpace !== void 0 ? colorSpace : null,
|
|
64
64
|
clientVersion: version_1.VERSION,
|
|
65
65
|
downloadBehavior,
|
|
66
|
+
metadata: metadata !== null && metadata !== void 0 ? metadata : null,
|
|
66
67
|
};
|
|
67
68
|
const client = await (0, get_auth_client_for_url_1.getAuthClientForUrl)(cloudRunEndpoint);
|
|
68
69
|
const postResponse = await client.request({
|
|
@@ -167,9 +168,10 @@ exports.internalRenderMediaOnCloudrun = (0, error_handling_1.wrapWithErrorHandli
|
|
|
167
168
|
* @param params.concurrency A number or a string describing how many browser tabs should be opened. Default "50%".
|
|
168
169
|
* @param params.enforceAudioTrack Render a silent audio track if there wouldn't be any otherwise.
|
|
169
170
|
* @param params.preferLossless Uses a lossless audio codec, if one is available for the codec. If you set audioCodec, it takes priority over preferLossless.
|
|
171
|
+
* @param params.metadata Metadata to be attached to the output file.
|
|
170
172
|
* @returns {Promise<RenderMediaOnCloudrunOutput>} See documentation for detailed structure
|
|
171
173
|
*/
|
|
172
|
-
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, }) => {
|
|
174
|
+
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, }) => {
|
|
173
175
|
return (0, exports.internalRenderMediaOnCloudrun)({
|
|
174
176
|
cloudRunUrl: cloudRunUrl !== null && cloudRunUrl !== void 0 ? cloudRunUrl : undefined,
|
|
175
177
|
serviceName: serviceName !== null && serviceName !== void 0 ? serviceName : undefined,
|
|
@@ -213,6 +215,7 @@ const renderMediaOnCloudrun = ({ cloudRunUrl, serviceName, region, serveUrl, com
|
|
|
213
215
|
downloadBehavior: downloadBehavior !== null && downloadBehavior !== void 0 ? downloadBehavior : {
|
|
214
216
|
type: 'play-in-browser',
|
|
215
217
|
},
|
|
218
|
+
metadata: metadata !== null && metadata !== void 0 ? metadata : null,
|
|
216
219
|
});
|
|
217
220
|
};
|
|
218
221
|
exports.renderMediaOnCloudrun = renderMediaOnCloudrun;
|
|
@@ -25,21 +25,21 @@ type OptionalParameters = {
|
|
|
25
25
|
} & ToOptions<typeof BrowserSafeApis.optionsMap.renderStillOnCloudRun>;
|
|
26
26
|
export type RenderStillOnCloudrunInput = Partial<OptionalParameters> & MandatoryParameters;
|
|
27
27
|
export declare const renderStillOnCloudrun: (options: RenderStillOnCloudrunInput) => Promise<{
|
|
28
|
-
name: string;
|
|
29
|
-
message: string;
|
|
30
|
-
type: "error";
|
|
31
|
-
stack: string;
|
|
32
|
-
} | {
|
|
33
|
-
bucketName: string;
|
|
34
28
|
type: "success";
|
|
35
29
|
privacy: "public-read" | "project-private";
|
|
36
30
|
cloudStorageUri: string;
|
|
37
31
|
size: number;
|
|
32
|
+
bucketName: string;
|
|
38
33
|
renderId: string;
|
|
39
34
|
publicUrl?: string | null | undefined;
|
|
40
35
|
} | {
|
|
41
|
-
|
|
36
|
+
type: "error";
|
|
37
|
+
message: string;
|
|
38
|
+
name: string;
|
|
39
|
+
stack: string;
|
|
40
|
+
} | {
|
|
42
41
|
type: "crash";
|
|
42
|
+
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
43
43
|
cloudRunEndpoint: string;
|
|
44
44
|
requestStartTime: string;
|
|
45
45
|
requestCrashTime: string;
|
|
@@ -32,6 +32,7 @@ const get_cloudrun_endpoint_1 = require("./helpers/get-cloudrun-endpoint");
|
|
|
32
32
|
* @param params.forceHeight Overrides default composition height.
|
|
33
33
|
* @param params.logLevel Level of logging that Cloud Run service should perform. Default "info".
|
|
34
34
|
* @param params.delayRenderTimeoutInMilliseconds A number describing how long the render may take to resolve all delayRender() calls before it times out.
|
|
35
|
+
* @param params.metadata Metadata to be attached to the output file.
|
|
35
36
|
* @returns {Promise<RenderStillOnCloudrunOutput>} See documentation for detailed structure
|
|
36
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, downloadBehavior, }) => {
|
|
@@ -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, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, numberOfGifLoopsOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, } = client_1.BrowserSafeApis.options;
|
|
17
|
+
const { audioBitrateOption, x264Option, offthreadVideoCacheSizeInBytesOption, scaleOption, crfOption, jpegQualityOption, videoBitrateOption, enforceAudioOption, mutedOption, colorSpaceOption, numberOfGifLoopsOption, enableMultiprocessOnLinuxOption, glOption, headlessOption, encodingMaxRateOption, encodingBufferSizeOption, delayRenderTimeoutInMillisecondsOption, binariesDirectoryOption, metadataOption, } = client_1.BrowserSafeApis.options;
|
|
18
18
|
const renderCommand = async (args, remotionRoot, logLevel) => {
|
|
19
19
|
var _a, _b;
|
|
20
20
|
const { serveUrl, cloudRunUrl, outName, forceBucketName, downloadName, privacy, region, } = await (0, renderArgsCheck_1.renderArgsCheck)(exports.RENDER_COMMAND, args, logLevel);
|
|
@@ -189,6 +189,9 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
|
|
|
189
189
|
const encodingBufferSize = encodingBufferSizeOption.getValue({
|
|
190
190
|
commandLine: cli_1.CliInternals.parsedCli,
|
|
191
191
|
}).value;
|
|
192
|
+
const metadata = metadataOption.getValue({
|
|
193
|
+
commandLine: cli_1.CliInternals.parsedCli,
|
|
194
|
+
}).value;
|
|
192
195
|
const res = await (0, render_media_on_cloudrun_1.internalRenderMediaOnCloudrun)({
|
|
193
196
|
cloudRunUrl,
|
|
194
197
|
serviceName: undefined,
|
|
@@ -232,6 +235,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
|
|
|
232
235
|
colorSpace,
|
|
233
236
|
indent: false,
|
|
234
237
|
downloadBehavior: { type: 'play-in-browser' },
|
|
238
|
+
metadata,
|
|
235
239
|
});
|
|
236
240
|
if (res.type === 'crash') {
|
|
237
241
|
(0, cloudrun_crash_logs_1.displayCrashLogs)(res, logLevel);
|
|
@@ -87,6 +87,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
87
87
|
type: "download";
|
|
88
88
|
fileName: string | null;
|
|
89
89
|
}>]>;
|
|
90
|
+
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
90
91
|
}, "strip", z.ZodTypeAny, {
|
|
91
92
|
type: "media";
|
|
92
93
|
serveUrl: string;
|
|
@@ -111,7 +112,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
111
112
|
envVariables: Record<string, string>;
|
|
112
113
|
muted: boolean;
|
|
113
114
|
outputBucket: string;
|
|
114
|
-
logLevel: "
|
|
115
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
115
116
|
delayRenderTimeoutInMilliseconds: number | null;
|
|
116
117
|
concurrency: string | number | null;
|
|
117
118
|
enforceAudioTrack: boolean;
|
|
@@ -136,6 +137,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
136
137
|
} | undefined;
|
|
137
138
|
outName?: string | undefined;
|
|
138
139
|
privacy?: "public" | "private" | undefined;
|
|
140
|
+
metadata?: Record<string, string> | null | undefined;
|
|
139
141
|
}, {
|
|
140
142
|
type: "media";
|
|
141
143
|
serveUrl: string;
|
|
@@ -160,7 +162,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
160
162
|
envVariables: Record<string, string>;
|
|
161
163
|
muted: boolean;
|
|
162
164
|
outputBucket: string;
|
|
163
|
-
logLevel: "
|
|
165
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
164
166
|
delayRenderTimeoutInMilliseconds: number | null;
|
|
165
167
|
concurrency: string | number | null;
|
|
166
168
|
enforceAudioTrack: boolean;
|
|
@@ -185,6 +187,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
185
187
|
} | undefined;
|
|
186
188
|
outName?: string | undefined;
|
|
187
189
|
privacy?: "public" | "private" | undefined;
|
|
190
|
+
metadata?: Record<string, string> | null | undefined;
|
|
188
191
|
}>, z.ZodObject<{
|
|
189
192
|
type: z.ZodLiteral<"still">;
|
|
190
193
|
serveUrl: z.ZodString;
|
|
@@ -239,6 +242,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
239
242
|
type: "download";
|
|
240
243
|
fileName: string | null;
|
|
241
244
|
}>]>;
|
|
245
|
+
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
242
246
|
}, "strip", z.ZodTypeAny, {
|
|
243
247
|
type: "still";
|
|
244
248
|
serveUrl: string;
|
|
@@ -250,7 +254,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
250
254
|
outputBucket: string;
|
|
251
255
|
outName: string | null;
|
|
252
256
|
privacy: "public" | "private";
|
|
253
|
-
logLevel: "
|
|
257
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
254
258
|
delayRenderTimeoutInMilliseconds: number;
|
|
255
259
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
256
260
|
clientVersion: string;
|
|
@@ -271,6 +275,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
271
275
|
headless?: boolean | undefined;
|
|
272
276
|
userAgent?: string | null | undefined;
|
|
273
277
|
} | undefined;
|
|
278
|
+
metadata?: Record<string, string> | null | undefined;
|
|
274
279
|
}, {
|
|
275
280
|
type: "still";
|
|
276
281
|
serveUrl: string;
|
|
@@ -282,7 +287,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
282
287
|
outputBucket: string;
|
|
283
288
|
outName: string | null;
|
|
284
289
|
privacy: "public" | "private";
|
|
285
|
-
logLevel: "
|
|
290
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
286
291
|
delayRenderTimeoutInMilliseconds: number;
|
|
287
292
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
288
293
|
clientVersion: string;
|
|
@@ -303,6 +308,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
303
308
|
headless?: boolean | undefined;
|
|
304
309
|
userAgent?: string | null | undefined;
|
|
305
310
|
} | undefined;
|
|
311
|
+
metadata?: Record<string, string> | null | undefined;
|
|
306
312
|
}>]>;
|
|
307
313
|
declare const renderFailResponsePayload: z.ZodObject<{
|
|
308
314
|
type: z.ZodLiteral<"error">;
|
|
@@ -310,14 +316,14 @@ declare const renderFailResponsePayload: z.ZodObject<{
|
|
|
310
316
|
name: z.ZodString;
|
|
311
317
|
stack: z.ZodString;
|
|
312
318
|
}, "strip", z.ZodTypeAny, {
|
|
313
|
-
name: string;
|
|
314
|
-
message: string;
|
|
315
319
|
type: "error";
|
|
320
|
+
message: string;
|
|
321
|
+
name: string;
|
|
316
322
|
stack: string;
|
|
317
323
|
}, {
|
|
318
|
-
name: string;
|
|
319
|
-
message: string;
|
|
320
324
|
type: "error";
|
|
325
|
+
message: string;
|
|
326
|
+
name: string;
|
|
321
327
|
stack: string;
|
|
322
328
|
}>;
|
|
323
329
|
declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
|
|
@@ -329,19 +335,19 @@ declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
|
|
|
329
335
|
renderId: z.ZodString;
|
|
330
336
|
privacy: z.ZodEnum<["public-read", "project-private"]>;
|
|
331
337
|
}, "strip", z.ZodTypeAny, {
|
|
332
|
-
bucketName: string;
|
|
333
338
|
type: "success";
|
|
334
339
|
privacy: "public-read" | "project-private";
|
|
335
340
|
cloudStorageUri: string;
|
|
336
341
|
size: number;
|
|
342
|
+
bucketName: string;
|
|
337
343
|
renderId: string;
|
|
338
344
|
publicUrl?: string | null | undefined;
|
|
339
345
|
}, {
|
|
340
|
-
bucketName: string;
|
|
341
346
|
type: "success";
|
|
342
347
|
privacy: "public-read" | "project-private";
|
|
343
348
|
cloudStorageUri: string;
|
|
344
349
|
size: number;
|
|
350
|
+
bucketName: string;
|
|
345
351
|
renderId: string;
|
|
346
352
|
publicUrl?: string | null | undefined;
|
|
347
353
|
}>;
|
|
@@ -354,19 +360,19 @@ declare const renderMediaOnCloudrunResponsePayload: z.ZodObject<{
|
|
|
354
360
|
renderId: z.ZodString;
|
|
355
361
|
privacy: z.ZodEnum<["public-read", "project-private"]>;
|
|
356
362
|
}, "strip", z.ZodTypeAny, {
|
|
357
|
-
bucketName: string;
|
|
358
363
|
type: "success";
|
|
359
364
|
privacy: "public-read" | "project-private";
|
|
360
365
|
cloudStorageUri: string;
|
|
361
366
|
size: number;
|
|
367
|
+
bucketName: string;
|
|
362
368
|
renderId: string;
|
|
363
369
|
publicUrl?: string | null | undefined;
|
|
364
370
|
}, {
|
|
365
|
-
bucketName: string;
|
|
366
371
|
type: "success";
|
|
367
372
|
privacy: "public-read" | "project-private";
|
|
368
373
|
cloudStorageUri: string;
|
|
369
374
|
size: number;
|
|
375
|
+
bucketName: string;
|
|
370
376
|
renderId: string;
|
|
371
377
|
publicUrl?: string | null | undefined;
|
|
372
378
|
}>;
|
|
@@ -378,15 +384,15 @@ declare const cloudRunCrashResponse: z.ZodObject<{
|
|
|
378
384
|
requestCrashTime: z.ZodString;
|
|
379
385
|
requestElapsedTimeInSeconds: z.ZodNumber;
|
|
380
386
|
}, "strip", z.ZodTypeAny, {
|
|
381
|
-
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
382
387
|
type: "crash";
|
|
388
|
+
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
383
389
|
cloudRunEndpoint: string;
|
|
384
390
|
requestStartTime: string;
|
|
385
391
|
requestCrashTime: string;
|
|
386
392
|
requestElapsedTimeInSeconds: number;
|
|
387
393
|
}, {
|
|
388
|
-
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
389
394
|
type: "crash";
|
|
395
|
+
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
390
396
|
cloudRunEndpoint: string;
|
|
391
397
|
requestStartTime: string;
|
|
392
398
|
requestCrashTime: string;
|
|
@@ -66,6 +66,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
|
|
|
66
66
|
colorSpace: zod_1.z.enum(client_1.BrowserSafeApis.validColorSpaces).nullable(),
|
|
67
67
|
clientVersion: zod_1.z.string(),
|
|
68
68
|
downloadBehavior,
|
|
69
|
+
metadata: zod_1.z.record(zod_1.z.string()).optional().nullable(),
|
|
69
70
|
}),
|
|
70
71
|
zod_1.z.object({
|
|
71
72
|
type: zod_1.z.literal('still'),
|
|
@@ -88,6 +89,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
|
|
|
88
89
|
offthreadVideoCacheSizeInBytes: zod_1.z.number().nullable(),
|
|
89
90
|
clientVersion: zod_1.z.string(),
|
|
90
91
|
downloadBehavior,
|
|
92
|
+
metadata: zod_1.z.record(zod_1.z.string()).optional().nullable(),
|
|
91
93
|
}),
|
|
92
94
|
]);
|
|
93
95
|
const renderFailResponsePayload = zod_1.z.object({
|
|
@@ -10,7 +10,7 @@ const get_composition_from_body_1 = require("./helpers/get-composition-from-body
|
|
|
10
10
|
const get_download_behavior_setting_1 = require("./helpers/get-download-behavior-setting");
|
|
11
11
|
const write_cloudrun_error_1 = require("./helpers/write-cloudrun-error");
|
|
12
12
|
const renderMediaSingleThread = async (body, res) => {
|
|
13
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
13
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
14
14
|
if (body.type !== 'media') {
|
|
15
15
|
throw new Error('expected type media');
|
|
16
16
|
}
|
|
@@ -113,13 +113,14 @@ const renderMediaSingleThread = async (body, res) => {
|
|
|
113
113
|
throw new Error('Should not download a browser in Cloud Run');
|
|
114
114
|
},
|
|
115
115
|
onArtifact,
|
|
116
|
+
metadata: (_m = body.metadata) !== null && _m !== void 0 ? _m : null,
|
|
116
117
|
});
|
|
117
118
|
const storage = new storage_1.Storage();
|
|
118
119
|
const publicUpload = body.privacy === 'public' || !body.privacy;
|
|
119
120
|
const uploadedResponse = await storage
|
|
120
121
|
.bucket(body.outputBucket)
|
|
121
122
|
.upload(tempFilePath, {
|
|
122
|
-
destination: `renders/${renderId}/${(
|
|
123
|
+
destination: `renders/${renderId}/${(_o = body.outName) !== null && _o !== void 0 ? _o : defaultOutName}`,
|
|
123
124
|
predefinedAcl: publicUpload ? 'publicRead' : 'projectPrivate',
|
|
124
125
|
metadata: (0, get_download_behavior_setting_1.getDownloadBehaviorSetting)(body.downloadBehavior),
|
|
125
126
|
});
|
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, }: 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, }: 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;
|
|
30
24
|
type: "success";
|
|
31
25
|
privacy: "public-read" | "project-private";
|
|
32
26
|
cloudStorageUri: string;
|
|
33
27
|
size: number;
|
|
28
|
+
bucketName: string;
|
|
34
29
|
renderId: string;
|
|
35
30
|
publicUrl?: string | null | undefined;
|
|
36
31
|
} | {
|
|
37
|
-
|
|
32
|
+
type: "error";
|
|
33
|
+
message: string;
|
|
34
|
+
name: string;
|
|
35
|
+
stack: string;
|
|
36
|
+
} | {
|
|
38
37
|
type: "crash";
|
|
38
|
+
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
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.
|
|
6
|
+
"version": "4.0.216",
|
|
7
7
|
"description": "Render Remotion videos on Google Cloud Run",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"@google-cloud/logging": "^11.1.0",
|
|
17
17
|
"google-auth-library": "^8.7.0",
|
|
18
18
|
"zod": "3.22.3",
|
|
19
|
-
"@remotion/bundler": "4.0.
|
|
20
|
-
"
|
|
21
|
-
"@remotion/renderer": "4.0.
|
|
22
|
-
"remotion": "4.0.
|
|
19
|
+
"@remotion/bundler": "4.0.216",
|
|
20
|
+
"remotion": "4.0.216",
|
|
21
|
+
"@remotion/renderer": "4.0.216",
|
|
22
|
+
"@remotion/cli": "4.0.216"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/minimist": "1.2.2",
|
|
26
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
26
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.216"
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
"./package.json": "./package.json",
|