@remotion/lambda 4.0.256 → 4.0.257

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 (126) hide show
  1. package/package.json +12 -12
  2. package/remotionlambda-arm64.zip +0 -0
  3. package/dist/api/__mocks__/clean-items.d.ts +0 -2
  4. package/dist/api/__mocks__/clean-items.js +0 -24
  5. package/dist/api/__mocks__/create-function.d.ts +0 -2
  6. package/dist/api/__mocks__/create-function.js +0 -21
  7. package/dist/api/__mocks__/delete-function.d.ts +0 -2
  8. package/dist/api/__mocks__/delete-function.js +0 -9
  9. package/dist/api/__mocks__/get-functions.d.ts +0 -2
  10. package/dist/api/__mocks__/get-functions.js +0 -9
  11. package/dist/api/__mocks__/upload-dir.d.ts +0 -3
  12. package/dist/api/__mocks__/upload-dir.js +0 -47
  13. package/dist/api/mock-functions.d.ts +0 -18
  14. package/dist/api/mock-functions.js +0 -36
  15. package/dist/cli/helpers/__mocks__/quit.d.ts +0 -1
  16. package/dist/cli/helpers/__mocks__/quit.js +0 -7
  17. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +0 -7
  18. package/dist/functions/chunk-optimization/plan-frame-ranges.js +0 -17
  19. package/dist/functions/chunk-optimization/types.d.ts +0 -8
  20. package/dist/functions/chunk-optimization/types.js +0 -2
  21. package/dist/functions/helpers/__mocks__/get-browser-instance.d.ts +0 -3
  22. package/dist/functions/helpers/__mocks__/get-browser-instance.js +0 -12
  23. package/dist/functions/helpers/__mocks__/leak-detection.d.ts +0 -4
  24. package/dist/functions/helpers/__mocks__/leak-detection.js +0 -9
  25. package/dist/functions/helpers/__mocks__/timer.d.ts +0 -2
  26. package/dist/functions/helpers/__mocks__/timer.js +0 -10
  27. package/dist/functions/helpers/best-frames-per-lambda-param.d.ts +0 -1
  28. package/dist/functions/helpers/best-frames-per-lambda-param.js +0 -17
  29. package/dist/functions/helpers/calculate-chunk-times.d.ts +0 -5
  30. package/dist/functions/helpers/calculate-chunk-times.js +0 -29
  31. package/dist/functions/helpers/calculate-price-from-bucket.d.ts +0 -15
  32. package/dist/functions/helpers/calculate-price-from-bucket.js +0 -30
  33. package/dist/functions/helpers/can-concat-seamlessly.d.ts +0 -3
  34. package/dist/functions/helpers/can-concat-seamlessly.js +0 -17
  35. package/dist/functions/helpers/cleanup-props.d.ts +0 -8
  36. package/dist/functions/helpers/cleanup-props.js +0 -23
  37. package/dist/functions/helpers/concat-videos.d.ts +0 -23
  38. package/dist/functions/helpers/concat-videos.js +0 -54
  39. package/dist/functions/helpers/create-post-render-data.d.ts +0 -17
  40. package/dist/functions/helpers/create-post-render-data.js +0 -67
  41. package/dist/functions/helpers/find-output-file-in-bucket.d.ts +0 -14
  42. package/dist/functions/helpers/find-output-file-in-bucket.js +0 -38
  43. package/dist/functions/helpers/format-costs-info.d.ts +0 -2
  44. package/dist/functions/helpers/format-costs-info.js +0 -23
  45. package/dist/functions/helpers/get-overall-progress-s3.d.ts +0 -10
  46. package/dist/functions/helpers/get-overall-progress-s3.js +0 -24
  47. package/dist/functions/helpers/get-overall-progress.d.ts +0 -9
  48. package/dist/functions/helpers/get-overall-progress.js +0 -23
  49. package/dist/functions/helpers/get-progress.d.ts +0 -15
  50. package/dist/functions/helpers/get-progress.js +0 -254
  51. package/dist/functions/helpers/get-retry-stats.d.ts +0 -5
  52. package/dist/functions/helpers/get-retry-stats.js +0 -2
  53. package/dist/functions/helpers/inspect-errors.d.ts +0 -4
  54. package/dist/functions/helpers/inspect-errors.js +0 -39
  55. package/dist/functions/helpers/is-warm.d.ts +0 -2
  56. package/dist/functions/helpers/is-warm.js +0 -10
  57. package/dist/functions/helpers/leak-detection.d.ts +0 -4
  58. package/dist/functions/helpers/leak-detection.js +0 -40
  59. package/dist/functions/helpers/make-timeout-error.d.ts +0 -10
  60. package/dist/functions/helpers/make-timeout-error.js +0 -31
  61. package/dist/functions/helpers/make-timeout-message.d.ts +0 -10
  62. package/dist/functions/helpers/make-timeout-message.js +0 -75
  63. package/dist/functions/helpers/merge-chunks.d.ts +0 -36
  64. package/dist/functions/helpers/merge-chunks.js +0 -84
  65. package/dist/functions/helpers/min-max.d.ts +0 -2
  66. package/dist/functions/helpers/min-max.js +0 -33
  67. package/dist/functions/helpers/on-downloads-logger.d.ts +0 -2
  68. package/dist/functions/helpers/on-downloads-logger.js +0 -29
  69. package/dist/functions/helpers/overall-render-progress.d.ts +0 -59
  70. package/dist/functions/helpers/overall-render-progress.js +0 -180
  71. package/dist/functions/helpers/print-concurrency-curve.d.ts +0 -1
  72. package/dist/functions/helpers/print-concurrency-curve.js +0 -8
  73. package/dist/functions/helpers/print-logging-helper.d.ts +0 -4
  74. package/dist/functions/helpers/print-logging-helper.js +0 -12
  75. package/dist/functions/helpers/render-has-audio-video.d.ts +0 -6
  76. package/dist/functions/helpers/render-has-audio-video.js +0 -21
  77. package/dist/functions/helpers/request-context.d.ts +0 -5
  78. package/dist/functions/helpers/request-context.js +0 -2
  79. package/dist/functions/helpers/stream-renderer.d.ts +0 -17
  80. package/dist/functions/helpers/stream-renderer.js +0 -148
  81. package/dist/functions/launch.d.ts +0 -10
  82. package/dist/functions/launch.js +0 -595
  83. package/dist/functions/progress.d.ts +0 -11
  84. package/dist/functions/progress.js +0 -51
  85. package/dist/functions/renderer.d.ts +0 -17
  86. package/dist/functions/renderer.js +0 -341
  87. package/dist/functions/start.d.ts +0 -13
  88. package/dist/functions/start.js +0 -112
  89. package/dist/functions/still.d.ts +0 -19
  90. package/dist/functions/still.js +0 -329
  91. package/dist/shared/__mocks__/aws-clients.d.ts +0 -2
  92. package/dist/shared/__mocks__/aws-clients.js +0 -62
  93. package/dist/shared/__mocks__/bundle-site.d.ts +0 -2
  94. package/dist/shared/__mocks__/bundle-site.js +0 -32
  95. package/dist/shared/__mocks__/check-credentials.d.ts +0 -1
  96. package/dist/shared/__mocks__/check-credentials.js +0 -5
  97. package/dist/shared/__mocks__/get-account-id.d.ts +0 -2
  98. package/dist/shared/__mocks__/get-account-id.js +0 -11
  99. package/dist/shared/__mocks__/read-dir.d.ts +0 -2
  100. package/dist/shared/__mocks__/read-dir.js +0 -13
  101. package/dist/shared/call-lambda.d.ts +0 -16
  102. package/dist/shared/call-lambda.js +0 -149
  103. package/dist/shared/cleanup-serialized-input-props.d.ts +0 -14
  104. package/dist/shared/cleanup-serialized-input-props.js +0 -34
  105. package/dist/shared/docs-url.d.ts +0 -1
  106. package/dist/shared/docs-url.js +0 -4
  107. package/dist/shared/get-most-expensive-chunks.d.ts +0 -8
  108. package/dist/shared/get-most-expensive-chunks.js +0 -28
  109. package/dist/shared/invoke-webhook.d.ts +0 -48
  110. package/dist/shared/invoke-webhook.js +0 -140
  111. package/dist/shared/parse-lambda-timings-key.d.ts +0 -5
  112. package/dist/shared/parse-lambda-timings-key.js +0 -2
  113. package/dist/shared/return-values.d.ts +0 -16
  114. package/dist/shared/return-values.js +0 -2
  115. package/dist/shared/stackback.d.ts +0 -6
  116. package/dist/shared/stackback.js +0 -59
  117. package/dist/shared/validate-download-behavior.d.ts +0 -1
  118. package/dist/shared/validate-download-behavior.js +0 -21
  119. package/dist/shared/validate-frames-per-lambda.d.ts +0 -4
  120. package/dist/shared/validate-frames-per-lambda.js +0 -29
  121. package/dist/shared/validate-privacy.d.ts +0 -2
  122. package/dist/shared/validate-privacy.js +0 -14
  123. package/dist/shared/validate.d.ts +0 -4
  124. package/dist/shared/validate.js +0 -8
  125. package/dist/shared/why-is-node-running.d.ts +0 -15
  126. package/dist/shared/why-is-node-running.js +0 -88
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda"
4
4
  },
