@remotion/cloudrun 4.0.19 → 4.0.20

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.18 build /Users/jonathanburger/remotion/packages/cloudrun
2
+ > @remotion/cloudrun@4.0.19 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.18 buildContainer /Users/jonathanburger/remotion/packages/cloudrun
6
+ > @remotion/cloudrun@4.0.19 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.18 tarInstaller /Users/jonathanburger/remotion/packages/cloudrun
11
+ > @remotion/cloudrun@4.0.19 tarInstaller /Users/jonathanburger/remotion/packages/cloudrun
12
12
  > ts-node src/admin/bundle-installer.ts
13
13
 
@@ -9,4 +9,6 @@ export declare const downloadFile: ({ bucketName, gsutilURI, downloadName, }: {
9
9
  bucketName: string;
10
10
  gsutilURI: string;
11
11
  downloadName: string;
12
- }) => Promise<string>;
12
+ }) => Promise<{
13
+ outputPath: string;
14
+ }>;
@@ -4,7 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.downloadFile = void 0;
7
- const fs_1 = __importDefault(require("fs"));
7
+ const renderer_1 = require("@remotion/renderer");
8
+ const node_path_1 = __importDefault(require("node:path"));
8
9
  const get_cloud_storage_client_1 = require("./helpers/get-cloud-storage-client");
