From 1baeb09d5c9f9fc818b1decf6e85f06eb92ef395 Mon Sep 17 00:00:00 2001 From: fanxb Date: Mon, 5 Dec 2022 11:11:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=9D=E7=95=99=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1c122f8..6607b61 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ function saveFile () { if (fs.existsSync(cachePath)) { cache = JSON.parse(fs.readFileSync(cachePath, 'utf-8')); } - await deal("Z:\\userData\\视频", 2500, true, "cuda"); + await deal("Z:\\userData\\视频", 3000, true, "cuda"); if (timer) { clearInterval(timer); } @@ -95,7 +95,7 @@ async function deal (basePath, maxBitRate = 2500, changeName = false, hardType) newName = name.substr(0, index) + ".h265" + name.substr(index); } let newFilePath = path.join(basePath, newName); - let cmdStr = `ffmpeg.exe ${hwType} ${is10Bit ? "" : decodeType} -i "${filePath}" ${encodeType} -maxrate ${bitRate}K -c:a copy -y "${newFilePath}"`; + let cmdStr = `ffmpeg.exe ${hwType} ${is10Bit ? "" : decodeType} -i "${filePath}" -map 0 ${encodeType} -maxrate ${bitRate}K -c:a copy -c:s copy -y "${newFilePath}"`; console.log(cmdStr); let cmdRes = await cmd.exec(cmdStr); let index = cmdRes.stderr.indexOf("video:");