[英]Change audio speed using ffmpeg node js
how do i change the speed of the song output using this function:如何使用此 function 更改歌曲 output 的速度:
function addAudio()
{
console.log("adding audio...");
ffmpeg()
.videoCodec('libx264')
.format('mp4')
.outputFormat('mp4')
.input(song)
.input(video)
.output(output1)
.on('end', () => {
resolve(output1);
}).on('error', (_err) => {
reject(_err);
}).run();
}
https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
this shows command line input but not sure how to use it in js function?这显示了命令行输入,但不确定如何在 js function 中使用它?
This worked for me这对我有用
ffmpeg("./audio.mp3").audioFilter("atempo=2.0").output("./fasterAudio.mp3").run();
Keep in mind that this is only.mp3 files and isn't a.mp4 or.mkv file.请记住,这只是.mp3 文件,而不是.mp4 或.mkv 文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.