5
5
  "name": "@remotion/lambda",
6
- "version": "4.0.256",
6
+ "version": "4.0.257",
7
7
  "description": "Render Remotion videos on AWS Lambda",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -22,13 +22,13 @@
22
22
  "@smithy/abort-controller": "3.1.1",
23
23
  "mime-types": "2.1.34",
24
24
  "zod": "3.22.3",
25
- "@remotion/bundler": "4.0.256",
26
- "@remotion/serverless": "4.0.256",
27
- "@remotion/cli": "4.0.256",
28
- "remotion": "4.0.256",
29
- "@remotion/studio-server": "4.0.256",
30
- "@remotion/renderer": "4.0.256",
31
- "@remotion/streaming": "4.0.256"
25
+ "@remotion/bundler": "4.0.257",
26
+ "@remotion/serverless": "4.0.257",
27
+ "@remotion/renderer": "4.0.257",
28
+ "@remotion/cli": "4.0.257",
29
+ "@remotion/streaming": "4.0.257",
30
+ "@remotion/studio-server": "4.0.257",
31
+ "remotion": "4.0.257"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/express": "^5.0.0",
@@ -40,12 +40,12 @@
40
40
  "next": "15.1.2",
41
41
  "pureimage": "0.4.13",
42
42
  "zip-lib": "^0.7.2",
