@remotion/lambda 3.2.36 → 3.2.38

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 (30) hide show
  1. package/dist/api/render-media-on-lambda.js +8 -6
  2. package/dist/functions/chunk-optimization/get-frame-ranges-from-profile.d.ts +5 -3
  3. package/dist/functions/chunk-optimization/get-profile-duration.d.ts +1 -1
  4. package/dist/functions/chunk-optimization/get-profile-duration.js +0 -3
  5. package/dist/functions/chunk-optimization/is-valid-profile.d.ts +1 -2
  6. package/dist/functions/chunk-optimization/optimize-invocation-order.d.ts +0 -1
  7. package/dist/functions/chunk-optimization/optimize-profile.d.ts +8 -3
  8. package/dist/functions/chunk-optimization/optimize-profile.js +1 -2
  9. package/dist/functions/chunk-optimization/plan-frame-ranges.d.ts +1 -5
  10. package/dist/functions/chunk-optimization/plan-frame-ranges.js +1 -14
  11. package/dist/functions/chunk-optimization/s3-optimization-file.d.ts +0 -1
  12. package/dist/functions/chunk-optimization/simulate-frame-ranges.d.ts +4 -1
  13. package/dist/functions/chunk-optimization/sort-by-duration.d.ts +1 -2
  14. package/dist/functions/chunk-optimization/types.d.ts +0 -11
  15. package/dist/functions/index.js +4 -1
  16. package/dist/functions/launch.d.ts +1 -0
  17. package/dist/functions/launch.js +10 -64
  18. package/dist/functions/still.js +5 -7
  19. package/dist/index.d.ts +2 -1
  20. package/dist/shared/constants.d.ts +0 -2
  21. package/dist/shared/constants.js +1 -3
  22. package/dist/shared/deserialize-input-props.js +1 -3
  23. package/package.json +6 -6
  24. package/remotionlambda.zip +0 -0
  25. package/dist/shared/cleanup-input-props.d.ts +0 -7
  26. package/dist/shared/cleanup-input-props.js +0 -17
  27. package/dist/shared/const hi = () => {.d.ts +0 -1
  28. package/dist/shared/const hi = () => {.js +0 -18
  29. package/dist/shared/query.d.ts +0 -1
  30. package/dist/shared/query.js +0 -21
@@ -39,12 +39,14 @@ const renderMediaOnLambda = async ({ functionName, serveUrl, inputProps, codec,
39
39
  durationInFrames: 1,
40
40
  });
41
41
  (0, validate_download_behavior_1.validateDownloadBehavior)(downloadBehavior);
42
- const realServeUrl = await (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region);
43
- const serializedInputProps = await (0, serialize_input_props_1.serializeInputProps)({
44
- inputProps,
45
- region,
46
- type: 'video-or-audio',
47
- });
42
+ const [realServeUrl, serializedInputProps] = await Promise.all([
43
+ (0, convert_to_serve_url_1.convertToServeUrl)(serveUrl, region),
44
+ (0, serialize_input_props_1.serializeInputProps)({
45
+ inputProps,
46
+ region,
47
+ type: 'video-or-audio',
48
+ }),
49
+ ]);
48
50
  try {
49
51
  const res = await (0, call_lambda_1.callLambda)({
50
52
  functionName,
@@ -1,3 +1,5 @@
1
- import type { TimingProfile } from './types';
2
- export declare const getFrameRangesFromProfile: (profile: TimingProfile) => [number, number][];
3
- export declare const sortProfileByFrameRanges: (profile: TimingProfile) => import("./types").ChunkTimingData[];
1
+ export declare const getFrameRangesFromProfile: (profile: TimingProfile) => [
2
+ number,
3
+ number
4
+ ][];
5
+ export declare const sortProfileByFrameRanges: (profile: TimingProfile) => any;
@@ -1,3 +1,3 @@
1
- import type { ChunkTimingData, TimingProfile } from './types';
1
+ import type { ChunkTimingData } from './types';
2
2
  export declare const getTimingEndTimestamps: (chunk: ChunkTimingData) => number[];
3
3
  export declare const getProfileDuration: (chunks: TimingProfile) => number;
@@ -5,9 +5,6 @@ const getTimingEndTimestamps = (chunk) => {
5
5
  return chunk.timings.map((timing) => chunk.startDate + timing);
6
6
  };
7
7
  exports.getTimingEndTimestamps = getTimingEndTimestamps;
8
- const getProfileTimestamps = (chunks) => {
9
- return chunks.map((c) => (0, exports.getTimingEndTimestamps)(c));
10
- };
11
8
  const getProfileDuration = (chunks) => {
12
9
  const startTimeStamps = chunks.map((c) => c.startDate).flat(1);
13
10
  const endTimestamps = getProfileTimestamps(chunks).flat(1);
@@ -1,2 +1 @@
1
- import type { TimingProfile } from './types';
2
- export declare const isValidOptimizationProfile: (profile: TimingProfile) => boolean;
1
+ export declare const isValidOptimizationProfile: (profile: TimingProfile) => any;
@@ -1,2 +1 @@
1
- import type { TimingProfile } from './types';
2
1
  export declare const optimizeInvocationOrder: (profile: TimingProfile) => TimingProfile;
@@ -1,9 +1,14 @@
1
- import type { TimingProfile } from './types';
2
1
  export declare const assignFrameToOther: ({ frameRanges, fromChunk, toChunk, framesToShift, }: {
3
- frameRanges: [number, number][];
2
+ frameRanges: [
3
+ number,
4
+ number
5
+ ][];
4
6
  fromChunk: number;
5
7
  toChunk: number;
6
8
  framesToShift: number;
7
- }) => [number, number][];
9
+ }) => [
10
+ number,
11
+ number
12
+ ][];
8
13
  export declare const optimizeProfile: (_profile: TimingProfile) => TimingProfile;
9
14
  export declare const optimizeProfileRecursively: (profile: TimingProfile, amount: number) => TimingProfile;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.optimizeProfileRecursively = exports.optimizeProfile = exports.assignFrameToOther = void 0;
4
- const get_frame_ranges_from_profile_1 = require("./get-frame-ranges-from-profile");
5
4
  const simulate_frame_ranges_1 = require("./simulate-frame-ranges");
6
5
  const sort_by_duration_1 = require("./sort-by-duration");
7
6
  const assignFrameToOther = ({ frameRanges, fromChunk, toChunk, framesToShift, }) => {
@@ -47,7 +46,7 @@ const optimizeProfile = (_profile) => {
47
46
  if (indexOfSlowest === -1) {
48
47
  throw new Error('invalid timing profile: ' + JSON.stringify(_profile));
49
48
  }
50
- const frameRanges = (0, get_frame_ranges_from_profile_1.getFrameRangesFromProfile)(sortedByStart);
49
+ const frameRanges = getFrameRangesFromProfile(sortedByStart);
51
50
  if (indexOfFastest === indexOfSlowest) {
52
51
  return _profile;
53
52
  }
@@ -1,11 +1,7 @@
1
- import type { OptimizationProfile } from './types';
2
- export declare const planFrameRanges: ({ framesPerLambda, optimization, shouldUseOptimization, frameRange, everyNthFrame, }: {
1
+ export declare const planFrameRanges: ({ framesPerLambda, frameRange, everyNthFrame, }: {
3
2
  framesPerLambda: number;
4
- optimization: OptimizationProfile | null;
5
- shouldUseOptimization: boolean;
6
3
  frameRange: [number, number];
7
4
  everyNthFrame: number;
8
5
  }) => {
9
6
  chunks: [number, number][];
10
- didUseOptimization: boolean;
11
7
  };
@@ -2,21 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.planFrameRanges = void 0;
4
4
  const renderer_1 = require("@remotion/renderer");
5
- const can_use_optimization_1 = require("./can-use-optimization");
6
- const planFrameRanges = ({ framesPerLambda, optimization, shouldUseOptimization, frameRange, everyNthFrame, }) => {
5
+ const planFrameRanges = ({ framesPerLambda, frameRange, everyNthFrame, }) => {
7
6
  const framesToRender = renderer_1.RenderInternals.getFramesToRender(frameRange, everyNthFrame);
8
7
  const chunkCount = Math.ceil(framesToRender.length / framesPerLambda);
9
- if ((0, can_use_optimization_1.canUseOptimization)({
10
- optimization,
11
- framesPerLambda,
12
- frameRange,
13
- }) &&
14
- shouldUseOptimization) {
15
- return {
16
- chunks: optimization.ranges,
17
- didUseOptimization: true,
18
- };
19
- }
20
8
  const firstFrame = frameRange[0];
21
9
  return {
22
10
  chunks: new Array(chunkCount).fill(1).map((_, i) => {
@@ -24,7 +12,6 @@ const planFrameRanges = ({ framesPerLambda, optimization, shouldUseOptimization,
24
12
  const end = Math.min(framesToRender[framesToRender.length - 1], (i + 1) * framesPerLambda * everyNthFrame - 1) + firstFrame;
25
13
  return [start, end];
26
14
  }),
27
- didUseOptimization: false,
28
15
  };
29
16
  };
30
17
  exports.planFrameRanges = planFrameRanges;
@@ -1,5 +1,4 @@
1
1
  import type { AwsRegion } from '../../pricing/aws-regions';
2
- import type { OptimizationProfile } from './types';
3
2
  export declare const writeOptimization: ({ bucketName, optimization, compositionId, siteId, region, expectedBucketOwner, }: {
4
3
  bucketName: string;
5
4
  optimization: OptimizationProfile;
@@ -3,5 +3,8 @@ export declare const getTimingForFrame: (profile: TimingProfile, frame: number)
3
3
  export declare const getSimulatedTimingForFrameRange: (profile: TimingProfile, frameRange: [number, number]) => ChunkTimingData['timings'];
4
4
  export declare const simulateFrameRanges: ({ profile, newFrameRanges, }: {
5
5
  profile: TimingProfile;
6
- newFrameRanges: [number, number][];
6
+ newFrameRanges: [
7
+ number,
8
+ number
9
+ ][];
7
10
  }) => TimingProfile;
@@ -1,2 +1 @@
1
- import type { ChunkTimingData, TimingProfile } from './types';
2
- export declare const sortProfileByDuration: (profile: TimingProfile) => ChunkTimingData[];
1
+ export declare const sortProfileByDuration: (profile: TimingProfile) => any;
@@ -9,14 +9,3 @@ export declare type ObjectChunkTimingData = {
9
9
  export declare type ChunkTimingData = Omit<ObjectChunkTimingData, 'timings'> & {
10
10
  timings: number[];
11
11
  };
12
- export declare type TimingProfile = ChunkTimingData[];
13
- export declare type OptimizationProfile = {
14
- ranges: [number, number][];
15
- frameRange: [number, number];
16
- oldTiming: number;
17
- newTiming: number;
18
- createdFromRenderId: string;
19
- framesPerLambda: number;
20
- lambdaVersion: string;
21
- everyNthFrame: number;
22
- };
@@ -44,7 +44,10 @@ const handler = async (params, context) => {
44
44
  inputProps: JSON.stringify(params.inputProps),
45
45
  isWarm,
46
46
  });
47
- return (0, launch_1.launchHandler)(params, { expectedBucketOwner: currentUserId });
47
+ return (0, launch_1.launchHandler)(params, {
48
+ expectedBucketOwner: currentUserId,
49
+ getRemainingTimeInMillis: context.getRemainingTimeInMillis,
50
+ });
48
51
  }
49
52
  if (params.type === constants_1.LambdaRoutines.status) {
50
53
  (0, print_cloudwatch_helper_1.printCloudwatchHelper)(constants_1.LambdaRoutines.status, {
@@ -1,6 +1,7 @@
1
1
  import type { LambdaPayload } from '../shared/constants';
2
2
  declare type Options = {
3
3
  expectedBucketOwner: string;
4
+ getRemainingTimeInMillis: () => number;
4
5
  };
5
6
  export declare const launchHandler: (params: LambdaPayload, options: Options) => Promise<void>;
6
7
  export {};
@@ -19,14 +19,7 @@ const make_s3_url_1 = require("../shared/make-s3-url");
19
19
  const validate_frames_per_lambda_1 = require("../shared/validate-frames-per-lambda");
20
20
  const validate_outname_1 = require("../shared/validate-outname");
21
21
  const validate_privacy_1 = require("../shared/validate-privacy");
22
- const collect_data_1 = require("./chunk-optimization/collect-data");
23
- const get_frame_ranges_from_profile_1 = require("./chunk-optimization/get-frame-ranges-from-profile");
24
- const get_profile_duration_1 = require("./chunk-optimization/get-profile-duration");
25
- const is_valid_profile_1 = require("./chunk-optimization/is-valid-profile");
26
- const optimize_invocation_order_1 = require("./chunk-optimization/optimize-invocation-order");
27
- const optimize_profile_1 = require("./chunk-optimization/optimize-profile");
28
22
  const plan_frame_ranges_1 = require("./chunk-optimization/plan-frame-ranges");
29
- const s3_optimization_file_1 = require("./chunk-optimization/s3-optimization-file");
30
23
  const best_frames_per_lambda_param_1 = require("./helpers/best-frames-per-lambda-param");
31
24
  const concat_videos_1 = require("./helpers/concat-videos");
32
25
  const create_post_render_data_1 = require("./helpers/create-post-render-data");
@@ -72,6 +65,7 @@ const innerLaunchHandler = async (params, options) => {
72
65
  }
73
66
  const startedDate = Date.now();
74
67
  let webhookInvoked = false;
68
+ console.log(`Function has ${Math.max(options.getRemainingTimeInMillis() - 1000, 1000)} before it times out`);
75
69
  const webhookDueToTimeout = setTimeout(async () => {
76
70
  if (params.webhook && !webhookInvoked) {
77
71
  try {
@@ -113,17 +107,8 @@ const innerLaunchHandler = async (params, options) => {
113
107
  console.log(err);
114
108
  }
115
109
  }
116
- }, Math.max(params.timeoutInMilliseconds - 1000, 1000));
117
- const [browserInstance, optimization] = await Promise.all([
118
- (0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), params.chromiumOptions),
119
- (0, s3_optimization_file_1.getOptimization)({
120
- bucketName: params.bucketName,
121
- siteId: (0, make_s3_url_1.getServeUrlHash)(params.serveUrl),
122
- compositionId: params.composition,
123
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
124
- expectedBucketOwner: options.expectedBucketOwner,
125
- }),
126
- ]);
110
+ }, Math.max(options.getRemainingTimeInMillis() - 1000, 1000));
111
+ const browserInstance = await (0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(params.logLevel, 'verbose'), params.chromiumOptions);
127
112
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
128
113
  const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
129
114
  bucketName: params.bucketName,
@@ -165,11 +150,8 @@ const innerLaunchHandler = async (params, options) => {
165
150
  (0, validate_outname_1.validateOutname)(params.outName, params.codec);
166
151
  (0, validate_privacy_1.validatePrivacy)(params.privacy);
167
152
  renderer_1.RenderInternals.validatePuppeteerTimeout(params.timeoutInMilliseconds);
168
- const { chunks, didUseOptimization } = (0, plan_frame_ranges_1.planFrameRanges)({
153
+ const { chunks } = (0, plan_frame_ranges_1.planFrameRanges)({
169
154
  framesPerLambda,
170
- optimization,
171
- // TODO: Re-enable chunk optimization later
172
- shouldUseOptimization: false,
173
155
  frameRange: realFrameRange,
174
156
  everyNthFrame: params.everyNthFrame,
175
157
  });
@@ -228,7 +210,6 @@ const innerLaunchHandler = async (params, options) => {
228
210
  compositionId: comp.id,
229
211
  siteId: (0, make_s3_url_1.getServeUrlHash)(params.serveUrl),
230
212
  codec: params.codec,
231
- usesOptimizationProfile: didUseOptimization,
232
213
  type: 'video',
233
214
  imageFormat: params.imageFormat,
234
215
  inputProps: params.inputProps,
@@ -381,47 +362,12 @@ const innerLaunchHandler = async (params, options) => {
381
362
  downloadBehavior: params.downloadBehavior,
382
363
  customCredentials,
383
364
  });
384
- let chunkProm = Promise.resolve();
385
- // TODO: Enable in a later release
386
- const enableChunkOptimization = false;
387
- if (enableChunkOptimization) {
388
- const chunkData = await (0, collect_data_1.collectChunkInformation)({
389
- bucketName: params.bucketName,
390
- renderId: params.renderId,
391
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
392
- expectedBucketOwner: options.expectedBucketOwner,
393
- });
394
- const optimizedProfile = (0, optimize_invocation_order_1.optimizeInvocationOrder)((0, optimize_profile_1.optimizeProfileRecursively)(chunkData, 400));
395
- const optimizedFrameRange = (0, get_frame_ranges_from_profile_1.getFrameRangesFromProfile)(optimizedProfile);
396
- chunkProm = (0, is_valid_profile_1.isValidOptimizationProfile)(optimizedProfile)
397
- ? (0, s3_optimization_file_1.writeOptimization)({
398
- bucketName: params.bucketName,
399
- optimization: {
400
- ranges: optimizedFrameRange,
401
- oldTiming: (0, get_profile_duration_1.getProfileDuration)(chunkData),
402
- newTiming: (0, get_profile_duration_1.getProfileDuration)(optimizedProfile),
403
- createdFromRenderId: params.renderId,
404
- framesPerLambda,
405
- lambdaVersion: version_1.VERSION,
406
- frameRange: realFrameRange,
407
- everyNthFrame: params.everyNthFrame,
408
- },
409
- expectedBucketOwner: options.expectedBucketOwner,
410
- compositionId: params.composition,
411
- siteId: (0, make_s3_url_1.getServeUrlHash)(params.serveUrl),
412
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
413
- })
414
- : Promise.resolve();
415
- }
416
- const [, contents] = await Promise.all([
417
- chunkProm,
418
- (0, io_1.lambdaLs)({
419
- bucketName: params.bucketName,
420
- prefix: (0, constants_1.rendersPrefix)(params.renderId),
421
- expectedBucketOwner: options.expectedBucketOwner,
422
- region: (0, get_current_region_1.getCurrentRegionInFunction)(),
423
- }),
424
- ]);
365
+ const contents = await (0, io_1.lambdaLs)({
366
+ bucketName: params.bucketName,
367
+ prefix: (0, constants_1.rendersPrefix)(params.renderId),
368
+ expectedBucketOwner: options.expectedBucketOwner,
369
+ region: (0, get_current_region_1.getCurrentRegionInFunction)(),
370
+ });
425
371
  const finalEncodingProgress = {
426
372
  framesEncoded: frameCount.length,
427
373
  totalFrames: frameCount.length,
@@ -50,20 +50,20 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
50
50
  }),
51
51
  (0, get_browser_instance_1.getBrowserInstance)(renderer_1.RenderInternals.isEqualOrBelowLogLevel(lambdaParams.logLevel, 'verbose'), (_a = lambdaParams.chromiumOptions) !== null && _a !== void 0 ? _a : {}),
52
52
  ]);
53
- const inputPropsPromise = (0, deserialize_input_props_1.deserializeInputProps)({
53
+ const outputDir = renderer_1.RenderInternals.tmpDir('remotion-render-');
54
+ const outputPath = path_1.default.join(outputDir, 'output');
55
+ const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
56
+ const inputProps = await (0, deserialize_input_props_1.deserializeInputProps)({
54
57
  bucketName,
55
58
  expectedBucketOwner: options.expectedBucketOwner,
56
59
  region: (0, get_current_region_1.getCurrentRegionInFunction)(),
57
60
  serialized: lambdaParams.inputProps,
58
61
  });
59
- const outputDir = renderer_1.RenderInternals.tmpDir('remotion-render-');
60
- const outputPath = path_1.default.join(outputDir, 'output');
61
- const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
62
62
  const composition = await (0, validate_composition_1.validateComposition)({
63
63
  serveUrl: lambdaParams.serveUrl,
64
64
  browserInstance,
65
65
  composition: lambdaParams.composition,
66
- inputProps: lambdaParams.inputProps,
66
+ inputProps,
67
67
  envVariables: lambdaParams.envVariables,
68
68
  ffmpegExecutable: null,
69
69
  ffprobeExecutable: null,
@@ -82,7 +82,6 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
82
82
  siteId: (0, make_s3_url_1.getServeUrlHash)(lambdaParams.serveUrl),
83
83
  totalChunks: 1,
84
84
  type: 'still',
85
- usesOptimizationProfile: false,
86
85
  imageFormat: lambdaParams.imageFormat,
87
86
  inputProps: lambdaParams.inputProps,
88
87
  lambdaVersion: version_1.VERSION,
@@ -103,7 +102,6 @@ const innerStillHandler = async (lambdaParams, renderId, options) => {
103
102
  downloadBehavior: null,
104
103
  customCredentials: null,
105
104
  });
106
- const inputProps = await inputPropsPromise;
107
105
  await (0, renderer_1.renderStill)({
108
106
  composition,
109
107
  output: outputPath,
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { DeleteFunctionInput } from './api/delete-function';
2
2
  import { deleteFunction } from './api/delete-function';
3
+ import type { DeleteRenderInput } from './api/delete-render';
3
4
  import { deleteRender } from './api/delete-render';
4
5
  import type { DeleteSiteInput, DeleteSiteOutput } from './api/delete-site';
5
6
  import { deleteSite } from './api/delete-site';
@@ -42,4 +43,4 @@ import type { RenderProgress } from './shared/constants';
42
43
  import type { WebhookPayload } from './shared/invoke-webhook';
43
44
  import type { LambdaArchitecture } from './shared/validate-architecture';
44
45
  export { deleteSite, deployFunction, deploySite, downloadMedia, downloadVideo, getFunctions, getUserPolicy, getRolePolicy, getSites, getOrCreateBucket, getRenderProgress, renderVideoOnLambda, renderMediaOnLambda, simulatePermissions, deleteFunction, getFunctionInfo, estimatePrice, LambdaInternals, renderStillOnLambda, getRegions, getAwsClient, presignUrl, deleteRender, validateWebhookSignature, };
45
- export type { AwsRegion, RenderProgress, DeploySiteInput, DeploySiteOutput, LambdaLsReturnType, LambdaLSInput, DeleteSiteInput, DeleteSiteOutput, EstimatePriceInput, DeployFunctionInput, DeployFunctionOutput, DeleteFunctionInput, GetFunctionInfoInput, FunctionInfo, GetFunctionsInput, GetSitesInput, GetSitesOutput, DownloadMediaInput, DownloadMediaOutput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, GetAwsClientInput, GetAwsClientOutput, LambdaArchitecture, CustomCredentials, WebhookPayload, LambdaErrorInfo, EnhancedErrorInfo, };
46
+ export type { AwsRegion, RenderProgress, DeploySiteInput, DeploySiteOutput, LambdaLsReturnType, LambdaLSInput, DeleteSiteInput, DeleteSiteOutput, EstimatePriceInput, DeployFunctionInput, DeployFunctionOutput, DeleteFunctionInput, GetFunctionInfoInput, FunctionInfo, GetFunctionsInput, GetSitesInput, GetSitesOutput, DownloadMediaInput, DownloadMediaOutput, GetOrCreateBucketInput, GetOrCreateBucketOutput, GetRenderInput, RenderMediaOnLambdaInput, RenderMediaOnLambdaOutput, RenderStillOnLambdaInput, RenderStillOnLambdaOutput, SimulatePermissionsInput, SimulatePermissionsOutput, GetAwsClientInput, GetAwsClientOutput, LambdaArchitecture, CustomCredentials, WebhookPayload, LambdaErrorInfo, EnhancedErrorInfo, DeleteRenderInput, };
@@ -75,7 +75,6 @@ export declare type OutNameOutput = {
75
75
  key: string;
76
76
  customCredentials: CustomCredentials | null;
77
77
  };
78
- export declare const optimizationProfile: (siteId: string, compositionId: string) => string;
79
78
  export declare const getSitesKey: (siteId: string) => string;
80
79
  export declare const outName: (renderId: string, extension: string) => string;
81
80
  export declare const outStillName: (renderId: string, imageFormat: ImageFormat) => string;
@@ -251,7 +250,6 @@ export declare type RenderMetadata = {
251
250
  estimatedRenderLambdaInvokations: number;
252
251
  compositionId: string;
253
252
  codec: Codec | null;
254
- usesOptimizationProfile: boolean;
255
253
  type: 'still' | 'video';
256
254
  imageFormat: ImageFormat;
257
255
  inputProps: SerializedInputProps;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LAMBDA_BURST_LIMIT_QUOTA = exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.inputPropsKey = exports.postRenderDataKey = exports.customOutName = exports.outStillName = exports.outName = exports.getSitesKey = exports.optimizationProfile = exports.getErrorFileName = exports.getErrorKeyPrefix = exports.chunkKeyForIndex = exports.chunkKey = exports.lambdaTimingsKey = exports.lambdaLogsPrefix = exports.lambdaTimingsPrefixForChunk = exports.lambdaTimingsPrefix = exports.lambdaChunkInitializedKey = exports.lambdaChunkInitializedPrefix = exports.initalizedMetadataKey = exports.renderMetadataKey = exports.encodingProgressKey = exports.rendersPrefix = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_ARCHITECTURE = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
3
+ exports.LAMBDA_BURST_LIMIT_QUOTA = exports.LAMBDA_CONCURRENCY_LIMIT_QUOTA = exports.LambdaRoutines = exports.REMOTION_FILELIST_TOKEN = exports.REMOTION_CONCATED_TOKEN = exports.CONCAT_FOLDER_TOKEN = exports.RENDERER_PATH_TOKEN = exports.inputPropsKey = exports.postRenderDataKey = exports.customOutName = exports.outStillName = exports.outName = exports.getSitesKey = exports.getErrorFileName = exports.getErrorKeyPrefix = exports.chunkKeyForIndex = exports.chunkKey = exports.lambdaTimingsKey = exports.lambdaLogsPrefix = exports.lambdaTimingsPrefixForChunk = exports.lambdaTimingsPrefix = exports.lambdaChunkInitializedKey = exports.lambdaChunkInitializedPrefix = exports.initalizedMetadataKey = exports.renderMetadataKey = exports.encodingProgressKey = exports.rendersPrefix = exports.LOG_GROUP_PREFIX = exports.RENDER_FN_PREFIX = exports.REMOTION_BUCKET_PREFIX = exports.DEFAULT_CLOUDWATCH_RETENTION_PERIOD = exports.DEFAULT_OUTPUT_PRIVACY = exports.MAX_EPHEMERAL_STORAGE_IN_MB = exports.MIN_EPHEMERAL_STORAGE_IN_MB = exports.DEFAULT_EPHEMERAL_STORAGE_IN_MB = exports.MAX_FUNCTIONS_PER_RENDER = exports.DEFAULT_MAX_RETRIES = exports.DEFAULT_REGION = exports.COMMAND_NOT_FOUND = exports.BINARY_NAME = exports.DEFAULT_FRAMES_PER_LAMBDA = exports.MINIMUM_FRAMES_PER_LAMBDA = exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DEFAULT_ARCHITECTURE = exports.DEFAULT_MEMORY_SIZE = exports.MAX_MEMORY = exports.MIN_MEMORY = void 0;
4
4
  exports.MIN_MEMORY = 512;
5
5
  exports.MAX_MEMORY = 10240;
6
6
  exports.DEFAULT_MEMORY_SIZE = 2048;
@@ -51,8 +51,6 @@ const getErrorKeyPrefix = (renderId) => `${(0, exports.rendersPrefix)(renderId)}
51
51
  exports.getErrorKeyPrefix = getErrorKeyPrefix;
52
52
  const getErrorFileName = ({ renderId, chunk, attempt, }) => (0, exports.getErrorKeyPrefix)(renderId) + ':chunk-' + chunk + ':attempt-' + attempt;
53
53
  exports.getErrorFileName = getErrorFileName;
54
- const optimizationProfile = (siteId, compositionId) => `optimization-profiles/${siteId}/${compositionId}/optimization-profile`;
55
- exports.optimizationProfile = optimizationProfile;
56
54
  const getSitesKey = (siteId) => `sites/${siteId}`;
57
55
  exports.getSitesKey = getSitesKey;
58
56
  const outName = (renderId, extension) => `${(0, exports.rendersPrefix)(renderId)}/out.${extension}`;
@@ -6,9 +6,7 @@ const constants_1 = require("./constants");
6
6
  const stream_to_string_1 = require("./stream-to-string");
7
7
  const deserializeInputProps = async ({ serialized, region, bucketName, expectedBucketOwner, }) => {
8
8
  if (serialized.type === 'payload') {
9
- return {
10
- inputProps: serialized.payload,
11
- };
9
+ return JSON.parse(serialized.payload);
12
10
  }
13
11
  try {
14
12
  const response = await (0, io_1.lambdaReadFile)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/lambda",
3
- "version": "3.2.36",
3
+ "version": "3.2.38",
4
4
  "description": "Distributed renderer for Remotion based on AWS Lambda",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -31,12 +31,12 @@
31
31
  "@aws-sdk/client-service-quotas": "3.190.0",
32
32
  "@aws-sdk/lib-storage": "3.190.0",
33
33
  "@aws-sdk/s3-request-presigner": "3.190.0",
34
- "@remotion/bundler": "3.2.36",
35
- "@remotion/cli": "3.2.36",
36
- "@remotion/renderer": "3.2.36",
34
+ "@remotion/bundler": "3.2.38",
35
+ "@remotion/cli": "3.2.38",
36
+ "@remotion/renderer": "3.2.38",
37
37
  "aws-policies": "^1.0.1",
38
38
  "mime-types": "2.1.34",
39
- "remotion": "3.2.36"
39
+ "remotion": "3.2.38"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.0",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "69d6e23f17b14509aee4d327b3481fd4e15df4a4"
62
+ "gitHead": "faec18c286d03b94887ef5ff16ea48f94c82954d"
63
63
  }
Binary file
@@ -1,7 +0,0 @@
1
- import type { AwsRegion } from '../client';
2
- import type { SerializedInputProps } from './constants';
3
- export declare const cleanupSerializedInputProps: ({ serialized, region, bucketName, }: {
4
- serialized: SerializedInputProps;
5
- region: AwsRegion;
6
- bucketName: string;
7
- }) => Promise<void>;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanupSerializedInputProps = void 0;
4
- const io_1 = require("../functions/helpers/io");
5
- const constants_1 = require("./constants");
6
- const cleanupSerializedInputProps = async ({ serialized, region, bucketName, }) => {
7
- if (serialized.type === 'payload') {
8
- return undefined;
9
- }
10
- await (0, io_1.lambdaDeleteFile)({
11
- bucketName,
12
- key: (0, constants_1.inputPropsKey)(serialized.hash),
13
- region,
14
- customCredentials: null,
15
- });
16
- };
17
- exports.cleanupSerializedInputProps = cleanupSerializedInputProps;
@@ -1 +0,0 @@
1
- declare const hi: (query: string) => Promise<void>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- const hi = async (query) => {
3
- await fetch('https://plsduol1ca-dsn.algolianet.com/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20JavaScript%20(4.14.2)%3B%20Browser%20(lite)%3B%20docsearch%20(3.2.1)%3B%20docsearch-react%20(3.2.1)%3B%20docusaurus%20(2.1.0)&x-algolia-api-key=3e42dbd4f895fe93ff5cf40d860c4a85&x-algolia-application-id=PLSDUOL1CA', {
4
- headers: {
5
- 'content-type': 'application/x-www-form-urlencoded',
6
- },
7
- body: JSON.stringify({
8
- requests: [
9
- {
10
- query,
11
- indexName: 'remotion',
12
- params: 'attributesToRetrieve=%5B%22hierarchy.lvl0%22%2C%22hierarchy.lvl1%22%2C%22hierarchy.lvl2%22%2C%22hierarchy.lvl3%22%2C%22hierarchy.lvl4%22%2C%22hierarchy.lvl5%22%2C%22hierarchy.lvl6%22%2C%22content%22%2C%22type%22%2C%22url%22%5D&attributesToSnippet=%5B%22hierarchy.lvl1%3A10%22%2C%22hierarchy.lvl2%3A10%22%2C%22hierarchy.lvl3%3A10%22%2C%22hierarchy.lvl4%3A10%22%2C%22hierarchy.lvl5%3A10%22%2C%22hierarchy.lvl6%3A10%22%2C%22content%3A10%22%5D&snippetEllipsisText=%E2%80%A6&highlightPreTag=%3Cmark%3E&highlightPostTag=%3C%2Fmark%3E&hitsPerPage=20&facetFilters=%5B%5D',
13
- },
14
- ],
15
- }),
16
- method: 'POST',
17
- }).then((res) => res.json());
18
- };
@@ -1 +0,0 @@
1
- declare const hi: (query: string) => Promise<void>;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- const hi = async (query) => {
3
- await fetch('https://plsduol1ca-dsn.algolianet.com/1/indexes/*/queries?x-algolia-agent=' +
4
- encodeURIComponent('Remotion Preview DocSearch') +
5
- '&x-algolia-api-key=3e42dbd4f895fe93ff5cf40d860c4a85&x-algolia-application-id=PLSDUOL1CA', {
6
- headers: {
7
- 'content-type': 'application/x-www-form-urlencoded',
8
- },
9
- body: JSON.stringify({
10
- requests: [
11
- {
12
- query,
13
- indexName: 'remotion',
14
- params: encodeURIComponent('attributesToRetrieve=["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"]&attributesToSnippet=["hierarchy.lvl1:10","hierarchy.lvl2:10","hierarchy.lvl3:10","hierarchy.lvl4:10","hierarchy.lvl5:10","hierarchy.lvl6:10","content:10"]&snippetEllipsisText=…&highlightPreTag=<mark>&highlightPostTag=</mark>&hitsPerPage=20&facetFilters=[]'),
15
- },
16
- ],
17
- }),
18
- method: 'POST',
19
- }).then((res) => res.json());
20
- };
21
- hi();