@remotion/serverless-client 4.0.261

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.
Files changed (147) hide show
  1. package/.turbo/turbo-make.log +6 -0
  2. package/LICENSE.md +49 -0
  3. package/README.md +5 -0
  4. package/bundle.ts +15 -0
  5. package/dist/await.d.ts +1 -0
  6. package/dist/await.js +2 -0
  7. package/dist/calculate-chunk-times.d.ts +5 -0
  8. package/dist/calculate-chunk-times.js +29 -0
  9. package/dist/compress-props.d.ts +30 -0
  10. package/dist/compress-props.js +97 -0
  11. package/dist/constants.d.ts +314 -0
  12. package/dist/constants.js +64 -0
  13. package/dist/docs-url.d.ts +1 -0
  14. package/dist/docs-url.js +4 -0
  15. package/dist/error-category.d.ts +3 -0
  16. package/dist/error-category.js +16 -0
  17. package/dist/esm/index.mjs +3467 -0
  18. package/dist/estimate-price-from-bucket.d.ts +15 -0
  19. package/dist/estimate-price-from-bucket.js +31 -0
  20. package/dist/expected-out-name.d.ts +10 -0
  21. package/dist/expected-out-name.js +53 -0
  22. package/dist/format-costs-info.d.ts +2 -0
  23. package/dist/format-costs-info.js +23 -0
  24. package/dist/get-custom-out-name.d.ts +7 -0
  25. package/dist/get-custom-out-name.js +33 -0
  26. package/dist/get-files-in-folder.d.ts +5 -0
  27. package/dist/get-files-in-folder.js +2 -0
  28. package/dist/get-or-create-bucket.d.ts +23 -0
  29. package/dist/get-or-create-bucket.js +44 -0
  30. package/dist/get-overall-progress-from-storage.d.ts +11 -0
  31. package/dist/get-overall-progress-from-storage.js +25 -0
  32. package/dist/get-overall-progress.d.ts +9 -0
  33. package/dist/get-overall-progress.js +23 -0
  34. package/dist/index.d.ts +50 -0
  35. package/dist/index.js +105 -0
  36. package/dist/input-props-keys.d.ts +2 -0
  37. package/dist/input-props-keys.js +11 -0
  38. package/dist/inspect-error.d.ts +4 -0
  39. package/dist/inspect-error.js +39 -0
  40. package/dist/make-bucket-name.d.ts +3 -0
  41. package/dist/make-bucket-name.js +7 -0
  42. package/dist/make-timeout-error.d.ts +13 -0
  43. package/dist/make-timeout-error.js +32 -0
  44. package/dist/make-timeout-message.d.ts +12 -0
  45. package/dist/make-timeout-message.js +76 -0
  46. package/dist/min-max.d.ts +2 -0
  47. package/dist/min-max.js +33 -0
  48. package/dist/most-expensive-chunks.d.ts +13 -0
  49. package/dist/most-expensive-chunks.js +28 -0
  50. package/dist/overall-render-progress.d.ts +24 -0
  51. package/dist/overall-render-progress.js +2 -0
  52. package/dist/progress.d.ts +16 -0
  53. package/dist/progress.js +258 -0
  54. package/dist/provider-implementation.d.ts +193 -0
  55. package/dist/provider-implementation.js +2 -0
  56. package/dist/render-has-audio-video.d.ts +6 -0
  57. package/dist/render-has-audio-video.js +21 -0
  58. package/dist/render-metadata.d.ts +45 -0
  59. package/dist/render-metadata.js +2 -0
  60. package/dist/render-progress.d.ts +51 -0
  61. package/dist/render-progress.js +2 -0
  62. package/dist/return-values.d.ts +38 -0
  63. package/dist/return-values.js +2 -0
  64. package/dist/serialize-artifact.d.ts +9 -0
  65. package/dist/serialize-artifact.js +37 -0
  66. package/dist/stream-to-string.d.ts +2 -0
  67. package/dist/stream-to-string.js +14 -0
  68. package/dist/streaming/streaming.d.ts +101 -0
  69. package/dist/streaming/streaming.js +61 -0
  70. package/dist/test/dont-contain-forbidden.test.d.ts +1 -0
  71. package/dist/test/dont-contain-forbidden.test.js +18 -0
  72. package/dist/test/expected-out-name.test.d.ts +1 -0
  73. package/dist/test/expected-out-name.test.js +167 -0
  74. package/dist/test/min-max.test.d.ts +1 -0
  75. package/dist/test/min-max.test.js +24 -0
  76. package/dist/test/most-expensive-chunks.test.d.ts +1 -0
  77. package/dist/test/most-expensive-chunks.test.js +163 -0
  78. package/dist/truthy.d.ts +3 -0
  79. package/dist/truthy.js +6 -0
  80. package/dist/types.d.ts +55 -0
  81. package/dist/types.js +2 -0
  82. package/dist/validate-bucket-name.d.ts +7 -0
  83. package/dist/validate-bucket-name.js +16 -0
  84. package/dist/validate-download-behavior.d.ts +1 -0
  85. package/dist/validate-download-behavior.js +21 -0
  86. package/dist/validate-frames-per-function.d.ts +4 -0
  87. package/dist/validate-frames-per-function.js +29 -0
  88. package/dist/validate-outname.d.ts +9 -0
  89. package/dist/validate-outname.js +43 -0
  90. package/dist/validate-privacy.d.ts +2 -0
  91. package/dist/validate-privacy.js +14 -0
  92. package/dist/validate-webhook.d.ts +3 -0
  93. package/dist/validate-webhook.js +16 -0
  94. package/dist/webhook-types.d.ts +29 -0
  95. package/dist/webhook-types.js +2 -0
  96. package/dist/write-error-to-storage.d.ts +24 -0
  97. package/dist/write-error-to-storage.js +2 -0
  98. package/eslint.config.mjs +5 -0
  99. package/package.json +41 -0
  100. package/src/await.ts +1 -0
  101. package/src/calculate-chunk-times.ts +42 -0
  102. package/src/compress-props.ts +171 -0
  103. package/src/constants.ts +403 -0
  104. package/src/docs-url.ts +1 -0
  105. package/src/error-category.ts +14 -0
  106. package/src/estimate-price-from-bucket.ts +59 -0
  107. package/src/expected-out-name.ts +83 -0
  108. package/src/format-costs-info.ts +24 -0
  109. package/src/get-custom-out-name.ts +44 -0
  110. package/src/get-files-in-folder.ts +6 -0
  111. package/src/get-or-create-bucket.ts +79 -0
  112. package/src/get-overall-progress-from-storage.ts +44 -0
  113. package/src/get-overall-progress.ts +42 -0
  114. package/src/index.ts +125 -0
  115. package/src/input-props-keys.ts +7 -0
  116. package/src/inspect-error.ts +60 -0
  117. package/src/make-bucket-name.ts +9 -0
  118. package/src/make-timeout-error.ts +51 -0
  119. package/src/make-timeout-message.ts +118 -0
  120. package/src/min-max.ts +34 -0
  121. package/src/most-expensive-chunks.ts +46 -0
  122. package/src/overall-render-progress.ts +30 -0
  123. package/src/progress.ts +327 -0
  124. package/src/provider-implementation.ts +261 -0
  125. package/src/render-has-audio-video.ts +28 -0
  126. package/src/render-metadata.ts +60 -0
  127. package/src/render-progress.ts +58 -0
  128. package/src/return-values.ts +45 -0
  129. package/src/serialize-artifact.ts +51 -0
  130. package/src/stream-to-string.ts +14 -0
  131. package/src/streaming/streaming.ts +148 -0
  132. package/src/test/dont-contain-forbidden.test.ts +14 -0
  133. package/src/test/expected-out-name.test.ts +197 -0
  134. package/src/test/min-max.test.ts +25 -0
  135. package/src/test/most-expensive-chunks.test.ts +167 -0
  136. package/src/truthy.ts +5 -0
  137. package/src/types.ts +77 -0
  138. package/src/validate-bucket-name.ts +34 -0
  139. package/src/validate-download-behavior.ts +26 -0
  140. package/src/validate-frames-per-function.ts +54 -0
  141. package/src/validate-outname.ts +63 -0
  142. package/src/validate-privacy.ts +20 -0
  143. package/src/validate-webhook.ts +18 -0
  144. package/src/webhook-types.ts +36 -0
  145. package/src/write-error-to-storage.ts +23 -0
  146. package/tsconfig.json +18 -0
  147. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,6 @@
