Add catch for failed snap on video file

plugin-touch-ups
Moe 2024-09-18 13:49:32 -07:00
parent 7228a70937
commit 06450c5e7e
1 changed files with 8 additions and 4 deletions

View File

@ -886,10 +886,14 @@ module.exports = (s,config,lang) => {
try{
await fsP.stat(framePath)
}catch(err){
const frameBuffer = await getVideoFrameAsJpeg(videoPath, secondsIn);
await fsP.mkdir(location, { recursive: true })
await fsP.writeFile(framePath, frameBuffer)
await s.createTimelapseFrameAndInsert(activeMonitor,location,frameFilename, frameTime._d)
try{
const frameBuffer = await getVideoFrameAsJpeg(videoPath, secondsIn);
await fsP.mkdir(location, { recursive: true })
await fsP.writeFile(framePath, frameBuffer)
await s.createTimelapseFrameAndInsert(activeMonitor,location,frameFilename, frameTime._d)
}catch(err){
console.error(err)
}
}
// console.error('Completed Saving Frame from New Video!', framePath)
}