You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement the converter into wav. It works pretty fine for mp3/ogg files. But then I wanted to use the same implementation for mp4 file (ie cut the video, convert it into wav) But the output is always empty.
How do I debug the execution and understand what goes wrong?
Steps to reproduce:
To simplify the process, I first tried the convertation with ffmpeg cli: ./node_modules/ffmpeg-static/ffmpeg -i ~/Downloads/file_97.mp4 -vn -ac 1 -ar 16000 test.wav
it works good ^^
Then in the code, I do almost the same, but do a GET request to download the file rather than read the file from the file system. the result is empty...
import{FFmpeg}from"prism-media";constgetMpegDecoder=(): FFmpeg=>newFFmpeg({args: ["-analyzeduration","0","-loglevel","0","-vn","-ar","16000","-ac","1",],});constgetWavBuffer=(fileLink: string): Promise<Buffer>=>{// buffer is emptylogger.info("Converting into wav 💿");returnnewPromise<Buffer>((resolve,reject)=>{runGet(fileLink,(response)=>{constwavBuffer: Buffer[]=[];constwavStream=response.pipe(getMpegDecoder());wavStream.on("data",(bufferPart)=>wavBuffer.push(bufferPart));wavStream.on("error",(err)=>reject(err));wavStream.on("end",()=>resolve(Buffer.concat(wavBuffer)));}).on("error",(err)=>reject(err));});};
The text was updated successfully, but these errors were encountered:
Issue:
I am trying to implement the converter into wav. It works pretty fine for mp3/ogg files. But then I wanted to use the same implementation for mp4 file (ie cut the video, convert it into wav) But the output is always empty.
How do I debug the execution and understand what goes wrong?
Steps to reproduce:
To simplify the process, I first tried the convertation with ffmpeg cli:
./node_modules/ffmpeg-static/ffmpeg -i ~/Downloads/file_97.mp4 -vn -ac 1 -ar 16000 test.wav
it works good ^^
Then in the code, I do almost the same, but do a GET request to download the file rather than read the file from the file system. the result is empty...
The text was updated successfully, but these errors were encountered: