gpt4 book ai didi

node.js - fulent-ffmpeg 参数输入无效 | Node

转载 作者:行者123 更新时间:2023-12-04 23:12:21 27 4
gpt4 key购买 nike

我将如何编写此命令ffmpeg -i input.mov -preset slow -codec:a libfdk_aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -minrate 1500k -maxrate 4000k -bufsize 5000k -vf scale=-1:720 output.mp4作为 Node 流利的ffmpeg命令?
我有什么

function convert(input, output, callback) {
ffmpeg(input)
.output(output)
.outputOptions(
"-preset","slow","-codec:a","libfdk_aac","-b:a","128k","-codec:v","-pix_fmt","-b:v","2500k","-vf","scale","\"-1:720\""
)
.on("end", function () {
console.log("conversion ended");
callback(null);
})
.on("error", function (err) {
console.log("error x: ", err);
callback(err);
})
.run();
}
我收到错误说参数无效。例如但不限于:
  • Error: ffmpeg exited with code 1: "-1:720": Invalid argument

  • 和其他变体

    最佳答案

    试试这个:

    .outputOptions([
    "-preset slow",
    "-codec:a libfdk_aac",
    "-b:a 128k",
    "-codec:v libx264",
    "-pix_fmt yuv420p",
    "-b:v 2500k",
    "-vf scale=-1:720"
    ])
    了解如何使用 outputOptions带参数 here这里是一个例子 how to scale

    关于node.js - fulent-ffmpeg 参数输入无效 | Node ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63547510/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com