2021年2月5日星期五

FFMPEG commands on JavaScript

I am Recording audio in .pcm format and I want it to convert it into .wav Using CMD ffmpeg commands

ffmpeg -f s16le -ar 44.1k -ac 2 -i input.pcm output.wav  

But I want to do it through JavaScript simultaneously,

I have Tried This:

const ffmpeg = require('child_process').exec          let input = './audio/input.pcm';          let output = './audio/output.wav';            ffmpeg(`ffmpeg -f s16le -ar 44.1k -ac 2 -i ${input} ${output}`)  

This is giving me output.wav but it is not proper output

1 issue That I observed is that if my input.pcm is of 600KB but my output.wav is 90KB So, its not converting it properly... How can I fix this ????

Thanks in Advance

https://stackoverflow.com/questions/66073476/ffmpeg-commands-on-javascript February 06, 2021 at 12:07PM

没有评论:

发表评论