@remotion/cloudrun 4.0.26 → 4.0.28
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 +3 -3
- package/dist/api/render-media-on-cloudrun.d.ts +3 -2
- package/dist/api/render-media-on-cloudrun.js +2 -1
- package/dist/functions/helpers/payloads.d.ts +19 -16
- package/dist/functions/helpers/payloads.js +1 -0
- package/dist/functions/render-media-single-thread.js +1 -0
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @remotion/cloudrun@4.0.
|
|
2
|
+
> @remotion/cloudrun@4.0.27 build /Users/jonathanburger/remotion/packages/cloudrun
|
|
3
3
|
> tsc -d && cp src/shared/sa-permissions.json dist/shared/sa-permissions.json && pnpm run buildContainer && pnpm run tarInstaller
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @remotion/cloudrun@4.0.
|
|
6
|
+
> @remotion/cloudrun@4.0.27 buildContainer /Users/jonathanburger/remotion/packages/cloudrun
|
|
7
7
|
> ts-node src/admin/bundle-renderLogic.ts
|
|
8
8
|
|
|
9
9
|
distribution bundled.
|
|
10
10
|
|
|
11
|
-
> @remotion/cloudrun@4.0.
|
|
11
|
+
> @remotion/cloudrun@4.0.27 tarInstaller /Users/jonathanburger/remotion/packages/cloudrun
|
|
12
12
|
> ts-node src/admin/bundle-installer.ts
|
|
13
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AudioCodec, ChromiumOptions, FrameRange, LogLevel, PixelFormat, ProResProfile, ToOptions, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
1
|
+
import type { AudioCodec, ChromiumOptions, ColorSpace, FrameRange, LogLevel, PixelFormat, ProResProfile, ToOptions, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
2
|
import type { BrowserSafeApis } from '@remotion/renderer/client';
|
|
3
3
|
import type { CloudRunCrashResponse, RenderMediaOnCloudrunOutput } from '../functions/helpers/payloads';
|
|
4
4
|
import type { GcpRegion } from '../pricing/gcp-regions';
|
|
@@ -38,6 +38,7 @@ export type RenderMediaOnCloudrunInput = {
|
|
|
38
38
|
concurrency?: number | string | null;
|
|
39
39
|
enforceAudioTrack?: boolean;
|
|
40
40
|
preferLossless?: boolean;
|
|
41
|
+
colorSpace?: ColorSpace;
|
|
41
42
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
|
|
42
43
|
/**
|
|
43
44
|
* @description Triggers a render on a GCP Cloud Run service given a composition and a Cloud Run URL.
|
|
@@ -78,4 +79,4 @@ export type RenderMediaOnCloudrunInput = {
|
|
|
78
79
|
* @param params.preferLossless Uses a lossless audio codec, if one is available for the codec. If you set audioCodec, it takes priority over preferLossless.
|
|
79
80
|
* @returns {Promise<RenderMediaOnCloudrunOutput>} See documentation for detailed structure
|
|
80
81
|
*/
|
|
81
|
-
export declare const renderMediaOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
|
|
82
|
+
export declare const renderMediaOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, }: RenderMediaOnCloudrunInput) => Promise<RenderMediaOnCloudrunOutput | CloudRunCrashResponse>;
|
|
@@ -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 renderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, }) => {
|
|
13
|
+
const renderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, codec, forceBucketName, privacy, outName, updateRenderProgress, jpegQuality, audioCodec, audioBitrate, videoBitrate, proResProfile, x264Preset, crf, pixelFormat, imageFormat, scale, everyNthFrame, numberOfGifLoops, frameRange, envVariables, chromiumOptions, muted, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, concurrency, enforceAudioTrack, preferLossless, offthreadVideoCacheSizeInBytes, colorSpace, }) => {
|
|
14
14
|
const actualCodec = (0, validate_gcp_codec_1.validateCloudrunCodec)(codec);
|
|
15
15
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
16
16
|
if (privacy)
|
|
@@ -58,6 +58,7 @@ const renderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, region, serv
|
|
|
58
58
|
enforceAudioTrack: enforceAudioTrack !== null && enforceAudioTrack !== void 0 ? enforceAudioTrack : false,
|
|
59
59
|
preferLossless: preferLossless !== null && preferLossless !== void 0 ? preferLossless : false,
|
|
60
60
|
offthreadVideoCacheSizeInBytes: offthreadVideoCacheSizeInBytes !== null && offthreadVideoCacheSizeInBytes !== void 0 ? offthreadVideoCacheSizeInBytes : null,
|
|
61
|
+
colorSpace: colorSpace !== null && colorSpace !== void 0 ? colorSpace : 'default',
|
|
61
62
|
};
|
|
62
63
|
const client = await (0, get_auth_client_for_url_1.getAuthClientForUrl)(cloudRunEndpoint);
|
|
63
64
|
const postResponse = await client.request({
|
|
@@ -50,9 +50,10 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
50
50
|
enforceAudioTrack: z.ZodBoolean;
|
|
51
51
|
preferLossless: z.ZodBoolean;
|
|
52
52
|
offthreadVideoCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
|
|
53
|
+
colorSpace: z.ZodEnum<["default", "bt709"]>;
|
|
53
54
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
serveUrl: string;
|
|
55
55
|
type: "media";
|
|
56
|
+
serveUrl: string;
|
|
56
57
|
composition: string;
|
|
57
58
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
58
59
|
serializedInputPropsWithCustomSchema: string;
|
|
@@ -78,6 +79,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
78
79
|
enforceAudioTrack: boolean;
|
|
79
80
|
preferLossless: boolean;
|
|
80
81
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
82
|
+
colorSpace: "default" | "bt709";
|
|
81
83
|
forceHeight?: number | null | undefined;
|
|
82
84
|
forceWidth?: number | null | undefined;
|
|
83
85
|
chromiumOptions?: {
|
|
@@ -90,8 +92,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
90
92
|
outName?: string | undefined;
|
|
91
93
|
privacy?: "public" | "private" | undefined;
|
|
92
94
|
}, {
|
|
93
|
-
serveUrl: string;
|
|
94
95
|
type: "media";
|
|
96
|
+
serveUrl: string;
|
|
95
97
|
composition: string;
|
|
96
98
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
97
99
|
serializedInputPropsWithCustomSchema: string;
|
|
@@ -117,6 +119,7 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
117
119
|
enforceAudioTrack: boolean;
|
|
118
120
|
preferLossless: boolean;
|
|
119
121
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
122
|
+
colorSpace: "default" | "bt709";
|
|
120
123
|
forceHeight?: number | null | undefined;
|
|
121
124
|
forceWidth?: number | null | undefined;
|
|
122
125
|
chromiumOptions?: {
|
|
@@ -166,8 +169,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
166
169
|
logLevel: z.ZodEnum<["verbose", "info", "warn", "error"]>;
|
|
167
170
|
offthreadVideoCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
|
|
168
171
|
}, "strip", z.ZodTypeAny, {
|
|
169
|
-
serveUrl: string;
|
|
170
172
|
type: "still";
|
|
173
|
+
serveUrl: string;
|
|
171
174
|
composition: string;
|
|
172
175
|
serializedInputPropsWithCustomSchema: string;
|
|
173
176
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
@@ -191,8 +194,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
191
194
|
} | undefined;
|
|
192
195
|
outName?: string | undefined;
|
|
193
196
|
}, {
|
|
194
|
-
serveUrl: string;
|
|
195
197
|
type: "still";
|
|
198
|
+
serveUrl: string;
|
|
196
199
|
composition: string;
|
|
197
200
|
serializedInputPropsWithCustomSchema: string;
|
|
198
201
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
@@ -222,13 +225,13 @@ declare const renderFailResponsePayload: z.ZodObject<{
|
|
|
222
225
|
name: z.ZodString;
|
|
223
226
|
stack: z.ZodString;
|
|
224
227
|
}, "strip", z.ZodTypeAny, {
|
|
225
|
-
message: string;
|
|
226
228
|
type: "error";
|
|
229
|
+
message: string;
|
|
227
230
|
name: string;
|
|
228
231
|
stack: string;
|
|
229
232
|
}, {
|
|
230
|
-
message: string;
|
|
231
233
|
type: "error";
|
|
234
|
+
message: string;
|
|
232
235
|
name: string;
|
|
233
236
|
stack: string;
|
|
234
237
|
}>;
|
|
@@ -241,19 +244,19 @@ declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
|
|
|
241
244
|
renderId: z.ZodString;
|
|
242
245
|
privacy: z.ZodEnum<["public-read", "project-private"]>;
|
|
243
246
|
}, "strip", z.ZodTypeAny, {
|
|
244
|
-
bucketName: string;
|
|
245
|
-
size: number;
|
|
246
247
|
type: "success";
|
|
247
248
|
privacy: "public-read" | "project-private";
|
|
248
249
|
cloudStorageUri: string;
|
|
250
|
+
size: number;
|
|
251
|
+
bucketName: string;
|
|
249
252
|
renderId: string;
|
|
250
253
|
publicUrl?: string | null | undefined;
|
|
251
254
|
}, {
|
|
252
|
-
bucketName: string;
|
|
253
|
-
size: number;
|
|
254
255
|
type: "success";
|
|
255
256
|
privacy: "public-read" | "project-private";
|
|
256
257
|
cloudStorageUri: string;
|
|
258
|
+
size: number;
|
|
259
|
+
bucketName: string;
|
|
257
260
|
renderId: string;
|
|
258
261
|
publicUrl?: string | null | undefined;
|
|
259
262
|
}>;
|
|
@@ -266,19 +269,19 @@ declare const renderMediaOnCloudrunResponsePayload: z.ZodObject<{
|
|
|
266
269
|
renderId: z.ZodString;
|
|
267
270
|
privacy: z.ZodEnum<["public-read", "project-private"]>;
|
|
268
271
|
}, "strip", z.ZodTypeAny, {
|
|
269
|
-
bucketName: string;
|
|
270
|
-
size: number;
|
|
271
272
|
type: "success";
|
|
272
273
|
privacy: "public-read" | "project-private";
|
|
273
274
|
cloudStorageUri: string;
|
|
275
|
+
size: number;
|
|
276
|
+
bucketName: string;
|
|
274
277
|
renderId: string;
|
|
275
278
|
publicUrl?: string | null | undefined;
|
|
276
279
|
}, {
|
|
277
|
-
bucketName: string;
|
|
278
|
-
size: number;
|
|
279
280
|
type: "success";
|
|
280
281
|
privacy: "public-read" | "project-private";
|
|
281
282
|
cloudStorageUri: string;
|
|
283
|
+
size: number;
|
|
284
|
+
bucketName: string;
|
|
282
285
|
renderId: string;
|
|
283
286
|
publicUrl?: string | null | undefined;
|
|
284
287
|
}>;
|
|
@@ -290,15 +293,15 @@ declare const cloudRunCrashResponse: z.ZodObject<{
|
|
|
290
293
|
requestCrashTime: z.ZodString;
|
|
291
294
|
requestElapsedTimeInSeconds: z.ZodNumber;
|
|
292
295
|
}, "strip", z.ZodTypeAny, {
|
|
293
|
-
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
294
296
|
type: "crash";
|
|
297
|
+
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
295
298
|
cloudRunEndpoint: string;
|
|
296
299
|
requestStartTime: string;
|
|
297
300
|
requestCrashTime: string;
|
|
298
301
|
requestElapsedTimeInSeconds: number;
|
|
299
302
|
}, {
|
|
300
|
-
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
301
303
|
type: "crash";
|
|
304
|
+
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
302
305
|
cloudRunEndpoint: string;
|
|
303
306
|
requestStartTime: string;
|
|
304
307
|
requestCrashTime: string;
|
|
@@ -53,6 +53,7 @@ exports.CloudRunPayload = zod_1.z.discriminatedUnion('type', [
|
|
|
53
53
|
enforceAudioTrack: zod_1.z.boolean(),
|
|
54
54
|
preferLossless: zod_1.z.boolean(),
|
|
55
55
|
offthreadVideoCacheSizeInBytes: zod_1.z.number().nullable(),
|
|
56
|
+
colorSpace: zod_1.z.enum(client_1.BrowserSafeApis.validColorSpaces),
|
|
56
57
|
}),
|
|
57
58
|
zod_1.z.object({
|
|
58
59
|
type: zod_1.z.literal('still'),
|
|
@@ -81,6 +81,7 @@ const renderMediaSingleThread = async (body, res) => {
|
|
|
81
81
|
puppeteerInstance: undefined,
|
|
82
82
|
server: undefined,
|
|
83
83
|
offthreadVideoCacheSizeInBytes: body.offthreadVideoCacheSizeInBytes,
|
|
84
|
+
colorSpace: body.colorSpace,
|
|
84
85
|
});
|
|
85
86
|
const storage = new storage_1.Storage();
|
|
86
87
|
const publicUpload = body.privacy === 'public' || !body.privacy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cloudrun",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.28",
|
|
4
4
|
"description": "GCP Cloud Run alternative to lambda rendering",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"@google-cloud/logging": "^10.5.0",
|
|
13
13
|
"google-auth-library": "^8.7.0",
|
|
14
14
|
"zod": "^3.21.4",
|
|
15
|
-
"@remotion/
|
|
16
|
-
"@remotion/
|
|
17
|
-
"@remotion/renderer": "4.0.
|
|
18
|
-
"remotion": "4.0.
|
|
15
|
+
"@remotion/bundler": "4.0.28",
|
|
16
|
+
"@remotion/cli": "4.0.28",
|
|
17
|
+
"@remotion/renderer": "4.0.28",
|
|
18
|
+
"remotion": "4.0.28"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@jonny/eslint-config": "3.0.266",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"prettier-plugin-organize-imports": "^3.2.2",
|
|
27
27
|
"ts-node": "^10.8.0",
|
|
28
28
|
"vitest": "0.24.3",
|
|
29
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
29
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.28"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
"./package.json": "./package.json",
|