Skip to content

🎥 Make videos programmatically with React

`@remotion/lambda`: serve URL

Jonny Burger2f386c38b101
diff --git a/packages/lambda/src/functions/launch.ts b/packages/lambda/src/functions/launch.ts
index 10e5e2f1e1..656d56ef02 100644
--- a/packages/lambda/src/functions/launch.ts
+++ b/packages/lambda/src/functions/launch.ts
@@ -33,7 +33,6 @@ import {
} from '../shared/constants';
import {DOCS_URL} from '../shared/docs-url';
import {invokeWebhook} from '../shared/invoke-webhook';
-import {getServeUrlHash} from '../shared/make-s3-url';
import {validateFramesPerLambda} from '../shared/validate-frames-per-lambda';
import {validateOutname} from '../shared/validate-outname';
import {validatePrivacy} from '../shared/validate-privacy';
@@ -290,7 +289,7 @@ const innerLaunchHandler = async (
].reduce((a, b) => a + b, 0),
estimatedRenderLambdaInvokations: chunks.length,
compositionId: comp.id,
- siteId: getServeUrlHash(params.serveUrl),
+ siteId: params.serveUrl,
codec: params.codec,
type: 'video',
imageFormat: params.imageFormat,
diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.ts
index 0579179ae0..ccd63269ed 100644
--- a/packages/lambda/src/functions/still.ts
+++ b/packages/lambda/src/functions/still.ts
@@ -22,7 +22,6 @@ import {
} from '../shared/constants';
import {convertToServeUrl} from '../shared/convert-to-serve-url';
import {isFlakyError} from '../shared/is-flaky-error';
-import {getServeUrlHash} from '../shared/make-s3-url';
import {validateDownloadBehavior} from '../shared/validate-download-behavior';
import {validateOutname} from '../shared/validate-outname';
import {validatePrivacy} from '../shared/validate-privacy';
@@ -138,7 +137,7 @@ const innerStillHandler = async ({
compositionId: lambdaParams.composition,
estimatedTotalLambdaInvokations: 1,
estimatedRenderLambdaInvokations: 1,
- siteId: getServeUrlHash(serveUrl),
+ siteId: serveUrl,
totalChunks: 1,
type: 'still',
imageFormat: lambdaParams.imageFormat,
diff --git a/packages/lambda/src/shared/make-s3-url.ts b/packages/lambda/src/shared/make-s3-url.ts
index bed256424f..f63a5c1d09 100644
--- a/packages/lambda/src/shared/make-s3-url.ts
+++ b/packages/lambda/src/shared/make-s3-url.ts
@@ -1,4 +1,3 @@
-import crypto from 'node:crypto';
import type {AwsRegion} from '../pricing/aws-regions';
export const makeS3ServeUrl = ({
@@ -12,17 +11,3 @@ export const makeS3ServeUrl = ({
}): string => {
return `https://${bucketName}.s3.${region}.amazonaws.com/${subFolder}/index.html`;
};
-
-const hashCache: {[key: string]: string} = {};
-
-export const getServeUrlHash = (url: string) => {
- if (hashCache[url]) {
- return hashCache[url];
- }
-
- const hash = crypto.createHash('md5').update(url).digest('hex');
-
- hashCache[url] = hash;
-
- return hash;
-};