Skip to content

🎥 Make videos programmatically with React

complete JSDocs comments

Jonny Burger87b370d32501
diff --git a/packages/lambda/src/api/delete-function.ts b/packages/lambda/src/api/delete-function.ts
index cef17822e8..94ee173ec1 100644
--- a/packages/lambda/src/api/delete-function.ts
+++ b/packages/lambda/src/api/delete-function.ts
@@ -4,10 +4,10 @@ import {getLambdaClient} from '../shared/aws-clients';
/**
* @description Deletes a function from AWS Lambda.
+ * @link https://remotion.dev/docs/lambda/deletefunction
* @param options.region The region the function was deployed to.
* @param options.functionName The name of the function.
* @returns Nothing. Throws if the function failed to delete.
- * @link https://remotion.dev/docs/lambda/deletefunction
*/
export const deleteFunction = async ({
region,
diff --git a/packages/lambda/src/api/deploy-function.ts b/packages/lambda/src/api/deploy-function.ts
index 65b27ac078..33e66afb61 100644
--- a/packages/lambda/src/api/deploy-function.ts
+++ b/packages/lambda/src/api/deploy-function.ts
@@ -10,6 +10,15 @@ import {validateMemorySize} from '../shared/validate-memory-size';
import {validateTimeout} from '../shared/validate-timeout';
import {bundleLambda} from './bundle-lambda';
+/**
+ * @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.
+ * @link https://remotion.dev/docs/lambda/deployfunction
+ * @param options.region The region you want to deploy your function to.
+ * @param options.layerArn The resource identifier of the Lambda layer. See documentation for this function on how to retrieve it.
+ * @param options.timeoutInSeconds After how many seconds the lambda function should be killed if it does not end itself.
+ * @param options.memorySizeInMb How much memory should be allocated to the Lambda function.
+ * @returns An object that contains the `functionName` property
+ */
export const deployFunction = async (options: {
region: AwsRegion;
layerArn: string;
diff --git a/packages/lambda/src/api/deploy-project.ts b/packages/lambda/src/api/deploy-project.ts
index fb4066fd61..e71ddc542c 100644
--- a/packages/lambda/src/api/deploy-project.ts
+++ b/packages/lambda/src/api/deploy-project.ts
@@ -21,6 +21,10 @@ type DeployProjectInput = {
/**
* @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.
* @link https://remotion.dev/docs/lambda/deployproject
+ * @param {AwsRegion} params.region The region in which the S3 bucket resides in.
+ * @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.
+ * @param {string} params.bucketName The name of the bucket to deploy your project into.
+ * @param {object} params.options Further options, see documentation page for this function.
*/
export const deployProject = async ({
bucketName,
diff --git a/packages/lambda/src/api/ensure-lambda-binaries.ts b/packages/lambda/src/api/ensure-lambda-binaries.ts
index f4a27524a4..58a99fac99 100644
--- a/packages/lambda/src/api/ensure-lambda-binaries.ts
+++ b/packages/lambda/src/api/ensure-lambda-binaries.ts
@@ -76,6 +76,12 @@ const ensureLayer = async ({
return layer.LayerVersionArn as string;
};
+/**
+ * @description Ensures that a Lambda layer with the necessary binaries exists.
+ * @link https://remotion.dev/docs/lambda/ensurelambdabinaries
+ * @param {AwsRegion} region The region in which you want ensure the binaries are deployed.
+ * @returns `Promise<{layerArn: string}>`
+ */
export const ensureLambdaBinaries = async (region: AwsRegion) => {
const layers = await getLayers(getLambdaClient(region));
const layerArn = await ensureLayer({layers, region});
diff --git a/packages/lambda/src/api/get-function-info.ts b/packages/lambda/src/api/get-function-info.ts
index 329600b10d..b8a6fc6d46 100644
--- a/packages/lambda/src/api/get-function-info.ts
+++ b/packages/lambda/src/api/get-function-info.ts
@@ -19,6 +19,7 @@ type GetFunctionInfoArgs = {
/**
* @description Given a region and function name, returns information about the function such as version, memory size and timeout.
+ * @link https://remotion.dev/docs/lambda/getfunctioninfo
* @param {AwsRegion} options.region The region in which the function resides in.
* @param {string} options.functionName The name of the function
* @return {Promise<FunctionInfo>} Promise resolving to information about the function.
diff --git a/packages/lambda/src/api/get-functions.ts b/packages/lambda/src/api/get-functions.ts
index 68b21e571d..0d5f7367a2 100644
--- a/packages/lambda/src/api/get-functions.ts
+++ b/packages/lambda/src/api/get-functions.ts
@@ -9,10 +9,10 @@ import {FunctionInfo} from './get-function-info';
*
*
* @description Lists Remotion Lambda render functions deployed to AWS Lambda.
+ * @link https://remotion.dev/docs/lambda/getfunctions
* @param options.region The region of which the functions should be listed.
* @param options.compatibleOnly Whether only functions compatible with the installed version of Remotion Lambda should be returned.
* @returns An array with the objects containing information about the deployed functions.
- * @link https://remotion.dev/docs/lambda/getfunctions
*/
export const getFunctions = async (options: {
region: AwsRegion;
diff --git a/packages/lambda/src/api/get-or-create-bucket.ts b/packages/lambda/src/api/get-or-create-bucket.ts
index 955b296252..88e425417c 100644
--- a/packages/lambda/src/api/get-or-create-bucket.ts
+++ b/packages/lambda/src/api/get-or-create-bucket.ts
@@ -12,7 +12,12 @@ type GetOrCreateBucketInput = {
type GetOrCreateBucketResult = {
bucketName: string;
};
-
+/**
+ * @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.
+ * @link http://remotion.dev/docs/lambda/getorcreatebucket
+ * @param options.region The region in which you want your S3 bucket to reside in.
+ * @returns `Promise<{region: AwsRegion}>`
+ */
export const getOrCreateBucket = async (
options: GetOrCreateBucketInput
): Promise<GetOrCreateBucketResult> => {
diff --git a/packages/lambda/src/api/get-render-progress.ts b/packages/lambda/src/api/get-render-progress.ts
index 6590ee0b2d..3004728e11 100644
--- a/packages/lambda/src/api/get-render-progress.ts
+++ b/packages/lambda/src/api/get-render-progress.ts
@@ -2,6 +2,15 @@ import {AwsRegion} from '../pricing/aws-regions';
import {callLambda} from '../shared/call-lambda';
import {LambdaRoutines} from '../shared/constants';
+/**
+ * @description Gets the current status of a render originally triggered via renderVideoOnLambda().
+ * @link https://remotion.dev/docs/lambda/getrenderprogress
+ * @param {string} params.functionName The name of the function used to trigger the render.
+ * @param {string} params.bucketName The name of the bucket that was used in the render.
+ * @param {string} params.renderId The ID of the render that was returned by `renderVideoOnLambda()`.
+ * @param {AwsRegion} params.region The region in which the render was triggered.
+ * @returns See documentation for this function to see all properties on the return object.
+ */
export const getRenderProgress = async ({
functionName,
bucketName,
diff --git a/packages/lambda/src/api/render-video-on-lambda.ts b/packages/lambda/src/api/render-video-on-lambda.ts
index 8a219884a9..dce97bd8e7 100644
--- a/packages/lambda/src/api/render-video-on-lambda.ts
+++ b/packages/lambda/src/api/render-video-on-lambda.ts
@@ -2,6 +2,23 @@ import {ImageFormat, PixelFormat, ProResProfile} from 'remotion';
import {AwsRegion} from '../pricing/aws-regions';
import {callLambda} from '../shared/call-lambda';
import {LambdaRoutines} from '../shared/constants';
+/**
+ * @description Triggers a render on a lambda given a composition and a lambda function.
+ * @link https://remotion.dev/docs/lambda/rendervideoonlambda
+ * @param params.functionName The name of the Lambda function that should be used
+ * @param params.serveUrl The URL of the deployed project
+ * @param params.composition The ID of the composition which should be rendered.
+ * @param params.inputProps The input props that should be passed to the composition.
+ * @param params.codec The video codec which should be used for encoding.
+ * @param params.imageFormat In which image format the frames should be rendered.
+ * @param params.crf The constant rate factor to be used during encoding.
+ * @param params.envVariables Object containing environment variables to be inserted into the video environment
+ * @param params.proResProfile The ProRes profile if rendering a ProRes video
+ * @param params.quality JPEG quality if JPEG was selected as the image format.
+ * @param params.region The AWS region in which the video should be rendered.
+ * @param params.maxRetries How often rendering a chunk may fail before the video render gets aborted.
+ * @returns `Promise<{renderId: string; bucketName: string}>`
+ */
export const renderVideoOnLambda = async ({
functionName,
diff --git a/packages/lambda/src/pricing/calculate-price.ts b/packages/lambda/src/pricing/calculate-price.ts
index 5691fe7566..7f8b81cada 100644
--- a/packages/lambda/src/pricing/calculate-price.ts
+++ b/packages/lambda/src/pricing/calculate-price.ts
@@ -11,8 +11,8 @@ type EstimatePriceInput = {
/**
*
* @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.
- * @returns `number` Price in USD
* @link https://remotion.dev/docs/lambda/estimateprice
+ * @returns `number` Price in USD
*/
export const estimatePrice = ({
region,