@remotion/cloudrun 4.0.24 → 4.0.26
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/deploy-service.d.ts +1 -1
- package/dist/api/deploy-service.js +14 -13
- package/dist/api/deploy-site.d.ts +9 -1
- package/dist/api/deploy-site.js +11 -10
- package/dist/api/render-media-on-cloudrun.js +42 -41
- package/dist/api/render-still-on-cloudrun.d.ts +0 -24
- package/dist/api/render-still-on-cloudrun.js +3 -2
- package/dist/cli/index.js +2 -2
- package/dist/functions/helpers/payloads.d.ts +12 -12
- package/package.json +6 -6
- package/dist/cli/commands/render/renderMedia.d.ts +0 -2
- package/dist/cli/commands/render/renderMedia.js +0 -156
- package/dist/cli/commands/render/renderStill.d.ts +0 -2
- package/dist/cli/commands/render/renderStill.js +0 -123
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @remotion/cloudrun@4.0.
|
|
2
|
+
> @remotion/cloudrun@4.0.26 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.26 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.26 tarInstaller /Users/jonathanburger/remotion/packages/cloudrun
|
|
12
12
|
> ts-node src/admin/bundle-installer.ts
|
|
13
13
|
|
|
@@ -25,4 +25,4 @@ export type DeployServiceOutput = {
|
|
|
25
25
|
* @param params.region GCP region to deploy the Cloud Run service to.
|
|
26
26
|
* @returns {Promise<DeployServiceOutput>} See documentation for detailed structure
|
|
27
27
|
*/
|
|
28
|
-
export declare const deployService: (
|
|
28
|
+
export declare const deployService: (args_0: DeployServiceInput) => Promise<DeployServiceOutput>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deployService = void 0;
|
|
4
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
4
5
|
const constants_1 = require("../shared/constants");
|
|
5
6
|
const generate_service_name_1 = require("../shared/generate-service-name");
|
|
6
7
|
const validate_gcp_region_1 = require("../shared/validate-gcp-region");
|
|
@@ -9,18 +10,7 @@ const validate_project_id_1 = require("../shared/validate-project-id");
|
|
|
9
10
|
const check_if_service_exists_1 = require("./check-if-service-exists");
|
|
10
11
|
const construct_service_deploy_request_1 = require("./helpers/construct-service-deploy-request");
|
|
11
12
|
const get_cloud_run_client_1 = require("./helpers/get-cloud-run-client");
|
|
12
|
-
|
|
13
|
-
* @description Creates a Cloud Run service in your project that will be able to render a video in GCP.
|
|
14
|
-
* @link https://remotion.dev/docs/cloudrun/deployservice
|
|
15
|
-
* @param params.performImageVersionValidation Validate that an image exists in the public Artifact Registry that matches the Remotion Version. Default true
|
|
16
|
-
* @param params.memoryLimit Memory limit of Cloud Run service to deploy.
|
|
17
|
-
* @param params.cpuLimit CPU limit of Cloud Run service to deploy.
|
|
18
|
-
* @param params.timeoutSeconds After how many seconds the Cloud Run service should be killed if it does not end itself.
|
|
19
|
-
* @param params.projectID GCP Project ID to deploy the Cloud Run service to.
|
|
20
|
-
* @param params.region GCP region to deploy the Cloud Run service to.
|
|
21
|
-
* @returns {Promise<DeployServiceOutput>} See documentation for detailed structure
|
|
22
|
-
*/
|
|
23
|
-
const deployService = async ({ performImageVersionValidation = true, memoryLimit, cpuLimit, timeoutSeconds, minInstances, maxInstances, projectID, region, }) => {
|
|
13
|
+
const deployServiceRaw = async ({ performImageVersionValidation = true, memoryLimit, cpuLimit, timeoutSeconds, minInstances, maxInstances, projectID, region, }) => {
|
|
24
14
|
(0, validate_gcp_region_1.validateGcpRegion)(region);
|
|
25
15
|
(0, validate_project_id_1.validateProjectID)(projectID);
|
|
26
16
|
if (performImageVersionValidation) {
|
|
@@ -87,4 +77,15 @@ const deployService = async ({ performImageVersionValidation = true, memoryLimit
|
|
|
87
77
|
alreadyExists: false,
|
|
88
78
|
};
|
|
89
79
|
};
|
|
90
|
-
|
|
80
|
+
/**
|
|
81
|
+
* @description Creates a Cloud Run service in your project that will be able to render a video in GCP.
|
|
82
|
+
* @link https://remotion.dev/docs/cloudrun/deployservice
|
|
83
|
+
* @param params.performImageVersionValidation Validate that an image exists in the public Artifact Registry that matches the Remotion Version. Default true
|
|
84
|
+
* @param params.memoryLimit Memory limit of Cloud Run service to deploy.
|
|
85
|
+
* @param params.cpuLimit CPU limit of Cloud Run service to deploy.
|
|
86
|
+
* @param params.timeoutSeconds After how many seconds the Cloud Run service should be killed if it does not end itself.
|
|
87
|
+
* @param params.projectID GCP Project ID to deploy the Cloud Run service to.
|
|
88
|
+
* @param params.region GCP region to deploy the Cloud Run service to.
|
|
89
|
+
* @returns {Promise<DeployServiceOutput>} See documentation for detailed structure
|
|
90
|
+
*/
|
|
91
|
+
exports.deployService = pure_1.PureJSAPIs.wrapWithErrorHandling(deployServiceRaw);
|
|
@@ -32,4 +32,12 @@ export type DeploySiteOutput = Promise<{
|
|
|
32
32
|
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
33
33
|
* @param {object} params.options Further options, see documentation page for this function.
|
|
34
34
|
*/
|
|
35
|
-
export declare const deploySite: (
|
|
35
|
+
export declare const deploySite: (args_0: DeploySiteInput) => Promise<{
|
|
36
|
+
serveUrl: string;
|
|
37
|
+
siteName: string;
|
|
38
|
+
stats: {
|
|
39
|
+
uploadedFiles: number;
|
|
40
|
+
deletedFiles: number;
|
|
41
|
+
untouchedFiles: number;
|
|
42
|
+
};
|
|
43
|
+
}>;
|
package/dist/api/deploy-site.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deploySite = void 0;
|
|
4
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
4
5
|
const io_1 = require("../functions/helpers/io");
|
|
5
6
|
const bundle_site_1 = require("../shared/bundle-site");
|
|
6
7
|
const constants_1 = require("../shared/constants");
|
|
@@ -11,15 +12,7 @@ const validate_bucketname_1 = require("../shared/validate-bucketname");
|
|
|
11
12
|
const validate_site_name_1 = require("../shared/validate-site-name");
|
|
12
13
|
const get_cloud_storage_client_1 = require("./helpers/get-cloud-storage-client");
|
|
13
14
|
const upload_dir_1 = require("./upload-dir");
|
|
14
|
-
|
|
15
|
-
* @description Deploys a Remotion project to a GCP storage bucket to prepare it for rendering on Cloud Run.
|
|
16
|
-
* @link https://remotion.dev/docs/cloudrun/deploysite
|
|
17
|
-
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
18
|
-
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
19
|
-
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
20
|
-
* @param {object} params.options Further options, see documentation page for this function.
|
|
21
|
-
*/
|
|
22
|
-
const deploySite = async ({ entryPoint, bucketName, siteName, options, }) => {
|
|
15
|
+
const deploySiteRaw = async ({ entryPoint, bucketName, siteName, options, }) => {
|
|
23
16
|
var _a, _b, _c, _d;
|
|
24
17
|
(0, validate_bucketname_1.validateBucketName)(bucketName, { mustStartWithRemotion: true });
|
|
25
18
|
const siteId = siteName !== null && siteName !== void 0 ? siteName : (0, random_hash_1.randomHash)();
|
|
@@ -75,4 +68,12 @@ const deploySite = async ({ entryPoint, bucketName, siteName, options, }) => {
|
|
|
75
68
|
},
|
|
76
69
|
};
|
|
77
70
|
};
|
|
78
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @description Deploys a Remotion project to a GCP storage bucket to prepare it for rendering on Cloud Run.
|
|
73
|
+
* @link https://remotion.dev/docs/cloudrun/deploysite
|
|
74
|
+
* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
|
|
75
|
+
* @param {string} params.bucketName The name of the bucket to deploy your project into.
|
|
76
|
+
* @param {string} params.siteName The name of the folder in which the project gets deployed to.
|
|
77
|
+
* @param {object} params.options Further options, see documentation page for this function.
|
|
78
|
+
*/
|
|
79
|
+
exports.deploySite = pure_1.PureJSAPIs.wrapWithErrorHandling(deploySiteRaw);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderMediaOnCloudrun = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
5
6
|
const remotion_1 = require("remotion");
|
|
6
7
|
const validate_gcp_codec_1 = require("../shared/validate-gcp-codec");
|
|
7
8
|
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
@@ -9,46 +10,7 @@ const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
|
9
10
|
const get_or_create_bucket_1 = require("./get-or-create-bucket");
|
|
10
11
|
const get_auth_client_for_url_1 = require("./helpers/get-auth-client-for-url");
|
|
11
12
|
const get_cloudrun_endpoint_1 = require("./helpers/get-cloudrun-endpoint");
|
|
12
|
-
|
|
13
|
-
* @description Triggers a render on a GCP Cloud Run service given a composition and a Cloud Run URL.
|
|
14
|
-
* @see [Documentation](https://remotion.dev/docs/cloudrun/renderMediaOnGcp)
|
|
15
|
-
* @param params.cloudRunUrl The URL of the Cloud Run service that should be used. Use either this or serviceName.
|
|
16
|
-
* @param params.serviceName The name of the Cloud Run service that should be used. Use either this or cloudRunUrl.
|
|
17
|
-
* @param params.region The region that the Cloud Run service is deployed in.
|
|
18
|
-
* @param params.serveUrl The URL of the deployed project
|
|
19
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
20
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
21
|
-
* @param params.codec The media codec which should be used for encoding.
|
|
22
|
-
* @param params.forceBucketName The name of the bucket that the output file should be uploaded to.
|
|
23
|
-
* @param params.privacy Whether the output file should be public or private.
|
|
24
|
-
* @param params.outputFile The name of the output file.
|
|
25
|
-
* @param params.updateRenderProgress A callback that is called with the progress of the render.
|
|
26
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
27
|
-
* @param params.audioCodec The encoding of the audio of the output video.
|
|
28
|
-
* @param params.audioBitrate The target bitrate for the audio of the generated video.
|
|
29
|
-
* @param params.videoBitrate The target bitrate of the generated video.
|
|
30
|
-
* @param params.proResProfile Sets a ProRes profile. Only applies to videos rendered with prores codec.
|
|
31
|
-
* @param params.x264Preset Sets a Preset profile. Only applies to videos rendered with h.264 codec.
|
|
32
|
-
* @param params.crf Constant Rate Factor, controlling the quality.
|
|
33
|
-
* @param params.pixelFormat Custom pixel format to use. Usually used for special use cases like transparent videos.
|
|
34
|
-
* @param params.imageFormat Which image format the frames should be rendered in.
|
|
35
|
-
* @param params.scale Scales the output dimensions by a factor.
|
|
36
|
-
* @param params.everyNthFrame Only used if rendering gigs - renders only every nth frame.
|
|
37
|
-
* @param params.numberOfGifLoops Only used if rendering gigs - how many times the gif should loop. Null means infinite.
|
|
38
|
-
* @param params.frameRange Specify a single frame (a number) or a range of frames (a tuple [number, number]) to be rendered.
|
|
39
|
-
* @param params.envVariables Object containing environment variables to be injected in your project.
|
|
40
|
-
* @param params.chromiumOptions Allows you to set certain Chromium / Google Chrome flags.
|
|
41
|
-
* @param params.muted If set to true, no audio is rendered.
|
|
42
|
-
* @param params.forceWidth Overrides default composition width.
|
|
43
|
-
* @param params.forceHeight Overrides default composition height.
|
|
44
|
-
* @param params.logLevel Level of logging that Cloud Run service should perform. Default "info".
|
|
45
|
-
* @param params.delayRenderTimeoutInMilliseconds A number describing how long the render may take to resolve all delayRender() calls before it times out.
|
|
46
|
-
* @param params.concurrency By default, each Cloud Run service renders with concurrency 100% (equal to number of available cores). You may use the option to customize this value.
|
|
47
|
-
* @param params.enforceAudioTrack Render a silent audio track if there wouldn't be any otherwise.
|
|
48
|
-
* @param params.preferLossless Uses a lossless audio codec, if one is available for the codec. If you set audioCodec, it takes priority over preferLossless.
|
|
49
|
-
* @returns {Promise<RenderMediaOnCloudrunOutput>} See documentation for detailed structure
|
|
50
|
-
*/
|
|
51
|
-
const renderMediaOnCloudrun = 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, }) => {
|
|
52
14
|
const actualCodec = (0, validate_gcp_codec_1.validateCloudrunCodec)(codec);
|
|
53
15
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
54
16
|
if (privacy)
|
|
@@ -158,4 +120,43 @@ const renderMediaOnCloudrun = async ({ cloudRunUrl, serviceName, region, serveUr
|
|
|
158
120
|
});
|
|
159
121
|
return renderResponse;
|
|
160
122
|
};
|
|
161
|
-
|
|
123
|
+
/**
|
|
124
|
+
* @description Triggers a render on a GCP Cloud Run service given a composition and a Cloud Run URL.
|
|
125
|
+
* @see [Documentation](https://remotion.dev/docs/cloudrun/renderMediaOnGcp)
|
|
126
|
+
* @param params.cloudRunUrl The URL of the Cloud Run service that should be used. Use either this or serviceName.
|
|
127
|
+
* @param params.serviceName The name of the Cloud Run service that should be used. Use either this or cloudRunUrl.
|
|
128
|
+
* @param params.region The region that the Cloud Run service is deployed in.
|
|
129
|
+
* @param params.serveUrl The URL of the deployed project
|
|
130
|
+
* @param params.composition The ID of the composition which should be rendered.
|
|
131
|
+
* @param params.inputProps The input props that should be passed to the composition.
|
|
132
|
+
* @param params.codec The media codec which should be used for encoding.
|
|
133
|
+
* @param params.forceBucketName The name of the bucket that the output file should be uploaded to.
|
|
134
|
+
* @param params.privacy Whether the output file should be public or private.
|
|
135
|
+
* @param params.outputFile The name of the output file.
|
|
136
|
+
* @param params.updateRenderProgress A callback that is called with the progress of the render.
|
|
137
|
+
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
138
|
+
* @param params.audioCodec The encoding of the audio of the output video.
|
|
139
|
+
* @param params.audioBitrate The target bitrate for the audio of the generated video.
|
|
140
|
+
* @param params.videoBitrate The target bitrate of the generated video.
|
|
141
|
+
* @param params.proResProfile Sets a ProRes profile. Only applies to videos rendered with prores codec.
|
|
142
|
+
* @param params.x264Preset Sets a Preset profile. Only applies to videos rendered with h.264 codec.
|
|
143
|
+
* @param params.crf Constant Rate Factor, controlling the quality.
|
|
144
|
+
* @param params.pixelFormat Custom pixel format to use. Usually used for special use cases like transparent videos.
|
|
145
|
+
* @param params.imageFormat Which image format the frames should be rendered in.
|
|
146
|
+
* @param params.scale Scales the output dimensions by a factor.
|
|
147
|
+
* @param params.everyNthFrame Only used if rendering gigs - renders only every nth frame.
|
|
148
|
+
* @param params.numberOfGifLoops Only used if rendering gigs - how many times the gif should loop. Null means infinite.
|
|
149
|
+
* @param params.frameRange Specify a single frame (a number) or a range of frames (a tuple [number, number]) to be rendered.
|
|
150
|
+
* @param params.envVariables Object containing environment variables to be injected in your project.
|
|
151
|
+
* @param params.chromiumOptions Allows you to set certain Chromium / Google Chrome flags.
|
|
152
|
+
* @param params.muted If set to true, no audio is rendered.
|
|
153
|
+
* @param params.forceWidth Overrides default composition width.
|
|
154
|
+
* @param params.forceHeight Overrides default composition height.
|
|
155
|
+
* @param params.logLevel Level of logging that Cloud Run service should perform. Default "info".
|
|
156
|
+
* @param params.delayRenderTimeoutInMilliseconds A number describing how long the render may take to resolve all delayRender() calls before it times out.
|
|
157
|
+
* @param params.concurrency By default, each Cloud Run service renders with concurrency 100% (equal to number of available cores). You may use the option to customize this value.
|
|
158
|
+
* @param params.enforceAudioTrack Render a silent audio track if there wouldn't be any otherwise.
|
|
159
|
+
* @param params.preferLossless Uses a lossless audio codec, if one is available for the codec. If you set audioCodec, it takes priority over preferLossless.
|
|
160
|
+
* @returns {Promise<RenderMediaOnCloudrunOutput>} See documentation for detailed structure
|
|
161
|
+
*/
|
|
162
|
+
exports.renderMediaOnCloudrun = pure_1.PureJSAPIs.wrapWithErrorHandling(renderMediaOnCloudrunRaw);
|
|
@@ -23,28 +23,4 @@ export type RenderStillOnCloudrunInput = {
|
|
|
23
23
|
logLevel?: LogLevel;
|
|
24
24
|
delayRenderTimeoutInMilliseconds?: number;
|
|
25
25
|
} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
|
|
26
|
-
/**
|
|
27
|
-
* @description Triggers a render on a GCP Cloud Run service given a composition and a Cloud Run URL.
|
|
28
|
-
* @see [Documentation](https://remotion.dev/docs/cloudrun/renderstilloncloudrun)
|
|
29
|
-
* @param params.cloudRunUrl The URL of the Cloud Run service that should be used. Use either this or serviceName.
|
|
30
|
-
* @param params.serviceName The name of the Cloud Run service that should be used. Use either this or cloudRunUrl.
|
|
31
|
-
* @param params.region The region that the Cloud Run service is deployed in.
|
|
32
|
-
* @param params.serveUrl The URL of the deployed project
|
|
33
|
-
* @param params.composition The ID of the composition which should be rendered.
|
|
34
|
-
* @param params.inputProps The input props that should be passed to the composition.
|
|
35
|
-
* @param params.forceBucketName The name of the bucket that the output file should be uploaded to.
|
|
36
|
-
* @param params.privacy Whether the output file should be public or private.
|
|
37
|
-
* @param params.outName The name of the output file.
|
|
38
|
-
* @param params.imageFormat Which image format the frame should be rendered in.
|
|
39
|
-
* @param params.envVariables Object containing environment variables to be injected in your project.
|
|
40
|
-
* @param params.frame Which frame of the composition should be rendered. Frames are zero-indexed.
|
|
41
|
-
* @param params.jpegQuality JPEG quality if JPEG was selected as the image format.
|
|
42
|
-
* @param params.chromiumOptions Allows you to set certain Chromium / Google Chrome flags.
|
|
43
|
-
* @param params.scale Scales the output dimensions by a factor.
|
|
44
|
-
* @param params.forceWidth Overrides default composition width.
|
|
45
|
-
* @param params.forceHeight Overrides default composition height.
|
|
46
|
-
* @param params.logLevel Level of logging that Cloud Run service should perform. Default "info".
|
|
47
|
-
* @param params.delayRenderTimeoutInMilliseconds A number describing how long the render may take to resolve all delayRender() calls before it times out.
|
|
48
|
-
* @returns {Promise<RenderStillOnCloudrunOutput>} See documentation for detailed structure
|
|
49
|
-
*/
|
|
50
26
|
export declare const renderStillOnCloudrun: ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, forceBucketName, privacy, outName, imageFormat, envVariables, frame, jpegQuality, chromiumOptions, scale, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, offthreadVideoCacheSizeInBytes, }: RenderStillOnCloudrunInput) => Promise<RenderStillOnCloudrunOutput | ErrorResponsePayload | CloudRunCrashResponse>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderStillOnCloudrun = void 0;
|
|
4
4
|
const renderer_1 = require("@remotion/renderer");
|
|
5
|
+
const pure_1 = require("@remotion/renderer/pure");
|
|
5
6
|
const remotion_1 = require("remotion");
|
|
6
7
|
const validate_privacy_1 = require("../shared/validate-privacy");
|
|
7
8
|
const validate_serveurl_1 = require("../shared/validate-serveurl");
|
|
@@ -32,7 +33,7 @@ const get_cloudrun_endpoint_1 = require("./helpers/get-cloudrun-endpoint");
|
|
|
32
33
|
* @param params.delayRenderTimeoutInMilliseconds A number describing how long the render may take to resolve all delayRender() calls before it times out.
|
|
33
34
|
* @returns {Promise<RenderStillOnCloudrunOutput>} See documentation for detailed structure
|
|
34
35
|
*/
|
|
35
|
-
const
|
|
36
|
+
const renderStillOnCloudrunRaw = async ({ cloudRunUrl, serviceName, region, serveUrl, composition, inputProps, forceBucketName, privacy, outName, imageFormat, envVariables, frame, jpegQuality, chromiumOptions, scale, forceWidth, forceHeight, logLevel, delayRenderTimeoutInMilliseconds, offthreadVideoCacheSizeInBytes, }) => {
|
|
36
37
|
(0, validate_serveurl_1.validateServeUrl)(serveUrl);
|
|
37
38
|
if (privacy)
|
|
38
39
|
(0, validate_privacy_1.validatePrivacy)(privacy);
|
|
@@ -122,4 +123,4 @@ const renderStillOnCloudrun = async ({ cloudRunUrl, serviceName, region, serveUr
|
|
|
122
123
|
});
|
|
123
124
|
return renderResponse;
|
|
124
125
|
};
|
|
125
|
-
exports.renderStillOnCloudrun =
|
|
126
|
+
exports.renderStillOnCloudrun = pure_1.PureJSAPIs.wrapWithErrorHandling(renderStillOnCloudrunRaw);
|
package/dist/cli/index.js
CHANGED
|
@@ -53,7 +53,7 @@ const executeCommand = async (args, remotionRoot) => {
|
|
|
53
53
|
catch (err) {
|
|
54
54
|
const error = err;
|
|
55
55
|
if (error instanceof renderer_1.RenderInternals.SymbolicateableError) {
|
|
56
|
-
await cli_1.CliInternals.
|
|
56
|
+
await cli_1.CliInternals.printError(error, config_1.ConfigInternals.Logging.getLogLevel());
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
const frames = renderer_1.RenderInternals.parseStack((_b = (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\n')) !== null && _b !== void 0 ? _b : []);
|
|
@@ -64,7 +64,7 @@ const executeCommand = async (args, remotionRoot) => {
|
|
|
64
64
|
stack: error.stack,
|
|
65
65
|
stackFrame: frames,
|
|
66
66
|
});
|
|
67
|
-
await cli_1.CliInternals.
|
|
67
|
+
await cli_1.CliInternals.printError(errorWithStackFrame, config_1.ConfigInternals.Logging.getLogLevel());
|
|
68
68
|
}
|
|
69
69
|
(0, quit_1.quit)(1);
|
|
70
70
|
}
|
|
@@ -51,8 +51,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
51
51
|
preferLossless: z.ZodBoolean;
|
|
52
52
|
offthreadVideoCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
|
-
type: "media";
|
|
55
54
|
serveUrl: string;
|
|
55
|
+
type: "media";
|
|
56
56
|
composition: string;
|
|
57
57
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
58
58
|
serializedInputPropsWithCustomSchema: string;
|
|
@@ -90,8 +90,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
90
90
|
outName?: string | undefined;
|
|
91
91
|
privacy?: "public" | "private" | undefined;
|
|
92
92
|
}, {
|
|
93
|
-
type: "media";
|
|
94
93
|
serveUrl: string;
|
|
94
|
+
type: "media";
|
|
95
95
|
composition: string;
|
|
96
96
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
97
97
|
serializedInputPropsWithCustomSchema: string;
|
|
@@ -166,8 +166,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
166
166
|
logLevel: z.ZodEnum<["verbose", "info", "warn", "error"]>;
|
|
167
167
|
offthreadVideoCacheSizeInBytes: z.ZodNullable<z.ZodNumber>;
|
|
168
168
|
}, "strip", z.ZodTypeAny, {
|
|
169
|
-
type: "still";
|
|
170
169
|
serveUrl: string;
|
|
170
|
+
type: "still";
|
|
171
171
|
composition: string;
|
|
172
172
|
serializedInputPropsWithCustomSchema: string;
|
|
173
173
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
@@ -191,8 +191,8 @@ export declare const CloudRunPayload: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
191
191
|
} | undefined;
|
|
192
192
|
outName?: string | undefined;
|
|
193
193
|
}, {
|
|
194
|
-
type: "still";
|
|
195
194
|
serveUrl: string;
|
|
195
|
+
type: "still";
|
|
196
196
|
composition: string;
|
|
197
197
|
serializedInputPropsWithCustomSchema: string;
|
|
198
198
|
imageFormat: "png" | "jpeg" | "pdf" | "webp";
|
|
@@ -222,13 +222,13 @@ declare const renderFailResponsePayload: z.ZodObject<{
|
|
|
222
222
|
name: z.ZodString;
|
|
223
223
|
stack: z.ZodString;
|
|
224
224
|
}, "strip", z.ZodTypeAny, {
|
|
225
|
-
type: "error";
|
|
226
225
|
message: string;
|
|
226
|
+
type: "error";
|
|
227
227
|
name: string;
|
|
228
228
|
stack: string;
|
|
229
229
|
}, {
|
|
230
|
-
type: "error";
|
|
231
230
|
message: string;
|
|
231
|
+
type: "error";
|
|
232
232
|
name: string;
|
|
233
233
|
stack: string;
|
|
234
234
|
}>;
|
|
@@ -242,18 +242,18 @@ declare const renderStillOnCloudrunResponsePayload: z.ZodObject<{
|
|
|
242
242
|
privacy: z.ZodEnum<["public-read", "project-private"]>;
|
|
243
243
|
}, "strip", z.ZodTypeAny, {
|
|
244
244
|
bucketName: string;
|
|
245
|
+
size: number;
|
|
245
246
|
type: "success";
|
|
246
247
|
privacy: "public-read" | "project-private";
|
|
247
248
|
cloudStorageUri: string;
|
|
248
|
-
size: number;
|
|
249
249
|
renderId: string;
|
|
250
250
|
publicUrl?: string | null | undefined;
|
|
251
251
|
}, {
|
|
252
252
|
bucketName: string;
|
|
253
|
+
size: number;
|
|
253
254
|
type: "success";
|
|
254
255
|
privacy: "public-read" | "project-private";
|
|
255
256
|
cloudStorageUri: string;
|
|
256
|
-
size: number;
|
|
257
257
|
renderId: string;
|
|
258
258
|
publicUrl?: string | null | undefined;
|
|
259
259
|
}>;
|
|
@@ -267,18 +267,18 @@ declare const renderMediaOnCloudrunResponsePayload: z.ZodObject<{
|
|
|
267
267
|
privacy: z.ZodEnum<["public-read", "project-private"]>;
|
|
268
268
|
}, "strip", z.ZodTypeAny, {
|
|
269
269
|
bucketName: string;
|
|
270
|
+
size: number;
|
|
270
271
|
type: "success";
|
|
271
272
|
privacy: "public-read" | "project-private";
|
|
272
273
|
cloudStorageUri: string;
|
|
273
|
-
size: number;
|
|
274
274
|
renderId: string;
|
|
275
275
|
publicUrl?: string | null | undefined;
|
|
276
276
|
}, {
|
|
277
277
|
bucketName: string;
|
|
278
|
+
size: number;
|
|
278
279
|
type: "success";
|
|
279
280
|
privacy: "public-read" | "project-private";
|
|
280
281
|
cloudStorageUri: string;
|
|
281
|
-
size: number;
|
|
282
282
|
renderId: string;
|
|
283
283
|
publicUrl?: string | null | undefined;
|
|
284
284
|
}>;
|
|
@@ -290,15 +290,15 @@ declare const cloudRunCrashResponse: z.ZodObject<{
|
|
|
290
290
|
requestCrashTime: z.ZodString;
|
|
291
291
|
requestElapsedTimeInSeconds: z.ZodNumber;
|
|
292
292
|
}, "strip", z.ZodTypeAny, {
|
|
293
|
-
type: "crash";
|
|
294
293
|
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
294
|
+
type: "crash";
|
|
295
295
|
cloudRunEndpoint: string;
|
|
296
296
|
requestStartTime: string;
|
|
297
297
|
requestCrashTime: string;
|
|
298
298
|
requestElapsedTimeInSeconds: number;
|
|
299
299
|
}, {
|
|
300
|
-
type: "crash";
|
|
301
300
|
message: "Service crashed without sending a response. Check the logs in GCP console.";
|
|
301
|
+
type: "crash";
|
|
302
302
|
cloudRunEndpoint: string;
|
|
303
303
|
requestStartTime: string;
|
|
304
304
|
requestCrashTime: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/cloudrun",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.26",
|
|
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/
|
|
18
|
-
"remotion": "4.0.
|
|
15
|
+
"@remotion/cli": "4.0.26",
|
|
16
|
+
"@remotion/bundler": "4.0.26",
|
|
17
|
+
"@remotion/renderer": "4.0.26",
|
|
18
|
+
"remotion": "4.0.26"
|
|
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.26"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
"./package.json": "./package.json",
|
|
@@ -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,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;
|