diff --git a/main.go b/main.go index 57d4360..a1c5527 100644 --- a/main.go +++ b/main.go @@ -46,6 +46,13 @@ func main() { // 设置日志输出到文件 log.SetOutput(logFile) + _, err = os.Stat(config.Config.Record.Storage.Path) + if err != nil { + log.Println("录像文件夹配置失败", err) + return + } else { + log.Println("录像文件夹配置有效") + } // 每两秒定时执行 for { // 执行任务 @@ -61,7 +68,6 @@ func main() { break // 提前返回,避免不必要的循环 } } - log.Printf("处理任务结束, TaskID:【%s】,DeviceNo: %s\n", task.TaskID, task.DeviceNo) } } else { log.Println("同步任务失败:", err) diff --git a/util/ffmpeg.go b/util/ffmpeg.go index c66286a..5f839ae 100644 --- a/util/ffmpeg.go +++ b/util/ffmpeg.go @@ -177,10 +177,11 @@ func QuickVideoCut(inputFile string, offset, length int64, outputFile string) (b FfmpegExec, "-hide_banner", "-y", - "-ss", strconv.FormatInt(offset, 10), "-i", inputFile, "-c:v", "copy", "-an", + "-reset_timestamps", "1", + "-ss", strconv.FormatInt(offset, 10), "-t", strconv.FormatInt(length, 10), "-f", "mp4", outputFile,