@remotion/cloudrun 4.0.18 → 4.0.19

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,13 +1,13 @@
1
1
 
2
- > @remotion/cloudrun@4.0.17 build /Users/jonathanburger/remotion-v4/packages/cloudrun
2
+ > @remotion/cloudrun@4.0.18 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.17 buildContainer /Users/jonathanburger/remotion-v4/packages/cloudrun
6
+ > @remotion/cloudrun@4.0.18 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.17 tarInstaller /Users/jonathanburger/remotion-v4/packages/cloudrun
11
+ > @remotion/cloudrun@4.0.18 tarInstaller /Users/jonathanburger/remotion/packages/cloudrun
12
12
  > ts-node src/admin/bundle-installer.ts
13
13
 
@@ -49,8 +49,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
49
49
  enforceAudioTrack: z.ZodBoolean;
50
50
  preferLossless: z.ZodBoolean;
51
51
  }, "strip", z.ZodTypeAny, {
52
- type: "media";
53
52
  serveUrl: string;
53
+ type: "media";
54
54
  composition: string;
55
55
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
56
56
  serializedInputPropsWithCustomSchema: string;
@@ -86,8 +86,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
86
86
  outName?: string | undefined;
87
87
  privacy?: "public" | "private" | undefined;
88
88
  }, {
89
- type: "media";
90
89
  serveUrl: string;
90
+ type: "media";
91
91
  composition: string;
92
92
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
93
93
  serializedInputPropsWithCustomSchema: string;
@@ -159,8 +159,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
159
159
  delayRenderTimeoutInMilliseconds: z.ZodNumber;
160
160
  logLevel: z.ZodEnum<["verbose", "info", "warn", "error"]>;
161
161
  }, "strip", z.ZodTypeAny, {
162
- type: "still";
163
162
  serveUrl: string;
163
+ type: "still";
164
164
  composition: string;
165
165
  serializedInputPropsWithCustomSchema: string;
166
166
  imageFormat: "png" | "jpeg" | "pdf" | "webp";
@@ -183,8 +183,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
183
183
  } | undefined;
184
184
  outName?: string | undefined;
185
185
  }, {
186
- type: "still";
187
186
  serveUrl: string;
187
+ type: "still";
188
188
  composition: string;
189
189
  serializedInputPropsWithCustomSchema: string;
190
190
  imageFormat: "png" | "jpeg" | "pdf" | "webp";
@@ -212,12 +212,12 @@ declare const renderFailResponsePayload: z.ZodObject<{
212
212
  error: z.ZodString;
213
213
  stack: z.ZodString;
214
214
  }, "strip", z.ZodTypeAny, {
215
- status: "error";
216
215
  error: string;
216
+ status: "error";
217
217
  stack: string;
218
218
  }, {
219
- status: "error";
220
219
  error: string;
220
+ status: "error";
221
221
  stack: string;
222
222
  }>;
223
223
  declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
@@ -229,19 +229,19 @@ declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
229
229
  renderId: z.ZodString;
230
230
  privacy: z.ZodEnum<["public-read", "project-private"]>;
231
231
  }, "strip", z.ZodTypeAny, {
232
+ bucketName: string;
233
+ size: number;
232
234
  status: "success";
233
235
  privacy: "public-read" | "project-private";
234
236
  cloudStorageUri: string;
235
- size: number;
236
- bucketName: string;
237
237
  renderId: string;
238
238
  publicUrl?: string | null | undefined;
239
239
  }, {
240
+ bucketName: string;
241
+ size: number;
240
242
  status: "success";
241
243
  privacy: "public-read" | "project-private";
242
244
  cloudStorageUri: string;
243
- size: number;
244
- bucketName: string;
245
245
  renderId: string;
246
246
  publicUrl?: string | null | undefined;
247
247
  }>;
@@ -254,19 +254,19 @@ declare const renderMediaOnCloudrunResponsePayload: z.ZodObject<{
254
254
  renderId: z.ZodString;
255
255
  privacy: z.ZodEnum<["public-read", "project-private"]>;
256
256
  }, "strip", z.ZodTypeAny, {
257
+ bucketName: string;
258
+ size: number;
257
259
  status: "success";
258
260
  privacy: "public-read" | "project-private";
259
261
  cloudStorageUri: string;
260
- size: number;
261
- bucketName: string;
262
262
  renderId: string;
263
263
  publicUrl?: string | null | undefined;
264
264
  }, {
265
+ bucketName: string;
266
+ size: number;
265
267
  status: "success";
266
268
  privacy: "public-read" | "project-private";
267
269
  cloudStorageUri: string;
268
- size: number;
269
- bucketName: string;
270
270
  renderId: string;
271
271
  publicUrl?: string | null | undefined;
272
272
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cloudrun",
3
- "version": "4.0.18",
3
+ "version": "4.0.19",
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/bundler": "4.0.18",
16
- "@remotion/cli": "4.0.18",
17
- "@remotion/renderer": "4.0.18",
18
- "remotion": "4.0.18"
15
+ "@remotion/bundler": "4.0.19",
16
+ "@remotion/cli": "4.0.19",
17
+ "@remotion/renderer": "4.0.19",
18
+ "remotion": "4.0.19"
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.18"
29
+ "@remotion/compositor-linux-x64-gnu": "4.0.19"
30
30
  },
