fulent-ffmpeg 参数输入无效 |节点
fulent-ffmpeg arguments inputs are invalid | nodejs
我将如何编写此命令
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 fluent-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"
])
查看如何使用带有参数 here and here an example how to scale
的 outputOptions
我将如何编写此命令
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 fluent-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"
])
查看如何使用带有参数 here and here an example how to scale
的outputOptions