wa-sticker-formatter
wa-sticker-formatter copied to clipboard
video to sticker giving error
not able to convert video to a sticker @AlenSaito1
handleExit(new Error('ffmpeg exited with code ' + code)); ^ Error: ffmpeg exited with code 1 at ChildProcess.
(D:\Giga\Java Script\I-BOT\node_modules\fluent-ffmpeg\lib\processor.js:182:22) at ChildProcess.emit (events.js:315:20) at ChildProcess.EventEmitter.emit (domain.js:486:12) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) error Command failed with exit code 1.
Could you share a relevant code snippet and the image/video which you were converting?
const stream = await downloadContentFromMessage( msg.videoMessage, "video" ); let buffer = Buffer.from([]); for await (const chunk of stream) { buffer = Buffer.concat([buffer, chunk]); } let randomName = (Math.random() + 1).toString(36).substring(7); fileName =
Media/stickers/${randomName}.mp4
; await writeFile(fileName, buffer); }
const sticker = new Sticker(fileName, {
pack: "I-Bot Stickers", // The pack name
author: "I-Bot", // The author name
type: StickerTypes.CROP, // The sticker type
categories: ["🤩", "🎉"], // The sticker category
id: "12345", // The sticker id
quality: 50, // The quality of the output file
});
await sock.sendMessage(chatId, await sticker.toMessage());
}
https://user-images.githubusercontent.com/72668899/162237383-453e2bda-b9cb-496f-8714-d28f78fd4994.mp4
Thanks, I'll get back to you in a while
It worked for me. Are you on the latest version of WSF?
Thank you for the code. It worked for me.