1
+
2
+ 
3
+ > @remotion/serverless-client@4.0.261 make /Users/jonathanburger/remotion/packages/serverless-client
4
+ > tsc -d && bun --env-file=../.env.bundle bundle.ts
5
+
6
+ [11.79ms] Generated.
package/LICENSE.md ADDED
@@ -0,0 +1,49 @@
1
+ # Remotion License
2
+
3
+ In Remotion 5.0, the license will slightly change. [View the changes here](https://github.com/remotion-dev/remotion/pull/3750).
4
+
5
+ ---
6
+
7
+ Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
8
+
9
+ - [Free license](#free-license)
10
+ - [Company license](#company-license)
11
+
12
+ ## Free license
13
+
14
+ Copyright © 2025 [Remotion](https://www.remotion.dev)
15
+
16
+ ### Eligibility
17
+
18
+ You are eligible to use Remotion for free if you are:
19
+
20
+ - an individual
21
+ - a for-profit organization with up to 3 employees
22
+ - a non-profit or not-for-profit organization
23
+ - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
24
+
25
+ ### Allowed use cases
26
+
27
+ Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
28
+
29
+ ### Disallowed use cases
30
+
31
+ It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
32
+
33
+ ### Warranty notice
34
+
35
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
36
+
37
+ ### Support
38
+
39
+ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
40
+
41
+ ## Company license
42
+
43
+ You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](https://www.remotion.dev/docs/support)).
44
+
45
+ Visit [remotion.pro](https://www.remotion.pro/license) for pricing and to buy a license.
46
+
47
+ ### FAQs
48
+
49
+ Are you not sure whether you need a company license because of an edge case? Here are some [frequently asked questions](https://www.remotion.pro/faq).
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @remotion/serverless-client
2
+
3
+ ## Usage
4
+
5
+ This is an internal package and has no documentation.
package/bundle.ts ADDED
@@ -0,0 +1,15 @@
1
+ import {buildPackage} from '../.monorepo/builder';
2
+
3
+ await buildPackage({
4
+ formats: {
5
+ cjs: 'use-tsc',
6
+ esm: 'build',
7
+ },
8
+ external: [],
9
+ entrypoints: [
10
+ {
11
+ path: 'src/index.ts',
12
+ target: 'node',
13
+ },
14
+ ],
15
+ });
@@ -0,0 +1 @@
1
+ export type Await<T> = T extends PromiseLike<infer U> ? U : T;
package/dist/await.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ import type { ParsedTiming } from './types';
2
+ export declare const calculateChunkTimes: ({ type, timings, }: {
3
+ type: "combined-time-for-cost-calculation" | "absolute-time";
4
+ timings: ParsedTiming[];
5
+ }) => number;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateChunkTimes = void 0;
4
+ const min_max_1 = require("./min-max");
5
+ const getAbsoluteTime = (parsedTimings) => {
6
+ if (parsedTimings.length === 0) {
7
+ return 0;
8
+ }
9
+ const allEnds = parsedTimings.map((p) => p.rendered);
10
+ const allStarts = parsedTimings.map((p) => p.start);
11
+ const biggestEnd = (0, min_max_1.max)(allEnds);
12
+ const smallestStart = (0, min_max_1.min)(allStarts);
13
+ return Math.max(0, biggestEnd - smallestStart);
14
+ };
15
+ const calculateChunkTimes = ({ type, timings, }) => {
16
+ const parsedTimings = timings;
17
+ const absoluteTime = getAbsoluteTime(parsedTimings);
18
+ if (type === 'combined-time-for-cost-calculation') {
19
+ const totalEncodingTimings = parsedTimings
20
+ .map((p) => Math.max(0, p.rendered - p.start))
21
+ .reduce((a, b) => a + b, 0);
22
+ return totalEncodingTimings + absoluteTime;
23
+ }
24
+ if (type === 'absolute-time') {
25
+ return absoluteTime;
26
+ }
27
+ throw new Error('invalid time for calculate chunk times');
28
+ };
29
+ exports.calculateChunkTimes = calculateChunkTimes;
@@ -0,0 +1,30 @@
1
+ import type { SerializedInputProps } from './constants';
2
+ import type { ProviderSpecifics } from './provider-implementation';
3
+ import type { CloudProvider } from './types';
4
+ type PropsType = 'input-props' | 'resolved-props';
5
+ export declare const serializeOrThrow: (inputProps: Record<string, unknown>, propsType: PropsType) => string;
6
+ export declare const getNeedsToUpload: <Provider extends CloudProvider>({ type, sizes, providerSpecifics, }: {
7
+ type: "still" | "video-or-audio";
8
+ sizes: number[];
9
+ providerSpecifics: ProviderSpecifics<Provider>;
10
+ }) => boolean;
11
+ export declare const compressInputProps: <Provider extends CloudProvider>({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, forcePathStyle, skipPutAcl, }: {
12
+ stringifiedInputProps: string;
13
+ region: Provider["region"];
14
+ userSpecifiedBucketName: string | null;
15
+ propsType: PropsType;
16
+ needsToUpload: boolean;
17
+ providerSpecifics: ProviderSpecifics<Provider>;
18
+ forcePathStyle: boolean;
19
+ skipPutAcl: boolean;
20
+ }) => Promise<SerializedInputProps>;
21
+ export declare const decompressInputProps: <Provider extends CloudProvider>({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, forcePathStyle, }: {
22
+ serialized: SerializedInputProps;
23
+ region: Provider["region"];
24
+ bucketName: string;
25
+ expectedBucketOwner: string;
26
+ propsType: PropsType;
27
+ providerSpecifics: ProviderSpecifics<Provider>;
28
+ forcePathStyle: boolean;
29
+ }) => Promise<string>;
30
+ export {};
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decompressInputProps = exports.compressInputProps = exports.getNeedsToUpload = exports.serializeOrThrow = void 0;
4
+ const no_react_1 = require("remotion/no-react");
5
+ const get_or_create_bucket_1 = require("./get-or-create-bucket");
6
+ const input_props_keys_1 = require("./input-props-keys");
7
+ const stream_to_string_1 = require("./stream-to-string");
8
+ const validate_webhook_1 = require("./validate-webhook");
9
+ const makeKey = (type, hash) => {
10
+ if (type === 'input-props') {
11
+ return (0, input_props_keys_1.inputPropsKey)(hash);
12
+ }
13
+ return (0, input_props_keys_1.resolvedPropsKey)(hash);
14
+ };
15
+ const serializeOrThrow = (inputProps, propsType) => {
16
+ try {
17
+ const payload = no_react_1.NoReactInternals.serializeJSONWithDate({
18
+ indent: undefined,
19
+ staticBase: null,
20
+ data: inputProps,
21
+ });
22
+ return payload.serializedString;
23
+ }
24
+ catch (_a) {
25
+ throw new Error(`Error serializing ${propsType}. Check it has no circular references or reduce the size if the object is big.`);
26
+ }
27
+ };
28
+ exports.serializeOrThrow = serializeOrThrow;
29
+ const getNeedsToUpload = ({ type, sizes, providerSpecifics, }) => {
30
+ const MARGIN = 5000 + validate_webhook_1.MAX_WEBHOOK_CUSTOM_DATA_SIZE;
31
+ const MAX_INLINE_PAYLOAD_SIZE = (type === 'still'
32
+ ? providerSpecifics.getMaxStillInlinePayloadSize()
33
+ : providerSpecifics.getMaxNonInlinePayloadSizePerFunction()) - MARGIN;
34
+ const sizesAlreadyUsed = sizes.reduce((a, b) => a + b);
35
+ if (sizesAlreadyUsed > MAX_INLINE_PAYLOAD_SIZE) {
36
+ // eslint-disable-next-line no-console
37
+ console.warn(`Warning: The props are over ${Math.round(MAX_INLINE_PAYLOAD_SIZE / 1000)}KB (${Math.ceil(sizesAlreadyUsed / 1024)}KB) in size. Uploading them to ${providerSpecifics.serverStorageProductName()} to circumvent AWS Lambda payload size, which may lead to slowdown.`);
38
+ return true;
39
+ }
40
+ return false;
41
+ };
42
+ exports.getNeedsToUpload = getNeedsToUpload;
43
+ const compressInputProps = async ({ stringifiedInputProps, region, userSpecifiedBucketName, propsType, needsToUpload, providerSpecifics, forcePathStyle, skipPutAcl, }) => {
44
+ const hash = providerSpecifics.randomHash();
45
+ if (needsToUpload) {
46
+ const bucketName = userSpecifiedBucketName !== null && userSpecifiedBucketName !== void 0 ? userSpecifiedBucketName : (await (0, get_or_create_bucket_1.internalGetOrCreateBucket)({
47
+ region,
48
+ enableFolderExpiry: null,
49
+ customCredentials: null,
50
+ providerSpecifics,
51
+ forcePathStyle,
52
+ skipPutAcl,
53
+ })).bucketName;
54
+ await providerSpecifics.writeFile({
55
+ body: stringifiedInputProps,
56
+ bucketName,
57
+ region,
58
+ customCredentials: null,
59
+ downloadBehavior: null,
60
+ expectedBucketOwner: null,
61
+ key: makeKey(propsType, hash),
62
+ privacy: 'private',
63
+ forcePathStyle,
64
+ });
65
+ return {
66
+ type: 'bucket-url',
67
+ hash,
68
+ bucketName,
69
+ };
70
+ }
71
+ return {
72
+ type: 'payload',
73
+ payload: stringifiedInputProps,
74
+ };
75
+ };
76
+ exports.compressInputProps = compressInputProps;
77
+ const decompressInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, propsType, providerSpecifics, forcePathStyle, }) => {
78
+ if (serialized.type === 'payload') {
79
+ return serialized.payload;
80
+ }
81
+ try {
82
+ const response = await providerSpecifics.readFile({
83
+ bucketName,
84
+ expectedBucketOwner,
85
+ key: makeKey(propsType, serialized.hash),
86
+ region,
87
+ forcePathStyle,
88
+ });
89
+ const body = await (0, stream_to_string_1.streamToString)(response);
90
+ const payload = body;
91
+ return payload;
92
+ }
93
+ catch (err) {
94
+ throw new Error(`Failed to parse input props that were serialized: ${err.stack}`);
95
+ }
96
+ };
97
+ exports.decompressInputProps = decompressInputProps;
@@ -0,0 +1,314 @@
1
+ export declare const COMMAND_NOT_FOUND = "Command not found";
2
+ import type { AudioCodec, ChromiumOptions, ColorSpace, FrameRange, LogLevel, PixelFormat, ProResProfile, StillImageFormat, ToOptions, VideoImageFormat, X264Preset } from '@remotion/renderer';
3
+ import type { BrowserSafeApis } from '@remotion/renderer/client';
4
+ import type { ExpensiveChunk } from './most-expensive-chunks';
5
+ import type { ChunkRetry, CloudProvider, ReceivedArtifact } from './types';
6
+ import type { EnhancedErrorInfo } from './write-error-to-storage';
7
+ export declare const expiryDays: {
8
+ readonly '1-day': 1;
9
+ readonly '3-days': 3;
10
+ readonly '7-days': 7;
11
+ readonly '30-days': 30;
12
+ };
13
+ export type DeleteAfter = keyof typeof expiryDays;
14
+ export declare enum ServerlessRoutines {
15
+ info = "info",
16
+ start = "start",
17
+ launch = "launch",
18
+ status = "status",
19
+ renderer = "renderer",
20
+ still = "still",
21
+ compositions = "compositions"
22
+ }
23
+ export type CustomCredentialsWithoutSensitiveData = {
24
+ endpoint: string;
25
+ };
26
+ export type CustomCredentials<Provider extends CloudProvider> = CustomCredentialsWithoutSensitiveData & {
27
+ accessKeyId: string | null;
28
+ secretAccessKey: string | null;
29
+ region?: Provider['region'];
30
+ forcePathStyle?: boolean;
31
+ };
32
+ export type OutNameInput<Provider extends CloudProvider> = string | {
33
+ bucketName: string;
34
+ key: string;
35
+ s3OutputProvider?: CustomCredentials<Provider>;
36
+ };
37
+ export type SerializedInputProps = {
38
+ type: 'bucket-url';
39
+ hash: string;
40
+ bucketName: string;
41
+ } | {
42
+ type: 'payload';
43
+ payload: string;
44
+ };
45
+ export declare const serverlessCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "gif", "prores"];
46
+ export type ServerlessCodec = (typeof serverlessCodecs)[number];
47
+ export type Privacy = 'public' | 'private' | 'no-acl';
48
+ export type DownloadBehavior = {
49
+ type: 'play-in-browser';
50
+ } | {
51
+ type: 'download';
52
+ fileName: string | null;
53
+ };
54
+ type Prettify<T> = {
55
+ [K in keyof T]: T[K];
56
+ } & {};
57
+ export type WebhookOption = Prettify<null | ({
58
+ url: string;
59
+ secret: string | null;
60
+ } & Partial<ToOptions<{
61
+ customData: typeof BrowserSafeApis.options.webhookCustomDataOption;
62
+ }>>)>;
63
+ export type ServerlessStatusPayload<Provider extends CloudProvider> = {
64
+ type: ServerlessRoutines.status;
65
+ bucketName: string;
66
+ renderId: string;
67
+ version: string;
68
+ logLevel: LogLevel;
69
+ forcePathStyle: boolean;
70
+ s3OutputProvider: CustomCredentials<Provider> | null;
71
+ };
72
+ export type ServerlessStartPayload<Provider extends CloudProvider> = {
73
+ rendererFunctionName: string | null;
74
+ type: ServerlessRoutines.start;
75
+ serveUrl: string;
76
+ composition: string;
77
+ framesPerLambda: number | null;
78
+ inputProps: SerializedInputProps;
79
+ codec: ServerlessCodec;
80
+ audioCodec: AudioCodec | null;
81
+ imageFormat: VideoImageFormat;
82
+ crf: number | undefined | null;
83
+ envVariables: Record<string, string> | undefined;
84
+ pixelFormat: PixelFormat | undefined | null;
85
+ proResProfile: ProResProfile | undefined | null;
86
+ x264Preset: X264Preset | null;
87
+ jpegQuality: number | undefined;
88
+ maxRetries: number;
89
+ privacy: Privacy;
90
+ logLevel: LogLevel;
91
+ frameRange: FrameRange | null;
92
+ outName: OutNameInput<Provider> | null;
93
+ timeoutInMilliseconds: number;
94
+ chromiumOptions: ChromiumOptions;
95
+ scale: number;
96
+ everyNthFrame: number;
97
+ numberOfGifLoops: number | null;
98
+ concurrencyPerLambda: number;
99
+ downloadBehavior: DownloadBehavior;
100
+ muted: boolean;
101
+ version: string;
102
+ overwrite: boolean;
103
+ audioBitrate: string | null;
104
+ videoBitrate: string | null;
105
+ encodingMaxRate: string | null;
106
+ encodingBufferSize: string | null;
107
+ webhook: WebhookOption;
108
+ forceHeight: number | null;
109
+ forceWidth: number | null;
110
+ bucketName: string | null;
111
+ offthreadVideoCacheSizeInBytes: number | null;
112
+ deleteAfter: DeleteAfter | null;
113
+ colorSpace: ColorSpace | null;
114
+ preferLossless: boolean;
115
+ forcePathStyle: boolean;
116
+ metadata: Record<string, string> | null;
117
+ apiKey: string | null;
118
+ };
119
+ export type ServerlessPayloads<Provider extends CloudProvider> = {
120
+ info: {
121
+ type: ServerlessRoutines.info;
122
+ logLevel: LogLevel;
123
+ };
124
+ start: ServerlessStartPayload<Provider>;
125
+ launch: {
126
+ rendererFunctionName: string | null;
127
+ type: ServerlessRoutines.launch;
128
+ serveUrl: string;
129
+ composition: string;
130
+ framesPerFunction: number | null;
131
+ bucketName: string;
132
+ inputProps: SerializedInputProps;
133
+ renderId: string;
134
+ imageFormat: VideoImageFormat;
135
+ codec: ServerlessCodec;
136
+ audioCodec: AudioCodec | null;
137
+ crf: number | null;
138
+ envVariables: Record<string, string> | undefined;
139
+ pixelFormat: PixelFormat | null;
140
+ proResProfile: ProResProfile | null;
141
+ x264Preset: X264Preset | null;
142
+ jpegQuality: number | undefined;
143
+ maxRetries: number;
144
+ privacy: Privacy;
145
+ logLevel: LogLevel;
146
+ frameRange: FrameRange | null;
147
+ outName: OutNameInput<Provider> | null;
148
+ timeoutInMilliseconds: number;
149
+ chromiumOptions: ChromiumOptions;
150
+ scale: number;
151
+ everyNthFrame: number;
152
+ numberOfGifLoops: number | null;
153
+ concurrencyPerFunction: number;
154
+ downloadBehavior: DownloadBehavior;
155
+ muted: boolean;
156
+ overwrite: boolean;
157
+ audioBitrate: string | null;
158
+ videoBitrate: string | null;
159
+ encodingMaxRate: string | null;
160
+ encodingBufferSize: string | null;
161
+ webhook: WebhookOption;
162
+ forceHeight: number | null;
163
+ forceWidth: number | null;
164
+ offthreadVideoCacheSizeInBytes: number | null;
165
+ deleteAfter: DeleteAfter | null;
166
+ colorSpace: ColorSpace | null;
167
+ preferLossless: boolean;
168
+ forcePathStyle: boolean;
169
+ metadata: Record<string, string> | null;
170
+ apiKey: string | null;
171
+ };
172
+ status: ServerlessStatusPayload<Provider>;
173
+ renderer: {
174
+ concurrencyPerLambda: number;
175
+ type: ServerlessRoutines.renderer;
176
+ serveUrl: string;
177
+ frameRange: [number, number];
178
+ chunk: number;
179
+ bucketName: string;
180
+ composition: string;
181
+ fps: number;
182
+ height: number;
183
+ width: number;
184
+ durationInFrames: number;
185
+ retriesLeft: number;
186
+ inputProps: SerializedInputProps;
187
+ renderId: string;
188
+ imageFormat: VideoImageFormat;
189
+ codec: ServerlessCodec;
190
+ crf: number | null;
191
+ proResProfile: ProResProfile | null;
192
+ x264Preset: X264Preset | null;
193
+ pixelFormat: PixelFormat | null;
194
+ jpegQuality: number | undefined;
195
+ envVariables: Record<string, string> | undefined;
196
+ privacy: Privacy;
197
+ attempt: number;
198
+ logLevel: LogLevel;
199
+ timeoutInMilliseconds: number;
200
+ chromiumOptions: ChromiumOptions;
201
+ resolvedProps: SerializedInputProps;
202
+ scale: number;
203
+ everyNthFrame: number;
204
+ muted: boolean;
205
+ audioBitrate: string | null;
206
+ videoBitrate: string | null;
207
+ encodingBufferSize: string | null;
208
+ encodingMaxRate: string | null;
209
+ launchFunctionConfig: {
210
+ version: string;
211
+ };
212
+ preferLossless: boolean;
213
+ offthreadVideoCacheSizeInBytes: number | null;
214
+ deleteAfter: DeleteAfter | null;
215
+ colorSpace: ColorSpace | null;
216
+ compositionStart: number;
217
+ framesPerLambda: number;
218
+ progressEveryNthFrame: number;
219
+ forcePathStyle: boolean;
220
+ metadata: Record<string, string> | null;
221
+ };
222
+ still: {
223
+ type: ServerlessRoutines.still;
224
+ serveUrl: string;
225
+ composition: string;
226
+ inputProps: SerializedInputProps;
227
+ imageFormat: StillImageFormat;
228
+ envVariables: Record<string, string>;
229
+ attempt: number;
230
+ jpegQuality: number | undefined;
231
+ maxRetries: number;
232
+ frame: number;
233
+ privacy: Privacy;
234
+ logLevel: LogLevel;
235
+ outName: OutNameInput<Provider> | null;
236
+ timeoutInMilliseconds: number;
237
+ chromiumOptions: ChromiumOptions;
238
+ scale: number;
239
+ downloadBehavior: DownloadBehavior;
240
+ version: string;
241
+ forceHeight: number | null;
242
+ forceWidth: number | null;
243
+ bucketName: string | null;
244
+ offthreadVideoCacheSizeInBytes: number | null;
245
+ deleteAfter: DeleteAfter | null;
246
+ streamed: boolean;
247
+ forcePathStyle: boolean;
248
+ apiKey: string | null;
249
+ };
250
+ compositions: {
251
+ type: ServerlessRoutines.compositions;
252
+ version: string;
253
+ chromiumOptions: ChromiumOptions;
254
+ logLevel: LogLevel;
255
+ inputProps: SerializedInputProps;
256
+ envVariables: Record<string, string> | undefined;
257
+ timeoutInMilliseconds: number;
258
+ serveUrl: string;
259
+ bucketName: string | null;
260
+ offthreadVideoCacheSizeInBytes: number | null;
261
+ forcePathStyle: boolean;
262
+ };
263
+ };
264
+ export type ServerlessPayload<Provider extends CloudProvider> = ServerlessPayloads<Provider>[ServerlessRoutines];
265
+ export type OutNameOutput<Provider extends CloudProvider> = {
266
+ renderBucketName: string;
267
+ key: string;
268
+ customCredentials: CustomCredentials<Provider> | null;
269
+ };
270
+ export type OutNameInputWithoutCredentials = string | {
271
+ bucketName: string;
272
+ key: string;
273
+ s3OutputProvider?: CustomCredentialsWithoutSensitiveData;
274
+ };
275
+ export declare const rendersPrefix: (renderId: string) => string;
276
+ export declare const outStillName: (renderId: string, imageFormat: StillImageFormat) => string;
277
+ export declare const outName: (renderId: string, extension: string) => string;
278
+ export declare const customOutName: <Provider extends CloudProvider>(renderId: string, bucketName: string, name: OutNameInput<Provider>) => OutNameOutput<Provider>;
279
+ export declare const overallProgressKey: (renderId: string) => string;
280
+ export declare const artifactName: (renderId: string, name: string) => string;
281
+ export type PostRenderData<Provider extends CloudProvider> = {
282
+ cost: AfterRenderCost;
283
+ outputFile: string;
284
+ outputSize: number;
285
+ renderSize: number;
286
+ timeToFinish: number;
287
+ timeToRenderFrames: number;
288
+ errors: EnhancedErrorInfo[];
289
+ startTime: number;
290
+ endTime: number;
291
+ filesCleanedUp: number;
292
+ timeToEncode: number;
293
+ timeToCleanUp: number;
294
+ timeToRenderChunks: number;
295
+ retriesInfo: ChunkRetry[];
296
+ mostExpensiveFrameRanges: ExpensiveChunk[] | undefined;
297
+ estimatedBillingDurationInMilliseconds: number;
298
+ deleteAfter: DeleteAfter | null;
299
+ timeToCombine: number | null;
300
+ artifactProgress: ReceivedArtifact<Provider>[];
301
+ };
302
+ export type AfterRenderCost = {
303
+ estimatedCost: number;
304
+ estimatedDisplayCost: string;
305
+ currency: string;
306
+ disclaimer: string;
307
+ };
308
+ export declare const CONCAT_FOLDER_TOKEN = "remotion-concat";
309
+ export declare const MAX_FUNCTIONS_PER_RENDER = 200;
310
+ export declare const MINIMUM_FRAMES_PER_FUNCTIONS = 4;
311
+ export declare const REMOTION_CONCATENATED_TOKEN = "remotion-concatenated-token";
312
+ export declare const REMOTION_FILELIST_TOKEN = "remotion-filelist";
313
+ export declare const RENDERER_PATH_TOKEN = "remotion-bucket";
314
+ export {};
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RENDERER_PATH_TOKEN = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATENATED_TOKEN = exports.MINIMUM_FRAMES_PER_FUNCTIONS = exports.MAX_FUNCTIONS_PER_RENDER = exports.CONCAT_FOLDER_TOKEN = exports.artifactName = exports.overallProgressKey = exports.customOutName = exports.outName = exports.outStillName = exports.rendersPrefix = exports.serverlessCodecs = exports.ServerlessRoutines = exports.expiryDays = exports.COMMAND_NOT_FOUND = void 0;
4
+ exports.COMMAND_NOT_FOUND = 'Command not found';
5
+ // Needs to be in sync with renderer/src/options/delete-after.ts#L7
6
+ exports.expiryDays = {
7
+ '1-day': 1,
8
+ '3-days': 3,
9
+ '7-days': 7,
10
+ '30-days': 30,
11
+ };
12
+ var ServerlessRoutines;
13
+ (function (ServerlessRoutines) {
14
+ ServerlessRoutines["info"] = "info";
15
+ ServerlessRoutines["start"] = "start";
16
+ ServerlessRoutines["launch"] = "launch";
17
+ ServerlessRoutines["status"] = "status";
18
+ ServerlessRoutines["renderer"] = "renderer";
19
+ ServerlessRoutines["still"] = "still";
20
+ ServerlessRoutines["compositions"] = "compositions";
21
+ })(ServerlessRoutines || (exports.ServerlessRoutines = ServerlessRoutines = {}));
22
+ exports.serverlessCodecs = [
23
+ 'h264',
24
+ 'h265',
25
+ 'vp8',
26
+ 'vp9',
27
+ 'mp3',
28
+ 'aac',
29
+ 'wav',
30
+ 'gif',
31
+ 'prores',
32
+ ];
33
+ const rendersPrefix = (renderId) => `renders/${renderId}`;
34
+ exports.rendersPrefix = rendersPrefix;
35
+ const outStillName = (renderId, imageFormat) => `${(0, exports.rendersPrefix)(renderId)}/out.${imageFormat}`;
36
+ exports.outStillName = outStillName;
37
+ const outName = (renderId, extension) => `${(0, exports.rendersPrefix)(renderId)}/out.${extension}`;
38
+ exports.outName = outName;
39
+ const customOutName = (renderId, bucketName, name) => {
40
+ var _a;
41
+ if (typeof name === 'string') {
42
+ return {
43
+ renderBucketName: bucketName,
44
+ key: `${(0, exports.rendersPrefix)(renderId)}/${name}`,
45
+ customCredentials: null,
46
+ };
47
+ }
48
+ return {
49
+ key: name.key,
50
+ renderBucketName: name.bucketName,
51
+ customCredentials: (_a = name.s3OutputProvider) !== null && _a !== void 0 ? _a : null,
52
+ };
53
+ };
54
+ exports.customOutName = customOutName;
55
+ const overallProgressKey = (renderId) => `${(0, exports.rendersPrefix)(renderId)}/progress.json`;
56
+ exports.overallProgressKey = overallProgressKey;
57
+ const artifactName = (renderId, name) => `${(0, exports.rendersPrefix)(renderId)}/artifacts/${name}`;
58
+ exports.artifactName = artifactName;
59
+ exports.CONCAT_FOLDER_TOKEN = 'remotion-concat';
60
+ exports.MAX_FUNCTIONS_PER_RENDER = 200;
61
+ exports.MINIMUM_FRAMES_PER_FUNCTIONS = 4;
62
+ exports.REMOTION_CONCATENATED_TOKEN = 'remotion-concatenated-token';
63
+ exports.REMOTION_FILELIST_TOKEN = 'remotion-filelist';
64
+ exports.RENDERER_PATH_TOKEN = 'remotion-bucket';
@@ -0,0 +1 @@
1
+ export declare const DOCS_URL = "https://remotion.dev";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCS_URL = void 0;
4
+ exports.DOCS_URL = 'https://remotion.dev';
@@ -0,0 +1,3 @@
1
+ export declare const errorIsOutOfSpaceError: (err: string) => boolean;
2
+ export declare const isErrInsufficientResourcesErr: (err: string) => boolean;
3
+ export declare const isBrowserCrashedError: (err: string) => boolean;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBrowserCrashedError = exports.isErrInsufficientResourcesErr = exports.errorIsOutOfSpaceError = void 0;
4
+ const errorIsOutOfSpaceError = (err) => {
5
+ return (err.includes('ENOSPC') ||
6
+ err.toLowerCase().includes('no space left on device'));
7
+ };
8
+ exports.errorIsOutOfSpaceError = errorIsOutOfSpaceError;
9
+ const isErrInsufficientResourcesErr = (err) => {
10
+ return err.includes('net::ERR_INSUFFICIENT_RESOURCES');
11
+ };
12
+ exports.isErrInsufficientResourcesErr = isErrInsufficientResourcesErr;
13
+ const isBrowserCrashedError = (err) => {
14
+ return err.includes('Target closed.') || err.includes('Session closed');
15
+ };
16
+ exports.isBrowserCrashedError = isBrowserCrashedError;