🎥 Make videos programmatically with React
moved outname check to launch time
Apoorv Kansal2c07bd3c58af
diff --git a/packages/lambda/src/api/render-media-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.tsindex 9c0d244ba8..28a1ef536c 100644--- a/packages/lambda/src/api/render-media-on-lambda.ts+++ b/packages/lambda/src/api/render-media-on-lambda.ts@@ -6,7 +6,6 @@ import type {PixelFormat,ProResProfile,} from '@remotion/renderer';-import {RenderInternals, validateOutputFilename} from '@remotion/renderer';import {VERSION} from 'remotion/version';import type {AwsRegion} from '../pricing/aws-regions';import {callLambda} from '../shared/call-lambda';@@ -112,12 +111,6 @@ export const renderMediaOnLambda = async ({durationInFrames: 1,});validateDownloadBehavior(downloadBehavior);- if (outName === undefined || typeof outName === 'string') {- validateOutputFilename(- codec,- RenderInternals.getExtensionOfFilename(outName ?? null)- );- }const realServeUrl = await convertToServeUrl(serveUrl, region);try {diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.tsindex 57db1069cc..e1dc7ec92e 100644--- a/packages/lambda/src/functions/launch.ts+++ b/packages/lambda/src/functions/launch.ts@@ -165,7 +165,7 @@ const innerLaunchHandler = async (params: LambdaPayload, options: Options) => {);}- validateOutname(params.outName);+ validateOutname(params.outName, params.codec);validatePrivacy(params.privacy);RenderInternals.validatePuppeteerTimeout(params.timeoutInMilliseconds);diff --git a/packages/lambda/src/shared/validate-outname.ts b/packages/lambda/src/shared/validate-outname.tsindex 120347f08d..8573375a98 100644--- a/packages/lambda/src/shared/validate-outname.ts+++ b/packages/lambda/src/shared/validate-outname.ts@@ -1,3 +1,5 @@+import type {Codec} from '@remotion/renderer';+import {RenderInternals, validateOutputFilename} from '@remotion/renderer';import type {OutNameInputWithoutCredentials} from './constants';import {validateBucketName} from './validate-bucketname';@@ -18,13 +20,19 @@ const validateS3Key = (s3Key: string) => {};export const validateOutname = (- outName: OutNameInputWithoutCredentials | undefined | null+ outName: OutNameInputWithoutCredentials | undefined | null,+ codec: Codec) => {if (typeof outName === 'undefined' || outName === null) {return;}if (typeof outName === 'string') {+ validateOutputFilename(+ codec,+ RenderInternals.getExtensionOfFilename(outName ?? null)+ );+validateS3Key(outName);return;}