A little note about insane filesystem restrictions due to arcane standards

This commit is contained in:
Steven Polley 2020-10-30 00:48:24 +00:00
parent 77c049aa52
commit 4ba8936fb9
1 changed files with 2 additions and 2 deletions

View File

@ -88,8 +88,8 @@ func main() {
if frameCount >= motionDetectInterval {
if detectMotion(img) {
// Determine if a new recording needs to start, we may already have one running
if time.Now().After(lastMotionDetectedTime.Add(time.Second * recordLengthAfterMotion)) { //
fileName := fmt.Sprintf("%s/storage-security-%s.avi", syncFolder, time.Now().Format("2006-01-02-15-04-05"))
if time.Now().After(lastMotionDetectedTime.Add(time.Second * recordLengthAfterMotion)) {
fileName := fmt.Sprintf("%s/storage-security-%s.avi", syncFolder, time.Now().Format("2006-01-02-15-04-05")) // My preferred timestamp format is RFC3339, however there are weird filesystems out there that don't like colons in the names of files such as NTFS or FAT32.
log.Printf("motion detected, started recording to file named %s", fileName)
currentRecording, err = gocv.VideoWriterFile(fileName, "MJPG", 25, img.Cols(), img.Rows(), true)
if err != nil {