31
31
  "exports": {
32
32
  "./package.json": "./package.json",
@@ -1,2 +0,0 @@
1
- export declare const RENDER_MEDIA_SUBCOMMAND = "media";
2
- export declare const renderMediaSubcommand: (args: string[], remotionRoot: string) => Promise<void>;
@@ -1,156 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderMediaSubcommand = exports.RENDER_MEDIA_SUBCOMMAND = void 0;
4
- const cli_1 = require("@remotion/cli");
5
- const render_media_on_cloudrun_1 = require("../../../api/render-media-on-cloudrun");
6
- // import {validateMaxRetries} from '../../../shared/validate-retries';
7
- const config_1 = require("@remotion/cli/config");
8
- const renderer_1 = require("@remotion/renderer");
9
- const download_file_1 = require("../../../api/download-file");
10
- const validate_serveurl_1 = require("../../../shared/validate-serveurl");
11
- const args_1 = require("../../args");
12
- const log_1 = require("../../log");
13
- const renderArgsCheck_1 = require("./helpers/renderArgsCheck");
14
- exports.RENDER_MEDIA_SUBCOMMAND = 'media';
15
- const renderMediaSubcommand = async (args, remotionRoot) => {
16
- var _a;
17
- const { serveUrl, cloudRunUrl, outName, forceBucketName, downloadName, privacy, region, } = await (0, renderArgsCheck_1.renderArgsCheck)(exports.RENDER_MEDIA_SUBCOMMAND, args);
18
- const { codec, reason: codecReason } = cli_1.CliInternals.getFinalOutputCodec({
19
- cliFlag: cli_1.CliInternals.parsedCli.codec,
20
- downloadName,
21
- outName: outName !== null && outName !== void 0 ? outName : null,
22
- configFile: (_a = config_1.ConfigInternals.getOutputCodecOrUndefined()) !== null && _a !== void 0 ? _a : null,
23
- uiCodec: null,
24
- });
25
- const imageFormat = args_1.parsedCloudrunCli['image-format'];
26
- const audioCodec = args_1.parsedCloudrunCli['audio-codec'];
27
- const { chromiumOptions, crf, envVariables, frameRange, inputProps, logLevel, puppeteerTimeout, pixelFormat, proResProfile, jpegQuality, scale, everyNthFrame, numberOfGifLoops, muted, audioBitrate, videoBitrate, height, width, browserExecutable, port, } = await cli_1.CliInternals.getCliOptions({
28
- type: 'series',
29
- isLambda: true,
30
- remotionRoot,
31
- });
32
- let composition = args[1];
33
- if (!composition) {
34
- log_1.Log.info('No compositions passed. Fetching compositions...');
35
- (0, validate_serveurl_1.validateServeUrl)(serveUrl);
36
- const server = renderer_1.RenderInternals.prepareServer({
37
- concurrency: 1,
38
- indent: false,
39
- port,
40
- remotionRoot,
41
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
42
- webpackConfigOrServeUrl: serveUrl,
43
- });
44
- const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
45
- args,
46
- compositionIdFromUi: null,
47
- browserExecutable,
48
- chromiumOptions,
49
- envVariables,
50
- height,
51
- indent: false,
52
- inputProps,
53
- port,
54
- puppeteerInstance: undefined,
55
- serveUrlOrWebpackUrl: serveUrl,
56
- timeoutInMilliseconds: puppeteerTimeout,
57
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
58
- width,
59
- server: await server,
60
- });
61
- composition = compositionId;
62
- }
63
- // Todo: Check cloudRunUrl is valid, as the error message is obtuse
64
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray(`
65
- Cloud Run Service URL = ${cloudRunUrl}
66
- Region = ${region}
67
- Type = media
68
- Composition = ${composition}
69
- Codec = ${codec}
70
- Output Bucket = ${forceBucketName}
71
- Output File = ${outName !== null && outName !== void 0 ? outName : 'out.mp4'}
72
- Output File Privacy = ${privacy}
73
- ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
74
- `.trim()));
75
- log_1.Log.info();
76
- const renderStart = Date.now();
77
- const progressBar = cli_1.CliInternals.createOverwriteableCliOutput({
78
- quiet: cli_1.CliInternals.quietFlagProvided(),
79
- cancelSignal: null,
80
- updatesDontOverwrite: false,
81
- indent: false,
82
- });
83
- const renderProgress = {
84
- doneIn: null,
85
- progress: 0,
86
- };
87
- const updateProgress = () => {
88
- progressBar.update([
89
- `Rendering on Cloud Run: `,
90
- cli_1.CliInternals.makeProgressBar(renderProgress.progress),
91
- `${renderProgress.doneIn === null ? 'Rendering' : 'Rendered'}`,
92
- renderProgress.doneIn === null
93
- ? `${Math.round(renderProgress.progress * 100)}%`
94
- : cli_1.CliInternals.chalk.gray(`${renderProgress.doneIn}ms`),
95
- ].join(' '), false);
96
- };
97
- const updateRenderProgress = (progress) => {
98
- renderProgress.progress = progress;
99
- updateProgress();
100
- };
101
- const res = await (0, render_media_on_cloudrun_1.renderMediaOnCloudrun)({
102
- cloudRunUrl,
103
- serveUrl,
104
- region,
105
- inputProps,
106
- codec: codec,
107
- imageFormat,
108
- crf: crf !== null && crf !== void 0 ? crf : undefined,
109
- envVariables,
110
- pixelFormat,
111
- proResProfile,
112
- jpegQuality,
113
- composition,
114
- privacy,
115
- frameRange: frameRange !== null && frameRange !== void 0 ? frameRange : undefined,
116
- outName,
117
- chromiumOptions,
118
- scale,
119
- numberOfGifLoops,
120
- everyNthFrame,
121
- muted,
122
- audioBitrate,
123
- videoBitrate,
124
- forceHeight: height,
125
- forceWidth: width,
126
- audioCodec,
127
- forceBucketName,
128
- updateRenderProgress,
129
- logLevel: config_1.ConfigInternals.Logging.getLogLevel(),
130
- });
131
- renderProgress.doneIn = Date.now() - renderStart;
132
- updateProgress();
133
- log_1.Log.info(`
134
-
135
- `);
136
- log_1.Log.info(cli_1.CliInternals.chalk.blueBright(`
137
- ${res.publicUrl ? `Public URL = ${decodeURIComponent(res.publicUrl)}` : ``}
138
- Cloud Storage Uri = ${res.cloudStorageUri}
139
- Size (KB) = ${Math.round(Number(res.size) / 1000)}
140
- Bucket Name = ${res.bucketName}
141
- Privacy = ${res.privacy}
142
- Render ID = ${res.renderId}
143
- Codec = ${codec} (${codecReason})
144
- `.trim()));
145
- if (downloadName) {
146
- log_1.Log.info('');
147
- log_1.Log.info('downloading file...');
148
- const destination = await (0, download_file_1.downloadFile)({
149
- bucketName: res.bucketName,
150
- gsutilURI: res.cloudStorageUri,
151
- downloadName,
152
- });
153
- log_1.Log.info(cli_1.CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`));
154
- }
155
- };
156
- exports.renderMediaSubcommand = renderMediaSubcommand;
@@ -1,2 +0,0 @@
1
- export declare const RENDER_STILL_SUBCOMMAND = "still";
2
- export declare const renderStillSubcommand: (args: string[], remotionRoot: string) => Promise<void>;
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderStillSubcommand = exports.RENDER_STILL_SUBCOMMAND = void 0;
4
- const cli_1 = require("@remotion/cli");
5
- const config_1 = require("@remotion/cli/config");
6
- const renderer_1 = require("@remotion/renderer");
7
- const download_file_1 = require("../../../api/download-file");
8
- const render_still_on_cloudrun_1 = require("../../../api/render-still-on-cloudrun");
9
- const validate_serveurl_1 = require("../../../shared/validate-serveurl");
10
- const log_1 = require("../../log");
11
- const renderArgsCheck_1 = require("./helpers/renderArgsCheck");
12
- exports.RENDER_STILL_SUBCOMMAND = 'still';
13
- const renderStillSubcommand = async (args, remotionRoot) => {
14
- var _a, _b;
15
- const { serveUrl, cloudRunUrl, outName, forceBucketName, privacy, downloadName, region, } = await (0, renderArgsCheck_1.renderArgsCheck)(exports.RENDER_STILL_SUBCOMMAND, args);
16
- const { chromiumOptions, envVariables, inputProps, logLevel, puppeteerTimeout, jpegQuality, stillFrame, scale, height, width, browserExecutable, port, } = await cli_1.CliInternals.getCliOptions({
17
- type: 'still',
18
- isLambda: true,
19
- remotionRoot,
20
- });
21
- let composition = args[1];
22
- if (!composition) {
23
- log_1.Log.info('No compositions passed. Fetching compositions...');
24
- (0, validate_serveurl_1.validateServeUrl)(serveUrl);
25
- const server = renderer_1.RenderInternals.prepareServer({
26
- concurrency: 1,
27
- indent: false,
28
- port,
29
- remotionRoot,
30
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
31
- webpackConfigOrServeUrl: serveUrl,
32
- });
33
- const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
34
- args,
35
- compositionIdFromUi: null,
36
- indent: false,
37
- serveUrlOrWebpackUrl: serveUrl,
38
- verbose: renderer_1.RenderInternals.isEqualOrBelowLogLevel(logLevel, 'verbose'),
39
- browserExecutable,
40
- chromiumOptions,
41
- envVariables,
42
- inputProps,
43
- port,
44
- puppeteerInstance: undefined,
45
- timeoutInMilliseconds: puppeteerTimeout,
46
- height,
47
- width,
48
- server: await server,
49
- });
50
- composition = compositionId;
51
- }
52
- const { format: imageFormat, source: imageFormatReason } = cli_1.CliInternals.determineFinalStillImageFormat({
53
- downloadName,
54
- outName: outName !== null && outName !== void 0 ? outName : null,
55
- cliFlag: (_a = cli_1.CliInternals.parsedCli['image-format']) !== null && _a !== void 0 ? _a : null,
56
- isLambda: true,
57
- fromUi: null,
58
- configImageFormat: (_b = config_1.ConfigInternals.getUserPreferredStillImageFormat()) !== null && _b !== void 0 ? _b : null,
59
- });
60
- log_1.Log.verbose(`Image format: (${imageFormat}), ${imageFormatReason}`);
61
- // Todo: Check cloudRunUrl is valid, as the error message is obtuse
62
- cli_1.CliInternals.Log.info(cli_1.CliInternals.chalk.gray(`
63
- Cloud Run Service URL = ${cloudRunUrl}
64
- Region = ${region}
65
- Type = still
66
- Composition = ${composition}
67
- Output Bucket = ${forceBucketName}
68
- Output File = ${outName !== null && outName !== void 0 ? outName : 'out.png'}
69
- Output File Privacy = ${privacy}
70
- ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
71
- `.trim()));
72
- log_1.Log.info();
73
- const renderStart = Date.now();
74
- const progressBar = cli_1.CliInternals.createOverwriteableCliOutput({
75
- quiet: cli_1.CliInternals.quietFlagProvided(),
76
- cancelSignal: null,
77
- updatesDontOverwrite: false,
78
- indent: false,
79
- });
80
- let doneIn = null;
81
- const updateProgress = (newline) => {
82
- progressBar.update([
83
- `Rendering on Cloud Run:`,
84
- `${doneIn === null ? '...' : `Rendered in ${doneIn}ms`}`,
85
- ].join(' '), newline);
86
- };
87
- const res = await (0, render_still_on_cloudrun_1.renderStillOnCloudrun)({
88
- cloudRunUrl,
89
- serveUrl,
90
- region,
91
- inputProps,
92
- imageFormat,
93
- composition,
94
- privacy,
95
- envVariables,
96
- frame: stillFrame,
97
- jpegQuality,
98
- chromiumOptions,
99
- scale,
100
- forceHeight: height,
101
- forceWidth: width,
102
- forceBucketName,
103
- outName,
104
- logLevel: config_1.ConfigInternals.Logging.getLogLevel(),
105
- });
106
- doneIn = Date.now() - renderStart;
107
- updateProgress(true);
108
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`Cloud Storage Uri = ${res.cloudStorageUri}`));
109
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`Render ID = ${res.renderId}`));
110
- log_1.Log.info(cli_1.CliInternals.chalk.gray(`${Math.round(Number(res.size) / 1000)} KB, Privacy: ${res.privacy}, Bucket: ${res.bucketName}`));
111
- log_1.Log.info(cli_1.CliInternals.chalk.blue(`○ ${res.publicUrl}`));
112
- if (downloadName) {
113
- log_1.Log.info('');
114
- log_1.Log.info('downloading file...');
115
- const destination = await (0, download_file_1.downloadFile)({
116
- bucketName: res.bucketName,
117
- gsutilURI: res.cloudStorageUri,
118
- downloadName,
119
- });
120
- log_1.Log.info(cli_1.CliInternals.chalk.blueBright(`Downloaded file to ${destination}!`));
121
- }
122
- };
123
- exports.renderStillSubcommand = renderStillSubcommand;