as you can see, data is logged twice in the console. This the current getFFmpegVersion function :
function getFFmpegVersion(ffpath) {
return new Promise((resolve, reject) => {
let ffmpeg_exec = spawn(ffpath, ["-version"]);
let version = "";
ffmpeg_exec.on("error", (e) => {
reject(e);
});
ffmpeg_exec.stdout.on("data", (data) => {
try {
version = data
.toString()
.split(/(?:\r\n|\r|\n)/g)[0]
.split(" ")[2];
} catch (e) {}
});
ffmpeg_exec.on("close", (code) => {
resolve(version);
});
});
}
in this function, you set the version variable to the last data you get on the stdout result, and that because it not work, the solution is simple we can wait until you get all data and then parse it i will send a pull request for it
in last version of ffmpeg the description of
-version
command is increased so the buffer sends data twice like this :as you can see, data is logged twice in the console. This the current
getFFmpegVersion
function :in this function, you set the version variable to the last data you get on the stdout result, and that because it not work, the solution is simple we can wait until you get all data and then parse it i will send a pull request for it