gpt4 book ai didi

node.js - 为什么node.js找不到avconv?

转载 作者:太空宇宙 更新时间:2023-11-04 02:40:41 24 4
gpt4 key购买 nike

为什么在node.js中使用exec:

child = exec("avconv -i " + result.params.fullDestinationFilename + " -ab 128k -vcodec libx264 -vb 2000k -r 24 -s 1280x720 " + convertedFileName720p + ".mp4", function (error, stdout, stderr) {
sys.print('stdout: ' + stdout);
sys.print('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
console.log("CONVERTED!");
});

我收到错误:

  exec error: Error: Command failed: /bin/sh: avconv: command not found

在bash中我可以正常执行它。对于 Node.js 开发,我使用 nodeclipse。

最佳答案

供引用

var exec = require('child_process').exec;
exec("ls -la");

关于node.js - 为什么node.js找不到avconv?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16461482/

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