最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

child

IT培训 admin 4浏览 0评论

child

所以我安装了ffmpeg并将其添加到我的路径中。 如果我在cmd.exe中运行ffmpeg,它将运行ffmpeg.exe。

但是当我使用它时:

const { exec } = require('child_process');

await asyncExec(`ffmpeg -i ${filename}%05d.png ${aviname}`);
//Note: the variables are filled in

我收到此错误:

Command failed: ffmpeg -i thing%05d.png thing.avi
'ffmpeg' is not recognized as an internal or external command,\r\noperable program or batch file.

我不明白为什么会这样开心。我只是在VSCode调试中运行这个应用程序。

编辑:asyncExec是这个函数:

const asyncExec = text => new Promise((res, rej) => {
    exec(text, (err, result) => {
        if (err) {
            rej(err);
        } else {
            res(result);
        }
    });
});
回答如下:

重新启动Visual Studio代码后,它再次工作。奇怪的。

child

所以我安装了ffmpeg并将其添加到我的路径中。 如果我在cmd.exe中运行ffmpeg,它将运行ffmpeg.exe。

但是当我使用它时:

const { exec } = require('child_process');

await asyncExec(`ffmpeg -i ${filename}%05d.png ${aviname}`);
//Note: the variables are filled in

我收到此错误:

Command failed: ffmpeg -i thing%05d.png thing.avi
'ffmpeg' is not recognized as an internal or external command,\r\noperable program or batch file.

我不明白为什么会这样开心。我只是在VSCode调试中运行这个应用程序。

编辑:asyncExec是这个函数:

const asyncExec = text => new Promise((res, rej) => {
    exec(text, (err, result) => {
        if (err) {
            rej(err);
        } else {
            res(result);
        }
    });
});
回答如下:

重新启动Visual Studio代码后,它再次工作。奇怪的。

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论