私はffmpegをインストールして、それを自分のパスに追加しました。
ffmpeg
をcmd.exeで実行すると、ffmpeg.exeが実行されます。child_process.execがパスにcmdを見つけられない
しかし、私はこれを使用する場合:
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.
これはhapppens、なぜ私は理解していません。私はVSCodeのデバッグでこのアプリを実行しています。
編集:asyncExecこの機能である:
const asyncExec = text => new Promise((res, rej) => {
exec(text, (err, result) => {
if (err) {
rej(err);
} else {
res(result);
}
});
});
実際に何が起こっているかを実際に確認するには、コールバックに出力を入れてください。 –