Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

refactor: update trigger to avoid memory trap

Marc Seitz889ee618a7e0
diff --git a/lib/trigger/optimize-video-files.ts b/lib/trigger/optimize-video-files.ts
index 1d5eb5fc..43c4e646 100644
--- a/lib/trigger/optimize-video-files.ts
+++ b/lib/trigger/optimize-video-files.ts
@@ -14,7 +14,7 @@ import prisma from "@/lib/prisma";
export const processVideo = task({
id: "process-video",
machine: {
- preset: "small-2x",
+ preset: "medium-1x",
},
run: async (payload: {
videoUrl: string;
@@ -115,11 +115,12 @@ export const processVideo = task({
`-b:v ${bitrate}`,
`-maxrate ${maxBitrate}k`,
`-bufsize ${maxBitrate}k`,
- "-preset slow",
+ "-preset medium",
`-g ${keyframeInterval}`,
`-keyint_min ${keyframeInterval}`,
"-sc_threshold 0",
"-movflags +faststart",
+ "-memory_limit 1000M",
])
.output(outputPath)
.on("start", (cmd) => {