AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
05/02/2024 - 04:27 AM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
Save Video with defined rules for rotation
By: SyedF
Rank: Frequent User
Topics: 25
From: n/a
Added: 05/10/2011 - 01:12 PM

Hello,

I am running the latest version of AbelCam with two PTZ cameras. I want to know that how can I configure AbelCam to record video input from any camera to a specific location.

Furthermore how to break recorded video files, for example by date/hour/day so it should make a new file whenever the criteria is met, additionally is there any way to rotate saved video recording based on defined rules. For example I want to keep the recording of the past 5 days and after that it can delete the earliest one to keep recording the current day.

I need this type of video recording for home security and survelliance , if anyone know how to make the idea work or any alternate way to achieve this, then I would really appreciate if you can share with us all.

Thanks.

By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 05/10/2011 - 08:09 PM

From SyedF:
Hello,

I am running the latest version of AbelCam with two PTZ cameras. I want to know that how can I configure AbelCam to record video input from any camera to a specific location.


I'm not sure I understand this part of your questions. The obvious answer is that in the Video Save config for each camera you can select whatever directory you want it to put the video files in. But I don't think that is what you are asking (?)


Furthermore how to break recorded video files, for example by date/hour/day so it should make a new file whenever the criteria is met,

First select "Time based name" in the Video Save config. This will cause every video file to be given a unique name based on recording start time.

Then use the AbelCam Scheduler to do Add Cam every hour/day/whatever you want. Have it add the same cam to the same cam number (IOW you have it re-add a camera that is already existing and running) This sounds like it would be pointless, but what happens is that it will cause the cam to stop and re-start, which will break the video file like you want.


additionally is there any way to rotate saved video recording based on defined rules. For example I want to keep the recording of the past 5 days and after that it can delete the earliest one to keep recording the current day.


No easy answer. This capability exists in AbelCam for Local Save files but not for Video Save files. Before AbelCam had this feature I wrote a "shell script" (actually called a WSH VBS Script on Windows) that deletes all jpg files from c:\camstills\ that are more than one day old. I set it up in Windows Task Scheduler to run once a day. It worked fine. I'll paste the script code below - you could probably modify it pretty easily to delete video files from whatever directory you want, with a different number of days, etc.


dtmTargDate = date
dtmTargDate = DateAdd("d", -2, dtmTargDate)

strMonth = Month(dtmTargDate)
If Len(strMonth) = 1 Then
    strMonth = "0" & strMonth
End If

strDay = Day(dtmTargDate)
If Len(strDay) = 1 Then
    strDay = "0" & strDay
End If

strDelDate = Year(dtmTargDate)
strDelDate = strDelDate & strMonth
strDelDate = strDelDate & strDay
strDelDate = strDelDate & "000000.000000-480"

' Uncomment the following line for testing
' Wscript.Echo strDelDate

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colFileList = objWMIService.ExecQuery _
    ("Select * From CIM_DataFile Where " & _
    "CreationDate < '" & strDelDate & "'" & _
    "AND Drive = 'C:' " & _
    "AND Path = '\\camstills\\' " & _
    "AND Extension = 'jpg'")

For Each objFile In colFileList
    objFile.Delete
Next
By: SyedF
Rank: Frequent User
Topics: 25
From: n/a
Added: 05/10/2011 - 08:33 PM

Thank you Melvin,

Unfortunately I dont know anything about VBS code or how to make it work. Maybe if you explain it a bit then I might find it working for me. Task scheduling is one thing which I would do myself.

Add comments in critical lines of code which are doing the job. I want Video files (*.avi or *.wmv) to be deleted which are more than "X" number of days old

Thanks.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 05/10/2011 - 09:36 PM

Okay, maybe clearer like this:


dtmTargDate = date

' The -2 below is minus 2 days. That means we delete
' all files that are 2 or more days old, and keep
' the ones that are <= 1 day old.
' For 5 days use -6, 10 days -11, etc.

dtmTargDate = DateAdd("d", -2, dtmTargDate)

