#FFMPEG to change video format and sending it with WS JS

2 messages · Page 1 of 1 (latest)

hollow wadi
#

Hi all, im having problems sending videos using the library, it doesnt throw an error, its just doesnt send the video as its supposed to.

Im aware of the limitations regarding the MP4 CODEC format of the WS JS library. And of the puppeteer executablePath to Chrome.

Ive installed FFMPEG to modify the CODEC of the mp4 files but it still doesnt work,
could you guys share the command you use in FFMPEG to modify the videos that work?

Just in case this is the sample code :

const { Client , LocalAuth } = require('whatsapp-web.js');
const qrcode = require('qrcode-terminal');
const { MessageMedia } = require('whatsapp-web.js');

const client = new Client({
puppeteer: {
executablePath: 'C://Program Files//Google//Chrome//Application//chrome.exe',
},
authStrategy: new LocalAuth({
dataPath: 'testCache'}),
webVersion: '2.2409.2',
webVersionCache: {
type: 'remote',
remotePath: 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/2.2409.2.html'
}
});

async function testFuncionSendVideo(message){
console.log("supposed to send a video")

const media = MessageMedia.fromFilePath('./media/video/testVideo.mp4');
await client.sendMessage(message.from, media);
}

client.on('message', message => {
testFuncionSendVideo(message)
}
)

hollow wadi