Rechercher dans la communauté
Affichage des résultats pour les étiquettes 'foscam autoit'.
1 résultat trouvé
-
Foscam : Soft De Recuperation D'image A Periode Et Duree Defini
Pink Floyd a posté un sujet dans Software
Bonjour a tous, petit post comme ca pour partager mon script en autoit qui permet de sauvegarder une image transmise par X ipcam foscam pour les sauvegarder dans un dossier, avec effacement des anciens fichiers ( ne trouvant pas de soft le faisant correctement j'ai pondu le mien, qui, sans mettre mes cam en mode alarme me permet de savoir ce qui c'est passé les 30 dernieres minutes ) donc pour ceux que ca interesse : #include <Date.au3> #include <Array.au3> #include <File.au3> #include <String.au3> $ini_file = @Scriptdir & "\capture_cam.ini" $purge_minute = IniRead($ini_file, "GENERAL", "PURGE" , "NotFound") $delay_image_seconde = IniRead($ini_file, "GENERAL", "INTERVAL", "NotFound") $array_ini = IniReadSectionNames ( $ini_file ) _arraydelete($array_ini,1) $array_ini[0] = $array_ini[0] - 1 While 1 for $boucle = 1 to $array_ini[0] _get_image($array_ini[$boucle]) Next sleep(($delay_image_seconde-$array_ini[0])*1000) WEnd func _get_image($ini_entry) $nom = IniRead($ini_file, $ini_entry, "NAME" , "NotFound") $url = IniRead($ini_file, $ini_entry, "URL" , "NotFound") $destination = IniRead($ini_file, $ini_entry, "FOLDER" , "NotFound") $purge = IniRead($ini_file, $ini_entry, "PURGE" , "NotFound") if FileExists($destination) <> 1 then DirCreate($destination) $date = Stringreplace(_DateTimeFormat(_NowCalc(), 2),"/","-") $time = Stringreplace(_NowTime(5),":","-") $prefix = $date & "__" & $time & "___" $hDownload = InetGet($url, $destination & $prefix & $nom & ".jpg", 1, 1) Do Sleep(250) Until InetGetInfo($hDownload, 2) InetClose($hDownload) _purge_file($destination,$purge) EndFunc func _purge_file($destination,$purge) $FileList = _FileListToArray($destination,"*.jpg",1) if IsArray($FileList) Then for $boucle = 1 to $FileList[0] $info = FileGetTime($destination & $FileList[$boucle], 1) $info = $info[0] & "/" & $info[1] & "/" & $info[2] & " " & $info[3] & ":" & $info[4] & ":" & $info[5] $result = _DateDiff('s', $info, _NowCalc()) if $result > ($purge * 60) then FileDelete($destination & $FileList[$boucle]) Next EndIf EndFunc et le fichier 'capture_cam.ini' associé : [GENERAL] INTERVAL=10 [CAM1] NAME=SALON URL=http://192.168.0.10:8010/snapshot.cgi?user=**&pwd=** FOLDER=o:\camera\salon\ PURGE=30 [CAM2] NAME=JULIEN URL=http://192.168.0.11:8011/snapshot.cgi?user=**&pwd=** FOLDER=o:\camera\julien\ PURGE=30