' No need to change the following block of code
' it is just converting the delete date-time to
' a format acceptable for WMI queries.
strMonth = Month(dtmTargDate)
If Len(strMonth) = 1 Then
    strMonth = "0" & strMonth
End If
strDay = Day(dtmTargDate)
If Len(strDay) = 1 Then
    strDay = "0" & strDay
End If
strDelDate = Year(dtmTargDate)
strDelDate = strDelDate & strMonth
strDelDate = strDelDate & strDay
strDelDate = strDelDate & "000000.000000+000"

' Uncomment following line for testing
' Wscript.Echo strDelDate

' Don't change this block
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

' Here you see the Drive (C: ), the Path (\camstills\)
' [but note that you must use double backslashes "\\"]
' and the file type (jpg).
' So this code deletes JPG files from C:\camstills\

Set colFileList = objWMIService.ExecQuery _
    ("Select * From CIM_DataFile Where " & _
    "CreationDate < '" & strDelDate & "'" & _
    "AND Drive = 'C:' " & _
    "AND Path = '\\camstills\\' " & _
    "AND Extension = 'jpg'")

For Each objFile In colFileList

' Uncomment next line to do real deleting
'    objFile.Delete

' Comment out next line when done testing
Wscript.Echo objFile.Name

Next


Save it with .vbs extension. When you type name.vbs on the command line Windows should know to process the .vbs file with the WSH.

The code is set up for "safe" testing - it will not actually delete anything but it will pop up message boxes giving the names of files it would delete. (that is what Wscript.Echo does - 'prints' in a message box). When you are ready for it to delete for real, comment out the line "Wscript.Echo objFile.Name" and uncomment "objFile.Delete"

Also note that it can take a few minutes for it to build the list of files. If it looks like it is not doing anything, check your hard drive LED and you will probably see that it is searching the disk.
By: SyedF
Rank: Frequent User
Topics: 25
From: n/a
Added: 05/12/2011 - 04:31 PM

Check this freeware to do the same

http://eraser.heidi.ie/

Although we would love if the same video rotation and customizable rules for making video files are defined in AbelCam, pretty much like a reasonable security DVR system.

Thanks.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 05/13/2011 - 04:20 AM

I installed "Eraser" to check it out. It's an interesting program but I can not see way to set up "files older than" in its schedule. I think I'll keep it for the secure deletion capabilities for those occasions when I want KGB-style secrecy Wink.
By: sse
Rank: Forum Addict
Topics: 73
From: n/a
Added: 05/13/2011 - 07:55 AM

Ok - will implement the limits for Video Save. They will be just like those in Local Save.
By: SyedF
Rank: Frequent User
Topics: 25
From: n/a
Added: 05/14/2011 - 03:11 PM

From sse:
Ok - will implement the limits for Video Save. They will be just like those in Local Save.


Thank you.

Please also consider a way for implementing rules to break video save files according to time limit (days/months/hours).

This would be easier for the users to do it via rules instead of removing and re-adding the same cameras just to divide a lengthy video recording file.

Thanks again.
By: sse
Rank: Forum Addict
Topics: 73
From: n/a
Added: 05/17/2011 - 06:30 PM

Rule to break video save files will be implemented as a recording time limit.

The time limit will be defined in minutes (maximum length of recording, not of the created video - with motion detection or save on web access the video can be much shorter than the defined length).

If the time limit is enabled, other video save stop/restart options will be disabled
By: SyedF
Rank: Frequent User
Topics: 25
From: n/a
Added: 05/18/2011 - 06:25 AM

From sse:
Rule to break video save files will be implemented as a recording time limit.

The time limit will be defined in minutes (maximum length of recording, not of the created video - with motion detection or save on web access the video can be much shorter than the defined length).

If the time limit is enabled, other video save stop/restart options will be disabled


Ok please keep the option to create a new video file (with name based on date/time), when the old video file is split based on the time limit or file size as you have mentioned.

Thanks.
By: sse
Rank: Forum Addict
Topics: 73
From: n/a
Added: 06/24/2011 - 09:52 AM

The new feature set is available in the public version of AbelCam.