43
- "@remotion/bundler": "4.0.256",
44
- "@remotion/compositor-linux-arm64-gnu": "4.0.256",
45
- "@remotion/eslint-config-internal": "4.0.256"
43
+ "@remotion/bundler": "4.0.257",
44
+ "@remotion/compositor-linux-arm64-gnu": "4.0.257",
45
+ "@remotion/eslint-config-internal": "4.0.257"
46
46
  },
47
47
  "peerDependencies": {
48
- "@remotion/bundler": "4.0.256"
48
+ "@remotion/bundler": "4.0.257"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
Binary file
@@ -1,2 +0,0 @@
1
- import type { cleanItems as original } from '../clean-items';
2
- export declare const cleanItems: typeof original;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanItems = void 0;
4
- const mock_store_1 = require("../../test/mocks/mock-store");
5
- const cleanItems = (input) => {
6
- var _a, _b;
7
- for (const item of input.list) {
8
- (_a = input.onBeforeItemDeleted) === null || _a === void 0 ? void 0 : _a.call(input, {
9
- bucketName: input.bucket,
10
- itemName: item,
11
- });
12
- (0, mock_store_1.mockDeleteS3File)({
13
- key: item,
14
- bucketName: input.bucket,
15
- region: input.region,
16
- });
17
- (_b = input.onAfterItemDeleted) === null || _b === void 0 ? void 0 : _b.call(input, {
18
- bucketName: input.bucket,
19
- itemName: item,
20
- });
21
- }
22
- return Promise.resolve([]);
23
- };
24
- exports.cleanItems = cleanItems;
@@ -1,2 +0,0 @@
1
- import type { createFunction as original } from '../create-function';
2
- export declare const createFunction: typeof original;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFunction = void 0;
4
- const version_1 = require("remotion/version");
5
- const defaults_1 = require("../../defaults");
6
- const mock_functions_1 = require("../mock-functions");
7
- const createFunction = (input) => {
8
- if (!input.alreadyCreated) {
9
- (0, mock_functions_1.addFunction)({
10
- functionName: input.functionName,
11
- memorySizeInMb: defaults_1.DEFAULT_MEMORY_SIZE,
12
- timeoutInSeconds: input.timeoutInSeconds,
13
- version: version_1.VERSION,
14
- diskSizeInMb: defaults_1.DEFAULT_EPHEMERAL_STORAGE_IN_MB,
15
- }, input.region);
16
- }
17
- return Promise.resolve({
18
- FunctionName: input.functionName,
19
- });
20
- };
21
- exports.createFunction = createFunction;
@@ -1,2 +0,0 @@
1
- import type { deleteFunction as original } from '../delete-function';
2
- export declare const deleteFunction: typeof original;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteFunction = void 0;
4
- const mock_functions_1 = require("../mock-functions");
5
- const deleteFunction = ({ region, functionName }) => {
6
- (0, mock_functions_1.deleteMockFunction)(functionName, region);
7
- return Promise.resolve();
8
- };
9
- exports.deleteFunction = deleteFunction;
@@ -1,2 +0,0 @@
1
- import type { getFunctions as original } from '../get-functions';
2
- export declare const getFunctions: typeof original;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFunctions = void 0;
4
- const version_1 = require("remotion/version");
5
- const mock_functions_1 = require("../mock-functions");
6
- const getFunctions = ({ region, compatibleOnly }) => {
7
- return Promise.resolve((0, mock_functions_1.getAllMockFunctions)(region, compatibleOnly ? version_1.VERSION : null));
8
- };
9
- exports.getFunctions = getFunctions;
@@ -1,3 +0,0 @@
1
- import type { MockFile, uploadDir as original } from '../upload-dir';
2
- export declare const getDirFiles: (dir: string) => MockFile[];
3
- export declare const uploadDir: typeof original;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadDir = exports.getDirFiles = void 0;
4
- const mock_store_1 = require("../../test/mocks/mock-store");
5
- const getDirFiles = (dir) => {
6
- if (dir === '/path/to/bundle-1') {
7
- return [
8
- {
9
- name: 'bundle.js',
10
- content: 'console.log("Hello World")',
11
- },
12
- {
13
- name: 'styles.css',
14
- content: 'body {background: red}',
15
- },
16
- ];
17
- }
18
- if (dir === '/path/to/bundle-2') {
19
- return [
20
- {
21
- name: 'bundle.js',
22
- content: 'console.log("Hello World")',
23
- },
24
- {
25
- name: 'styles2.css',
26
- content: 'body {background: red}',
27
- },
28
- ];
29
- }
30
- throw new Error('could not get dir for ' + dir);
31
- };
32
- exports.getDirFiles = getDirFiles;
33
- const uploadDir = (input) => {
34
- const files = (0, exports.getDirFiles)(input.localDir);
35
- for (const file of files) {
36
- (0, mock_store_1.writeMockS3File)({
37
- privacy: input.privacy,
38
- bucketName: input.bucket,
39
- body: file.content,
40
- // Should not use path.join here because on Windows it's not / separator
41
- key: [input.keyPrefix, file.name].join('/'),
42
- region: input.region,
43
- });
44
- }
45
- return Promise.resolve();
46
- };
47
- exports.uploadDir = uploadDir;
@@ -1,18 +0,0 @@
1
- import type { AwsRegion } from '../regions';
2
- import type { FunctionInfo } from './get-function-info';
3
- export declare let mockFunctionsStore: (FunctionInfo & {
4
- region: AwsRegion;
5
- version: string;
6
- })[];
7
- export declare const addFunction: (fn: FunctionInfo, region: AwsRegion) => void;
8
- export declare const deleteMockFunction: (name: string, region: string) => void;
9
- export declare const findFunction: (name: string, region: string) => (FunctionInfo & {
10
- region: AwsRegion;
11
- version: string;
12
- }) | undefined;
13
- export declare const getAllMockFunctions: (region: string, version: string | null) => (FunctionInfo & {
14
- region: AwsRegion;
15
- version: string;
16
- })[];
17
- export declare const cleanFnStore: () => void;
18
- export declare const markFunctionAsIncompatible: (functionName: string) => void;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.markFunctionAsIncompatible = exports.cleanFnStore = exports.getAllMockFunctions = exports.findFunction = exports.deleteMockFunction = exports.addFunction = exports.mockFunctionsStore = void 0;
4
- exports.mockFunctionsStore = [];
5
- const addFunction = (fn, region) => {
6
- exports.mockFunctionsStore.push({
7
- ...fn,
8
- region,
9
- version: fn.version,
10
- });
11
- };
12
- exports.addFunction = addFunction;
13
- const deleteMockFunction = (name, region) => {
14
- exports.mockFunctionsStore = exports.mockFunctionsStore.filter((fn) => fn.functionName !== name && fn.region !== region);
15
- };
16
- exports.deleteMockFunction = deleteMockFunction;
17
- const findFunction = (name, region) => {
18
- return exports.mockFunctionsStore.find((n) => n.functionName === name && region === n.region);
19
- };
20
- exports.findFunction = findFunction;
21
- const getAllMockFunctions = (region, version) => {
22
- return exports.mockFunctionsStore.filter((f) => f.region === region && (version ? f.version === version : true));
23
- };
24
- exports.getAllMockFunctions = getAllMockFunctions;
25
- const cleanFnStore = () => {
26
- exports.mockFunctionsStore = [];
27
- };
28
- exports.cleanFnStore = cleanFnStore;
29
- const markFunctionAsIncompatible = (functionName) => {
30
- for (const fn of exports.mockFunctionsStore) {
31
- if (fn.functionName === functionName) {
32
- fn.version = '2021-06-23';
33
- }
34
- }
35
- };
36
- exports.markFunctionAsIncompatible = markFunctionAsIncompatible;
@@ -1 +0,0 @@
1
- export declare const quit: (exitCode: number) => never;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.quit = void 0;
4
- const quit = (exitCode) => {
5
- throw new Error(`Exited process with code ${exitCode}`);
6
- };
7
- exports.quit = quit;
@@ -1,7 +0,0 @@
1
- export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFrame, }: {
2
- framesPerLambda: number;
3
- frameRange: [number, number];
4
- everyNthFrame: number;
5
- }) => {
6
- chunks: [number, number][];
7
- };
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.planFrameRanges = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- const planFrameRanges = ({ framesPerLambda, frameRange, everyNthFrame, }) => {
6
- const framesToRender = renderer_1.RenderInternals.getFramesToRender(frameRange, everyNthFrame);
7
- const chunkCount = Math.ceil(framesToRender.length / framesPerLambda);
8
- const firstFrame = frameRange[0];
9
- return {
10
- chunks: new Array(chunkCount).fill(1).map((_, i) => {
11
- const start = i * framesPerLambda * everyNthFrame + firstFrame;
12
- const end = Math.min(framesToRender[framesToRender.length - 1], (i + 1) * framesPerLambda * everyNthFrame - 1 + firstFrame);
13
- return [start, end];
14
- }),
15
- };
16
- };
17
- exports.planFrameRanges = planFrameRanges;
@@ -1,8 +0,0 @@
1
- export type ObjectChunkTimingData = {
2
- chunk: number;
3
- frameRange: [number, number];
4
- startDate: number;
5
- timings: {
6
- [key: number]: number;
7
- };
8
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- import type { forgetBrowserEventLoop as originalForget, getBrowserInstance as originalGetBrowserInstance } from '@remotion/serverless';
2
- export declare const getBrowserInstance: typeof originalGetBrowserInstance;
3
- export declare const forgetBrowserEventLoop: typeof originalForget;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forgetBrowserEventLoop = exports.getBrowserInstance = void 0;
4
- const renderer_1 = require("@remotion/renderer");
5
- let _browserInstance;
6
- const getBrowserInstance = async () => {
7
- _browserInstance = await (0, renderer_1.openBrowser)('chrome');
8
- return { instance: _browserInstance, configurationString: 'chrome' };
9
- };
10
- exports.getBrowserInstance = getBrowserInstance;
11
- const forgetBrowserEventLoop = () => { };
12
- exports.forgetBrowserEventLoop = forgetBrowserEventLoop;
@@ -1,4 +0,0 @@
1
- import type { setCurrentRequestId as originalSetCurrentRequestId, startLeakDetection as originalStartLeakDetection, stopLeakDetection as originalStopLeakDetection } from '../leak-detection';
2
- export declare const stopLeakDetection: typeof originalStopLeakDetection;
3
- export declare const setCurrentRequestId: typeof originalSetCurrentRequestId;
4
- export declare const startLeakDetection: typeof originalStartLeakDetection;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.startLeakDetection = exports.setCurrentRequestId = exports.stopLeakDetection = void 0;
4
- const stopLeakDetection = () => { };
5
- exports.stopLeakDetection = stopLeakDetection;
6
- const setCurrentRequestId = () => { };
7
- exports.setCurrentRequestId = setCurrentRequestId;
8
- const startLeakDetection = () => { };
9
- exports.startLeakDetection = startLeakDetection;
@@ -1,2 +0,0 @@
1
- import type { timer as original } from '../../../functions/helpers/timer';
2
- export declare const timer: typeof original;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timer = void 0;
4
- // Turn off timers while in testing. very noisy.
5
- const timer = () => {
6
- return {
7
- end: () => undefined,
8
- };
9
- };
10
- exports.timer = timer;
@@ -1 +0,0 @@
1
- export declare const bestFramesPerLambdaParam: (frameCount: number) => number;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bestFramesPerLambdaParam = void 0;
4
- const no_react_1 = require("remotion/no-react");
5
- // Always update the code in docs/lambda/concurrency.md too
6
- const bestFramesPerLambdaParam = (frameCount) => {
7
- // Between 0 and 10 minutes (at 30fps), interpolate the concurrency from 75 to 150
8
- const concurrency = (0, no_react_1.interpolate)(frameCount, [0, 18000], [75, 150], {
9
- extrapolateRight: 'clamp',
10
- });
11
- // At least have 20 as a `framesPerLambda` value
12
- const framesPerLambda = Math.max(frameCount / concurrency, 20);
13
- // Evenly distribute: For 21 frames over 2 lambda functions, distribute as 11 + 10 ==> framesPerLambda = 11
14
- const lambdasNeeded = Math.ceil(frameCount / framesPerLambda);
15
- return Math.ceil(frameCount / lambdasNeeded);
16
- };
17
- exports.bestFramesPerLambdaParam = bestFramesPerLambdaParam;
@@ -1,5 +0,0 @@
1
- import type { ParsedTiming } from '../../shared/parse-lambda-timings-key';
2
- export declare const calculateChunkTimes: ({ type, timings, }: {
3
- type: "combined-time-for-cost-calculation" | "absolute-time";
4
- timings: ParsedTiming[];
5
- }) => number;
@@ -1,29 +0,0 @@
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;
@@ -1,15 +0,0 @@
1
- import type { CloudProvider } from '@remotion/serverless';
2
- import type { RenderMetadata } from '@remotion/serverless/client';
3
- import type { AwsRegion } from '../../regions';
4
- import type { ParsedTiming } from '../../shared/parse-lambda-timings-key';
5
- export declare const estimatePriceFromBucket: <Provider extends CloudProvider>({ renderMetadata, memorySizeInMb, diskSizeInMb, lambdasInvoked, timings, region, }: {
6
- renderMetadata: RenderMetadata<Provider> | null;
7
- memorySizeInMb: number;
8
- diskSizeInMb: number;
9
- lambdasInvoked: number;
10
- timings: ParsedTiming[];
11
- region: AwsRegion;
12
- }) => {
13
- accruedSoFar: number;
14
- estimatedBillingDurationInMilliseconds: number;
15
- } | null;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.estimatePriceFromBucket = void 0;
4
- const estimate_price_1 = require("../../api/estimate-price");
5
- const calculate_chunk_times_1 = require("./calculate-chunk-times");
6
- const estimatePriceFromBucket = ({ renderMetadata, memorySizeInMb, diskSizeInMb, lambdasInvoked, timings, region, }) => {
7
- var _a, _b;
8
- if (!renderMetadata) {
9
- return null;
10
- }
11
- const elapsedTime = Math.max(0, Date.now() - ((_a = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.startedDate) !== null && _a !== void 0 ? _a : 0));
12
- const unfinished = Math.max(0, ((_b = renderMetadata === null || renderMetadata === void 0 ? void 0 : renderMetadata.totalChunks) !== null && _b !== void 0 ? _b : 0) - timings.length);
13
- const timeElapsedOfUnfinished = new Array(unfinished)
14
- .fill(true)
15
- .map(() => elapsedTime)
16
- .reduce((a, b) => a + b, 0);
17
- const estimatedBillingDurationInMilliseconds = (0, calculate_chunk_times_1.calculateChunkTimes)({
18
- type: 'combined-time-for-cost-calculation',
19
- timings,
20
- }) + timeElapsedOfUnfinished;
21
- const accruedSoFar = Number((0, estimate_price_1.estimatePrice)({
22
- region,
23
- durationInMilliseconds: estimatedBillingDurationInMilliseconds,
24
- memorySizeInMb,
25
- diskSizeInMb,
26
- lambdasInvoked,
27
- }).toPrecision(5));
28
- return { accruedSoFar, estimatedBillingDurationInMilliseconds };
29
- };
30
- exports.estimatePriceFromBucket = estimatePriceFromBucket;
@@ -1,3 +0,0 @@
1
- import type { AudioCodec, Codec } from '@remotion/renderer';
2
- export declare const canConcatAudioSeamlessly: (audioCodec: AudioCodec | null, chunkDurationInFrames: number) => boolean;
3
- export declare const canConcatVideoSeamlessly: (codec: Codec) => codec is "h264";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canConcatVideoSeamlessly = exports.canConcatAudioSeamlessly = void 0;
4
- // Cannot do WAV yet, because currently assumes AAC in+outpoint
5
- const canConcatAudioSeamlessly = (audioCodec, chunkDurationInFrames) => {
6
- // Rendering a chunk that is too small generates too much overhead
7
- // and is currently buggy
8
- if (chunkDurationInFrames <= 4) {
9
- return false;
10
- }
11
- return audioCodec === 'aac';
12
- };
13
- exports.canConcatAudioSeamlessly = canConcatAudioSeamlessly;
14
- const canConcatVideoSeamlessly = (codec) => {
15
- return codec === 'h264';
16
- };
17
- exports.canConcatVideoSeamlessly = canConcatVideoSeamlessly;
@@ -1,8 +0,0 @@
1
- import type { CloudProvider, ProviderSpecifics } from '@remotion/serverless';
2
- import type { SerializedInputProps } from '@remotion/serverless/client';
3
- export declare const cleanupProps: <Provider extends CloudProvider>({ serializedResolvedProps, inputProps, providerSpecifics, forcePathStyle, }: {
4
- serializedResolvedProps: SerializedInputProps;
5
- inputProps: SerializedInputProps;
6
- providerSpecifics: ProviderSpecifics<Provider>;
7
- forcePathStyle: boolean;
8
- }) => Promise<[number, number]>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanupProps = void 0;
4
- const cleanup_serialized_input_props_1 = require("../../shared/cleanup-serialized-input-props");
5
- const cleanupProps = ({ serializedResolvedProps, inputProps, providerSpecifics, forcePathStyle, }) => {
6
- const cleanupSerializedInputPropsProm = (0, cleanup_serialized_input_props_1.cleanupSerializedInputProps)({
7
- region: providerSpecifics.getCurrentRegionInFunction(),
8
- serialized: inputProps,
9
- providerSpecifics,
10
- forcePathStyle,
11
- });
12
- const cleanupResolvedInputPropsProm = (0, cleanup_serialized_input_props_1.cleanupSerializedResolvedProps)({
13
- region: providerSpecifics.getCurrentRegionInFunction(),
14
- serialized: serializedResolvedProps,
15
- providerSpecifics,
16
- forcePathStyle,
17
- });
18
- return Promise.all([
19
- cleanupSerializedInputPropsProm,
20
- cleanupResolvedInputPropsProm,
21
- ]);
22
- };
23
- exports.cleanupProps = cleanupProps;
@@ -1,23 +0,0 @@
1
- import type { AudioCodec, CancelSignal, LogLevel } from '@remotion/renderer';
2
- import type { ServerlessCodec } from '@remotion/serverless/client';
3
- export declare const concatVideos: ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, muted, metadata, }: {
4
- onProgress: (frames: number) => void;
5
- numberOfFrames: number;
6
- codec: ServerlessCodec;
7
- fps: number;
8
- numberOfGifLoops: number | null;
9
- files: string[];
10
- outdir: string;
11
- audioCodec: AudioCodec | null;
12
- audioBitrate: string | null;
13
- logLevel: LogLevel;
14
- framesPerLambda: number;
15
- binariesDirectory: string | null;
16
- cancelSignal: CancelSignal | undefined;
17
- preferLossless: boolean;
18
- muted: boolean;
19
- metadata: Record<string, string> | null;
20
- }) => Promise<{
21
- outfile: string;
22
- cleanupChunksProm: Promise<void>;
23
- }>;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.concatVideos = void 0;
7
- const renderer_1 = require("@remotion/renderer");
8
- const node_fs_1 = __importDefault(require("node:fs"));
9
- const node_path_1 = require("node:path");
10
- const constants_1 = require("../../shared/constants");
11
- const can_concat_seamlessly_1 = require("./can-concat-seamlessly");
12
- const timer_1 = require("./timer");
13
- const concatVideos = async ({ onProgress, numberOfFrames, codec, fps, numberOfGifLoops, files, outdir, audioCodec, audioBitrate, logLevel, framesPerLambda, binariesDirectory, cancelSignal, preferLossless, muted, metadata, }) => {
14
- const outfile = (0, node_path_1.join)(renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_CONCATED_TOKEN), `concat.${renderer_1.RenderInternals.getFileExtensionFromCodec(codec, audioCodec)}`);
15
- const combine = (0, timer_1.timer)('Combine chunks', logLevel);
16
- const filelistDir = renderer_1.RenderInternals.tmpDir(constants_1.REMOTION_FILELIST_TOKEN);
17
- const chunkDurationInSeconds = framesPerLambda / fps;
18
- const resolvedAudioCodec = renderer_1.RenderInternals.resolveAudioCodec({
19
- setting: audioCodec,
20
- codec,
21
- preferLossless,
22
- separateAudioTo: null,
23
- });
24
- const seamlessAudio = (0, can_concat_seamlessly_1.canConcatAudioSeamlessly)(resolvedAudioCodec, framesPerLambda);
25
- const seamlessVideo = (0, can_concat_seamlessly_1.canConcatVideoSeamlessly)(codec);
26
- await renderer_1.RenderInternals.combineChunks({
27
- files,
28
- filelistDir,
29
- output: outfile,
30
- onProgress,
31
- numberOfFrames,
32
- codec,
33
- fps,
34
- numberOfGifLoops,
35
- resolvedAudioCodec,
36
- audioBitrate,
37
- indent: false,
38
- logLevel,
39
- chunkDurationInSeconds,
40
- binariesDirectory,
41
- cancelSignal,
42
- seamlessAudio,
43
- seamlessVideo,
44
- muted,
45
- metadata,
46
- });
47
- combine.end();
48
- const cleanupChunksProm = node_fs_1.default.promises.rm(outdir, {
49
- recursive: true,
50
- force: true,
51
- });
52
- return { outfile, cleanupChunksProm };
53
- };
54
- exports.concatVideos = concatVideos;
@@ -1,17 +0,0 @@
1
- import type { CloudProvider, EnhancedErrorInfo } from '@remotion/serverless';
2
- import type { RenderMetadata } from '@remotion/serverless/client';
3
- import type { PostRenderData } from '../../shared/constants';
4
- import type { OutputFileMetadata } from './find-output-file-in-bucket';
5
- import type { OverallRenderProgress } from './overall-render-progress';
6
- export declare const createPostRenderData: <Provider extends CloudProvider>({ region, memorySizeInMb, renderMetadata, errorExplanations, timeToDelete, outputFile, timeToCombine, overallProgress, timeToFinish, outputSize, }: {
7
- region: Provider["region"];
8
- memorySizeInMb: number;
9
- renderMetadata: RenderMetadata<Provider>;
10
- timeToDelete: number;
11
- errorExplanations: EnhancedErrorInfo[];
12
- outputFile: OutputFileMetadata;
13
- timeToCombine: number | null;
14
- overallProgress: OverallRenderProgress<Provider>;
15
- timeToFinish: number;
16
- outputSize: number;
17
- }) => PostRenderData<Provider>;