Skip to content

Commit

Permalink
Merge pull request #1435 from mfts/marc/pm-61-upload-video-to-s3
Browse files Browse the repository at this point in the history
refactor: update trigger to avoid memory trap
  • Loading branch information
mfts authored Jan 11, 2025
2 parents b675b06 + 889ee61 commit 931bd33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/trigger/optimize-video-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 931bd33

Please sign in to comment.