9
10
  /**
10
11
  * @description Downloads a file from a GCP storage bucket.
@@ -16,14 +17,11 @@ const get_cloud_storage_client_1 = require("./helpers/get-cloud-storage-client")
16
17
  const downloadFile = async ({ bucketName, gsutilURI, downloadName, }) => {
17
18
  const cloudStorageClient = (0, get_cloud_storage_client_1.getCloudStorageClient)();
18
19
  const fileName = gsutilURI.replace(`gs://${bucketName}/`, '');
19
- // check if out folder exists, if not, create it
20
- if (!fs_1.default.existsSync('out')) {
21
- fs_1.default.mkdirSync('out');
22
- }
23
- const destination = `out/${downloadName}`;
20
+ const outputPath = node_path_1.default.resolve(process.cwd(), downloadName);
21
+ renderer_1.RenderInternals.ensureOutputDirectory(outputPath);
24
22
  await cloudStorageClient.bucket(bucketName).file(fileName).download({
25
- destination,
23
+ destination: outputPath,
26
24
  });
27
- return destination;
25
+ return { outputPath };
28
26
  };
29
27
  exports.downloadFile = downloadFile;
@@ -36,6 +36,9 @@ const renderCommand = async (args, remotionRoot) => {
36
36
  if (!composition) {
37
37
  log_1.Log.info('No compositions passed. Fetching compositions...');
38
38
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
39
+ if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
40
+ throw Error('Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.');
41
+ }
39
42
  const server = renderer_1.RenderInternals.prepareServer({
40
43
  concurrency: 1,
41
44
  indent: false,
@@ -45,7 +48,7 @@ const renderCommand = async (args, remotionRoot) => {
45
48
  webpackConfigOrServeUrl: serveUrl,
46
49
  });
47
50
  const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
48
- args,
51
+ args: args.slice(1),
49
52
  compositionIdFromUi: null,
50
53
  browserExecutable,
51
54
  chromiumOptions,
@@ -215,7 +218,7 @@ Codec = ${codec} (${codecReason})
215
218
  if (downloadName) {
216
219
  log_1.Log.info('');
217
220
  log_1.Log.info('downloading file...');
218
- const destination = await (0, download_file_1.downloadFile)({
221
+ const { outputPath: destination } = await (0, download_file_1.downloadFile)({
219
222
  bucketName: res.bucketName,
220
223
  gsutilURI: res.cloudStorageUri,
221
224
  downloadName,
@@ -23,6 +23,9 @@ const stillCommand = async (args, remotionRoot) => {
23
23
  if (!composition) {
24
24
  log_1.Log.info('No compositions passed. Fetching compositions...');
25
25
  (0, validate_serveurl_1.validateServeUrl)(serveUrl);
26
+ if (!serveUrl.startsWith('https://') && !serveUrl.startsWith('http://')) {
27
+ throw Error('Passing the shorthand serve URL without composition name is currently not supported.\n Make sure to pass a composition name after the shorthand serve URL or pass the complete serveURL without composition name to get to choose between all compositions.');
28
+ }
26
29
  const server = renderer_1.RenderInternals.prepareServer({
27
30
  concurrency: 1,
28
31
  indent: false,
@@ -32,7 +35,7 @@ const stillCommand = async (args, remotionRoot) => {
32
35
  webpackConfigOrServeUrl: serveUrl,
33
36
  });
34
37
  const { compositionId } = await cli_1.CliInternals.getCompositionWithDimensionOverride({
35
- args,
38
+ args: args.slice(1),
36
39
  compositionIdFromUi: null,
37
40
  indent: false,
38
41
  serveUrlOrWebpackUrl: serveUrl,
@@ -118,7 +121,7 @@ ${downloadName ? ` Downloaded File = ${downloadName}` : ''}
118
121
  if (downloadName) {
119
122
  log_1.Log.info('');
120
123
  log_1.Log.info('downloading file...');
121
- const destination = await (0, download_file_1.downloadFile)({
124
+ const { outputPath: destination } = await (0, download_file_1.downloadFile)({
122
125
  bucketName: res.bucketName,
123
126
  gsutilURI: res.cloudStorageUri,
124
127
  downloadName,
@@ -50,30 +50,30 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
50
50
  preferLossless: z.ZodBoolean;
51
51
  }, "strip", z.ZodTypeAny, {
52
52
  serveUrl: string;
53
- type: "media";
53
+ envVariables: Record<string, string>;
54
+ jpegQuality: number;
55
+ scale: number;
56
+ logLevel: "error" | "verbose" | "info" | "warn";
54
57
  composition: string;
58
+ imageFormat: "png" | "jpeg" | "none";
59
+ delayRenderTimeoutInMilliseconds: number;
60
+ type: "media";
55
61
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
56
- serializedInputPropsWithCustomSchema: string;
57
- jpegQuality: number;
58
- audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
59
- audioBitrate: string | null;
60
- videoBitrate: string | null;
61
62
  crf: number | null;
63
+ frameRange: ((number | [number, number]) & (number | [number, number] | undefined)) | null;
62
64
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
63
- imageFormat: "png" | "jpeg" | "none";
64
- scale: number;
65
65
  proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | null;
66
66
  everyNthFrame: number;
67
67
  numberOfGifLoops: number | null;
68
- frameRange: ((number | [number, number]) & (number | [number, number] | undefined)) | null;
69
- envVariables: Record<string, string>;
70
68
  muted: boolean;
71
- outputBucket: string;
72
- logLevel: "error" | "verbose" | "info" | "warn";
73
- delayRenderTimeoutInMilliseconds: number;
74
- concurrency: string | number | null;
69
+ audioBitrate: string | null;
70
+ videoBitrate: string | null;
75
71
  enforceAudioTrack: boolean;
72
+ audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
73
+ concurrency: string | number | null;
76
74
  preferLossless: boolean;
75
+ serializedInputPropsWithCustomSchema: string;
76
+ outputBucket: string;
77
77
  forceHeight?: number | null | undefined;
78
78
  forceWidth?: number | null | undefined;
79
79
  chromiumOptions?: {
@@ -87,30 +87,30 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
87
87
  privacy?: "public" | "private" | undefined;
88
88
  }, {
89
89
  serveUrl: string;
90
- type: "media";
90
+ envVariables: Record<string, string>;
91
+ jpegQuality: number;
92
+ scale: number;
93
+ logLevel: "error" | "verbose" | "info" | "warn";
91
94
  composition: string;
95
+ imageFormat: "png" | "jpeg" | "none";
96
+ delayRenderTimeoutInMilliseconds: number;
97
+ type: "media";
92
98
  codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
93
- serializedInputPropsWithCustomSchema: string;
94
- jpegQuality: number;
95
- audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
96
- audioBitrate: string | null;
97
- videoBitrate: string | null;
98
99
  crf: number | null;
100
+ frameRange: ((number | [number, number]) & (number | [number, number] | undefined)) | null;
99
101
  pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
100
- imageFormat: "png" | "jpeg" | "none";
101
- scale: number;
102
102
  proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | null;
103
103
  everyNthFrame: number;
104
104
  numberOfGifLoops: number | null;
105
- frameRange: ((number | [number, number]) & (number | [number, number] | undefined)) | null;
106
- envVariables: Record<string, string>;
107
105
  muted: boolean;
108
- outputBucket: string;
109
- logLevel: "error" | "verbose" | "info" | "warn";
110
- delayRenderTimeoutInMilliseconds: number;
111
- concurrency: string | number | null;
106
+ audioBitrate: string | null;
107
+ videoBitrate: string | null;
112
108
  enforceAudioTrack: boolean;
109
+ audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
110
+ concurrency: string | number | null;
113
111
  preferLossless: boolean;
112
+ serializedInputPropsWithCustomSchema: string;
113
+ outputBucket: string;
114
114
  forceHeight?: number | null | undefined;
115
115
  forceWidth?: number | null | undefined;
116
116
  chromiumOptions?: {
@@ -159,18 +159,18 @@ 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
+ privacy: "public" | "private";
162
163
  serveUrl: string;
163
- type: "still";
164
- composition: string;
165
- serializedInputPropsWithCustomSchema: string;
166
- imageFormat: "png" | "jpeg" | "pdf" | "webp";
167
- scale: number;
168
164
  envVariables: Record<string, string>;
169
- outputBucket: string;
170
- privacy: "public" | "private";
165
+ scale: number;
171
166
  logLevel: "error" | "verbose" | "info" | "warn";
172
- delayRenderTimeoutInMilliseconds: number;
167
+ composition: string;
168
+ imageFormat: "png" | "jpeg" | "pdf" | "webp";
173
169
  frame: number;
170
+ delayRenderTimeoutInMilliseconds: number;
171
+ type: "still";
172
+ serializedInputPropsWithCustomSchema: string;
173
+ outputBucket: string;
174
174
  forceHeight?: number | null | undefined;
175
175
  forceWidth?: number | null | undefined;
176
176
  jpegQuality?: number | undefined;
@@ -183,18 +183,18 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
183
183
  } | undefined;
184
184
  outName?: string | undefined;
185
185
  }, {
186
+ privacy: "public" | "private";
186
187
  serveUrl: string;
187
- type: "still";
188
- composition: string;
189
- serializedInputPropsWithCustomSchema: string;
190
- imageFormat: "png" | "jpeg" | "pdf" | "webp";
191
- scale: number;
192
188
  envVariables: Record<string, string>;
193
- outputBucket: string;
194
- privacy: "public" | "private";
189
+ scale: number;
195
190
  logLevel: "error" | "verbose" | "info" | "warn";
196
- delayRenderTimeoutInMilliseconds: number;
191
+ composition: string;
192
+ imageFormat: "png" | "jpeg" | "pdf" | "webp";
197
193
  frame: number;
194
+ delayRenderTimeoutInMilliseconds: number;
195
+ type: "still";
196
+ serializedInputPropsWithCustomSchema: string;
197
+ outputBucket: string;
198
198
  forceHeight?: number | null | undefined;
199
199
  forceWidth?: number | null | undefined;
200
200
  jpegQuality?: number | undefined;
@@ -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;
234
- status: "success";
235
232
  privacy: "public-read" | "project-private";
233
+ status: "success";
236
234
  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;
242
- status: "success";
243
240
  privacy: "public-read" | "project-private";
241
+ status: "success";
244
242
  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;
259
- status: "success";
260
257
  privacy: "public-read" | "project-private";
258
+ status: "success";
261
259
  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;
267
- status: "success";
268
265
  privacy: "public-read" | "project-private";
266
+ status: "success";
269
267
  cloudStorageUri: string;
268
+ size: number;
269
+ bucketName: string;
270
270
  renderId: string;
271
271
  publicUrl?: string | null | undefined;
272
272
  }>;
@@ -278,15 +278,15 @@ declare const cloudRunCrashResponse: z.ZodObject<{
278
278
  requestCrashTime: z.ZodString;
279
279
  requestElapsedTimeInSeconds: z.ZodNumber;
280
280
  }, "strip", z.ZodTypeAny, {
281
- message: "Service crashed without sending a response. Check the logs in GCP console.";
282
281
  status: "crash";
282
+ message: "Service crashed without sending a response. Check the logs in GCP console.";
283
283
  cloudRunEndpoint: string;
284
284
  requestStartTime: string;
285
285
  requestCrashTime: string;
286
286
  requestElapsedTimeInSeconds: number;
287
287
  }, {
288
- message: "Service crashed without sending a response. Check the logs in GCP console.";
289
288
  status: "crash";
289
+ message: "Service crashed without sending a response. Check the logs in GCP console.";
290
290
  cloudRunEndpoint: string;
291
291
  requestStartTime: string;
292
292
  requestCrashTime: string;
@@ -17,13 +17,7 @@ const validateServeUrl = async (serveUrl) => {
17
17
  .file(fileName)
18
18
  .exists();
19
19
  if (!exists) {
20
- throw new Error('serveURL ERROR. File "' +
21
- fileName +
22
- '" not found in bucket "' +
23
- bucketName +
24
- '". Is your site name correct - "' +
25
- siteName +
26
- '"?');
20
+ throw new Error(`serveURL ERROR. File "${fileName}" not found in bucket "${bucketName}". Is your site name correct - "${siteName}"?`);
27
21
  }
28
22
  }
29
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cloudrun",
3
- "version": "4.0.19",
3
+ "version": "4.0.20",
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.19",
16
- "@remotion/cli": "4.0.19",
17
- "@remotion/renderer": "4.0.19",
18
- "remotion": "4.0.19"
15
+ "@remotion/bundler": "4.0.20",
16
+ "@remotion/cli": "4.0.20",
17
+ "remotion": "4.0.20",
18
+ "@remotion/renderer": "4.0.20"
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.19"
29
+ "@remotion/compositor-linux-x64-gnu": "4.0.20"
30
30
  },
31
31
  "exports": {
32
32
  "./package.json": "./package.json",