🎥 Make videos programmatically with React
fix typo in durationInMiliseconds
Matt McGillivrayf956589ce125
diff --git a/packages/docs/docs/lambda/changelog.md b/packages/docs/docs/lambda/changelog.mdindex 9a1232109f..764249e62b 100644--- a/packages/docs/docs/lambda/changelog.md+++ b/packages/docs/docs/lambda/changelog.md@@ -293,7 +293,7 @@ Lambda version: '2021-12-16'Stability and ease of use improvements that we implemented from our learnings from https://githubwrapped.com!-- Fixed an error `Parameter 'durationInMiliseconds' must be over 0 but is [negative number]`+- Fixed an error `Parameter 'durationInMilliseconds' must be over 0 but is [negative number]`- The function name of a deployed function is not random anymore. Instead it has the format of `remotion-render-2021-12-16-2048mb-120sec`- More CLI commands support the `-q` (quiet) flag.- Calling `npx remotion lambda functions deploy` if a suitable function already exists will not throw an error anymore but log the existing function.diff --git a/packages/docs/docs/lambda/estimateprice.md b/packages/docs/docs/lambda/estimateprice.mdindex b36aa6c561..054bce8f5c 100644--- a/packages/docs/docs/lambda/estimateprice.md+++ b/packages/docs/docs/lambda/estimateprice.md@@ -27,7 +27,7 @@ import { estimatePrice } from "@remotion/lambda";console.log(estimatePrice({region: "us-east-1",- durationInMiliseconds: 20000,+ durationInMilliseconds: 20000,memorySizeInMb: 2048,diskSizeInMb: 2048,lambdasInvoked: 1,@@ -47,9 +47,9 @@ The region in which the Lambda function is executed in. [Pricing varies across rThe amount of memory that has been given to the Lambda function. May be received with [`getFunctionInfo()`](/docs/lambda/getfunctioninfo).-### `durationInMiliseconds`+### `durationInMilliseconds`-The estimated total execution duration in miliseconds of all Lambdas combined. See the top of this page for a guide on how to approximate the duration.+The estimated total execution duration in Milliseconds of all Lambdas combined. See the top of this page for a guide on how to approximate the duration.### `lambdasInvoked`diff --git a/packages/lambda/src/api/estimate-price.ts b/packages/lambda/src/api/estimate-price.tsindex 4346ecc628..0885f188d9 100644--- a/packages/lambda/src/api/estimate-price.ts+++ b/packages/lambda/src/api/estimate-price.ts@@ -7,7 +7,7 @@ import {validateMemorySize} from '../shared/validate-memory-size';export type EstimatePriceInput = {region: AwsRegion;- durationInMiliseconds: number;+ durationInMilliseconds: number;memorySizeInMb: number;diskSizeInMb: number;lambdasInvoked: number;@@ -20,7 +20,7 @@ export type EstimatePriceInput = {*/export const estimatePrice = ({region,- durationInMiliseconds,+ durationInMilliseconds,memorySizeInMb,diskSizeInMb,lambdasInvoked,@@ -28,27 +28,27 @@ export const estimatePrice = ({validateMemorySize(memorySizeInMb);validateAwsRegion(region);validateDiskSizeInMb(diskSizeInMb);- if (typeof durationInMiliseconds !== 'number') {+ if (typeof durationInMilliseconds !== 'number') {throw new TypeError(- `Parameter 'durationInMiliseconds' must be a number but got ${typeof durationInMiliseconds}`+ `Parameter 'durationInMilliseconds' must be a number but got ${typeof durationInMilliseconds}`);}- if (Number.isNaN(durationInMiliseconds)) {+ if (Number.isNaN(durationInMilliseconds)) {throw new TypeError(- `Parameter 'durationInMiliseconds' must not be NaN but it is.`+ `Parameter 'durationInMilliseconds' must not be NaN but it is.`);}- if (!Number.isFinite(durationInMiliseconds)) {+ if (!Number.isFinite(durationInMilliseconds)) {throw new TypeError(- `Parameter 'durationInMiliseconds' must be finite but it is ${durationInMiliseconds}`+ `Parameter 'durationInMilliseconds' must be finite but it is ${durationInMilliseconds}`);}- if (durationInMiliseconds < 0) {+ if (durationInMilliseconds < 0) {throw new TypeError(- `Parameter 'durationInMiliseconds' must be over 0 but it is ${durationInMiliseconds}.`+ `Parameter 'durationInMilliseconds' must be over 0 but it is ${durationInMilliseconds}.`);}@@ -57,7 +57,7 @@ export const estimatePrice = ({// In GB-secondconst timeCostDollars =Number(durationPrice) *- ((memorySizeInMb * durationInMiliseconds) / 1000 / 1024);+ ((memorySizeInMb * durationInMilliseconds) / 1000 / 1024);const diskSizePrice = pricing[region]['Lambda Storage-Duration-ARM'].price;@@ -69,7 +69,7 @@ export const estimatePrice = ({const diskSizeDollars =chargedDiskSize *Number(diskSizePrice) *- (durationInMiliseconds / 1000 / 1024);+ (durationInMilliseconds / 1000 / 1024);const invocationCost =Number(pricing[region]['Lambda Requests'].price) * lambdasInvoked;diff --git a/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts b/packages/lambda/src/functions/helpers/calculate-price-from-bucket.tsindex 703d9cad74..2b6f7a6729 100644--- a/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts+++ b/packages/lambda/src/functions/helpers/calculate-price-from-bucket.ts@@ -55,7 +55,7 @@ export const estimatePriceFromBucket = ({const accruedSoFar = Number(estimatePrice({region: getCurrentRegionInFunction(),- durationInMiliseconds:+ durationInMilliseconds:calculateChunkTimes({contents,renderId: renderMetadata.renderId,diff --git a/packages/lambda/src/functions/helpers/create-post-render-data.ts b/packages/lambda/src/functions/helpers/create-post-render-data.tsindex 5325f272fa..f48f7c6852 100644--- a/packages/lambda/src/functions/helpers/create-post-render-data.ts+++ b/packages/lambda/src/functions/helpers/create-post-render-data.ts@@ -53,7 +53,7 @@ export const createPostRenderData = ({.reduce((a, b) => a + b);const cost = estimatePrice({- durationInMiliseconds: times,+ durationInMilliseconds: times,memorySizeInMb,region,lambdasInvoked: renderMetadata.estimatedTotalLambdaInvokations,diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.tsindex ccd63269ed..4b8a8d73cd 100644--- a/packages/lambda/src/functions/still.ts+++ b/packages/lambda/src/functions/still.ts@@ -227,7 +227,7 @@ const innerStillHandler = async ({]);const estimatedPrice = estimatePrice({- durationInMiliseconds: Date.now() - start + 100,+ durationInMilliseconds: Date.now() - start + 100,memorySizeInMb: Number(process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE),region: getCurrentRegionInFunction(),lambdasInvoked: 1,