Skip to content

🎥 Make videos programmatically with React

simplify

Jonny Burger56240d24381c
diff --git a/packages/template-vercel/src/app/api/render/helpers.ts b/packages/template-vercel/src/app/api/render/helpers.ts
index 06f7700ea6..abfb165c08 100644
--- a/packages/template-vercel/src/app/api/render/helpers.ts
+++ b/packages/template-vercel/src/app/api/render/helpers.ts
@@ -62,10 +62,6 @@ export function generateRenderScript(options: {
serveUrl: string;
compositionId: string;
inputProps: Record<string, unknown>;
- width: number;
- height: number;
- fps: number;
- durationInFrames: number;
}): string {
return `
const { renderMedia, selectComposition } = require("@remotion/renderer");
@@ -79,13 +75,7 @@ async function main() {
});
await renderMedia({
- composition: {
- ...composition,
- width: ${options.width},
- height: ${options.height},
- fps: ${options.fps},
- durationInFrames: ${options.durationInFrames},
- },
+ composition,
serveUrl: ${JSON.stringify(options.serveUrl)},
codec: "h264",
outputLocation: "/tmp/video.mp4",
diff --git a/packages/template-vercel/src/app/api/render/route.ts b/packages/template-vercel/src/app/api/render/route.ts
index 24d1a68912..0acc941b25 100644
--- a/packages/template-vercel/src/app/api/render/route.ts
+++ b/packages/template-vercel/src/app/api/render/route.ts
@@ -2,13 +2,7 @@ import { put } from "@vercel/blob";
import { waitUntil } from "@vercel/functions";
import path from "path";
import { RenderRequest } from "../../../../types/schema";
-import {
- COMP_NAME,
- DURATION_IN_FRAMES,
- VIDEO_FPS,
- VIDEO_HEIGHT,
- VIDEO_WIDTH,
-} from "../../../../types/constants";
+import { COMP_NAME } from "../../../../types/constants";
import { VERSION } from "remotion/version";
import {
createDisposableSandbox,
@@ -131,10 +125,6 @@ export async function POST(req: Request) {
serveUrl,
compositionId: COMP_NAME,
inputProps: body.inputProps,
- width: VIDEO_WIDTH,
- height: VIDEO_HEIGHT,
- fps: VIDEO_FPS,
- durationInFrames: DURATION_IN_FRAMES,
});
await sandbox.writeFiles([