This commit is contained in:
Vaica committed 2026-06-22 18:35:51 +08:00
1 parent 591abf5877
commit f70b603cf7
3 files changed
+56 -38

No files matched your search

+1 -1
View File
@@ -269,7 +269,7 @@ async function handleDocument(chatId: number, fileId: string, fileName?: string,
const gifPath = path.join(articleDir, gifFilename);
try {
await sendMessage(chatId, "🎞️ 正在转换 GIF...");
execSync(`ffmpeg -y -i "${fullPath}" -vf "fps=15,scale=480:-1:flags=lanczos" -loop 0 "${gifPath}"`, { timeout: 60000 });
execSync(`ffmpeg -y -i "${fullPath}" -vf "fps=15,scale=480:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" -loop 0 "${gifPath}"`, { timeout: 60000 });
fs.unlinkSync(fullPath);
appendContent(chatId, `\n![${fileCaption}](${gifFilename})\n`);
await sendMessage(chatId, `🎞️ GIF 已转换:${gifFilename}`);