🎥 Make videos programmatically with React
extend to lambda
Jonny Burger1f4ad2c94003
diff --git a/packages/lambda/src/api/render-media-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.tsindex a5763c5853..0d568d0839 100644--- a/packages/lambda/src/api/render-media-on-lambda.ts+++ b/packages/lambda/src/api/render-media-on-lambda.ts@@ -55,6 +55,8 @@ export type RenderMediaOnLambdaInput = {url: string;secret: string | null;};+ forceWidth?: number;+ forceHeight?: number;};export type RenderMediaOnLambdaOutput = {@@ -114,6 +116,8 @@ export const renderMediaOnLambda = async ({audioBitrate,videoBitrate,webhook,+ forceHeight,+ forceWidth,}: RenderMediaOnLambdaInput): Promise<RenderMediaOnLambdaOutput> => {const actualCodec = validateLambdaCodec(codec);validateServeUrl(serveUrl);@@ -165,6 +169,8 @@ export const renderMediaOnLambda = async ({audioBitrate: audioBitrate ?? null,videoBitrate: videoBitrate ?? null,webhook: webhook ?? null,+ height: forceHeight ?? null,+ width: forceWidth ?? null,},region,});diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.tsindex ae3eb071a6..980ded1b1d 100644--- a/packages/lambda/src/api/render-still-on-lambda.ts+++ b/packages/lambda/src/api/render-still-on-lambda.ts@@ -31,6 +31,8 @@ export type RenderStillOnLambdaInput = {chromiumOptions?: ChromiumOptions;scale?: number;downloadBehavior?: DownloadBehavior;+ forceWidth?: number;+ forceHeight?: number;};export type RenderStillOnLambdaOutput = {@@ -77,6 +79,8 @@ export const renderStillOnLambda = async ({chromiumOptions,scale,downloadBehavior,+ forceHeight,+ forceWidth,}: RenderStillOnLambdaInput): Promise<RenderStillOnLambdaOutput> => {const realServeUrl = await convertToServeUrl(serveUrl, region);@@ -108,6 +112,8 @@ export const renderStillOnLambda = async ({scale: scale ?? 1,downloadBehavior: downloadBehavior ?? {type: 'play-in-browser'},version: VERSION,+ height: forceHeight ?? null,+ width: forceWidth ?? null,},region,});diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex b4947d93a1..78f27a167b 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -125,8 +125,8 @@ export const renderCommand = async (args: string[]) => {overwrite,audioBitrate,videoBitrate,- height,- width,+ forceHeight: height,+ forceWidth: width,webhook: parsedLambdaCli.webhook? {url: parsedLambdaCli.webhook,diff --git a/packages/lambda/src/functions/start.ts b/packages/lambda/src/functions/start.tsindex 8633123730..6bfa20e28b 100644--- a/packages/lambda/src/functions/start.ts+++ b/packages/lambda/src/functions/start.ts@@ -78,6 +78,8 @@ export const startHandler = async (params: LambdaPayload, options: Options) => {webhook: params.webhook,audioBitrate: params.audioBitrate,videoBitrate: params.videoBitrate,+ height: params.height,+ width: params.width,};await getLambdaClient(getCurrentRegionInFunction()).send(new InvokeCommand({diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.tsindex 0ca2aceb00..91193ba38c 100644--- a/packages/lambda/src/shared/constants.ts+++ b/packages/lambda/src/shared/constants.ts@@ -245,9 +245,9 @@ export type LambdaPayloads = {overwrite: boolean;audioBitrate: string | null;videoBitrate: string | null;- height: number | undefined;- width: number | undefined;webhook: WebhookOption;+ height: number | null;+ width: number | null;};launch: {type: LambdaRoutines.launch;@@ -281,6 +281,8 @@ export type LambdaPayloads = {audioBitrate: string | null;videoBitrate: string | null;webhook: WebhookOption;+ height: number | null;+ width: number | null;};status: {type: LambdaRoutines.status;@@ -341,6 +343,8 @@ export type LambdaPayloads = {scale: number;downloadBehavior: DownloadBehavior | null;version: string;+ height: number | null;+ width: number | null;};};diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.tsindex d79e345081..6fb5f365a1 100644--- a/packages/lambda/src/test/integration/renders/gif.test.ts+++ b/packages/lambda/src/test/integration/renders/gif.test.ts@@ -64,8 +64,8 @@ test('Should make a distributed GIF', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- height: undefined,- width: undefined,+ height: null,+ width: null,},extraContext);diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.tsindex 5f37550ddf..1ee543c5ed 100644--- a/packages/lambda/src/test/integration/renders/old-version.test.ts+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts@@ -61,8 +61,8 @@ test('Should fail when using an incompatible version', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- height: undefined,- width: undefined,+ height: null,+ width: null,},extraContext)diff --git a/packages/lambda/src/test/integration/renders/other-bucket.test.ts b/packages/lambda/src/test/integration/renders/other-bucket.test.tsindex ebd5418f4e..6cc07574ba 100644--- a/packages/lambda/src/test/integration/renders/other-bucket.test.ts+++ b/packages/lambda/src/test/integration/renders/other-bucket.test.ts@@ -67,8 +67,8 @@ test('Should be able to render to another bucket', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- height: undefined,- width: undefined,+ height: null,+ width: null,},extraContext);diff --git a/packages/lambda/src/test/integration/renders/silent-audio.test.ts b/packages/lambda/src/test/integration/renders/silent-audio.test.tsindex b987ae6502..bfae26fa9a 100644--- a/packages/lambda/src/test/integration/renders/silent-audio.test.ts+++ b/packages/lambda/src/test/integration/renders/silent-audio.test.ts@@ -64,8 +64,8 @@ test('Should add silent audio if there is no audio', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- height: undefined,- width: undefined,+ height: null,+ width: null,},extraContext);diff --git a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts b/packages/lambda/src/test/integration/renders/transparent-webm.test.tsindex a067302fee..97e23cfd15 100644--- a/packages/lambda/src/test/integration/renders/transparent-webm.test.ts+++ b/packages/lambda/src/test/integration/renders/transparent-webm.test.ts@@ -67,8 +67,8 @@ test('Should make a transparent video', async () => {webhook: null,audioBitrate: null,videoBitrate: null,- height: undefined,- width: undefined,+ height: null,+ width: null,},extraContext);