A little note about insane filesystem restrictions due to arcane standards
This commit is contained in:
parent
77c049aa52
commit
4ba8936fb9
4
main.go
4
main.go
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user