feat:增加文件校验
This commit is contained in:
parent
10d1755437
commit
612677195e
7
index.js
7
index.js
@ -38,10 +38,15 @@ async function deal (basePath) {
|
|||||||
let index = name.lastIndexOf('.');
|
let index = name.lastIndexOf('.');
|
||||||
newName = name.substr(0, index) + ".h265" + name.substr(index);
|
newName = name.substr(0, index) + ".h265" + name.substr(index);
|
||||||
}
|
}
|
||||||
let cmdStr = `ffmpeg.exe -hwaccel cuda -c:v h264_cuvid -i "${filePath}" -c:v hevc_nvenc -maxrate ${bitRate}K -c:a copy "${path.join(basePath, newName)}"`;
|
let newFilePath = path.join(basePath, newName);
|
||||||
|
let cmdStr = `ffmpeg.exe -hwaccel cuda -c:v h264_cuvid -i "${filePath}" -c:v hevc_nvenc -maxrate ${bitRate}K -c:a copy "${newFilePath}"`;
|
||||||
console.log(cmdStr);
|
console.log(cmdStr);
|
||||||
let changeRes = cmd.execSync(cmdStr, { encoding: 'utf-8' });
|
let changeRes = cmd.execSync(cmdStr, { encoding: 'utf-8' });
|
||||||
console.log(changeRes);
|
console.log(changeRes);
|
||||||
|
if (!fs.existsSync(newFilePath)) {
|
||||||
|
console.log("未知错误,文件转换失败");
|
||||||
|
return;
|
||||||
|
}
|
||||||
//字幕,nfo文件重命名
|
//字幕,nfo文件重命名
|
||||||
let namePart1 = name.substr(0, name.lastIndexOf('.'));
|
let namePart1 = name.substr(0, name.lastIndexOf('.'));
|
||||||
let newNamePart1 = newName.substr(0, newName.lastIndexOf('.'));
|
let newNamePart1 = newName.substr(0, newName.lastIndexOf('.'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user