From 29adb6afb8d7bf7888000ca5c719b1dc0709961b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emrik=20=C3=96stling?= Date: Sun, 14 Dec 2025 11:43:11 +0100 Subject: [PATCH] fix: ffmpeg args #464, #401 --- mise.toml | 1 + src/converters/ffmpeg.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mise.toml b/mise.toml index a52e4a5..89978a8 100644 --- a/mise.toml +++ b/mise.toml @@ -3,3 +3,4 @@ bun = "1.2.2" [env] JWT_SECRET = "JustForDevelopmentPurposesOnlyChangeMeInProduction!" +FFMPEG_ARGS = "-preset veryfast -threads 2" diff --git a/src/converters/ffmpeg.ts b/src/converters/ffmpeg.ts index f7d183f..fc9618b 100644 --- a/src/converters/ffmpeg.ts +++ b/src/converters/ffmpeg.ts @@ -699,7 +699,7 @@ export async function convert( let message = "Done"; if (convertTo === "ico") { - // make sure image is 256x256 or smaller + // Make sure image is 256x256 or smaller extraArgs = [ "-filter:v", "scale='min(256,iw)':min'(256,ih)':force_original_aspect_ratio=decrease", @@ -708,7 +708,7 @@ export async function convert( } if (convertTo.split(".").length > 1) { - // support av1.mkv and av1.mp4 and h265.mp4 etc. + // Support av1.mkv and av1.mp4 and h265.mp4 etc. const split = convertTo.split("."); const codec_short = split[0]; @@ -734,7 +734,7 @@ export async function convert( return new Promise((resolve, reject) => { execFile( "ffmpeg", - [...ffmpegArgs, "-i", filePath, ...extraArgs, targetPath], + ["-i", filePath, ...ffmpegArgs, ...extraArgs, targetPath], (error, stdout, stderr) => { if (error) { reject(`error: ${error}`);