Here are explained the ways to control ContaCam without the user interface. This API is well suited to live control ContaCam while it is running, but also when it is not running.
This batch file is found under each camera folder and is used to control the camera source by passing as parameter:
off: camera source obscured
on: camera source visible
For example a single .bat file can obscure the source for all cameras:
call "C:\ContaCam\My Camera 1\CAMERA.bat" off
call "C:\ContaCam\My Camera 2\CAMERA.bat" off
call "C:\ContaCam\My Camera 3\CAMERA.bat" off
and another one can revert the source back to visible with:
call "C:\ContaCam\My Camera 1\CAMERA.bat" on
call "C:\ContaCam\My Camera 2\CAMERA.bat" on
call "C:\ContaCam\My Camera 3\CAMERA.bat" on
This batch file is found under each camera folder and is used to control the recording state / sensitivity by passing a value between 0 and 100 as parameter:
0: REC OFF
5, 10, 20, 30, 40, 50, 60, 70, 80, 90: increasing motion detection sensitivity
100: continuous REC
For example a single .bat file can set the recording state to OFF for all cameras:
call "C:\ContaCam\My Camera 1\CAMERA_REC_SENSITIVITY.bat" 0
call "C:\ContaCam\My Camera 2\CAMERA_REC_SENSITIVITY.bat" 0
call "C:\ContaCam\My Camera 3\CAMERA_REC_SENSITIVITY.bat" 0
and another one can turn it ON with individual motion sensitivities:
call "C:\ContaCam\My Camera 1\CAMERA_REC_SENSITIVITY.bat" 40
call "C:\ContaCam\My Camera 2\CAMERA_REC_SENSITIVITY.bat" 60
call "C:\ContaCam\My Camera 3\CAMERA_REC_SENSITIVITY.bat" 50
WINDOWS TASK SCHEDULER
The operating system integrates a powerful scheduler which can be used to control ContaCam through the above mentioned batch files. Let's see how to setup a Basic Windows Task Scheduler entry to turn ON the motion recording with a sensitivity of 50 at 7 AM:
1. Type "task scheduler" into the Windows search box and click the appearing entry
2. Under the Actions window click Create Basic Task...
3. Give a Name describing what it does
4. Select when to start the task
5. Set the time
6. Choose to start a program
7. In ContaCam's Camera Advanced Settings dialog copy the control batch file path
8. Paste the copied path into the Task Wizard
9. As argument set the wished sensitivity
10. Click Finish
11. Repeat steps 2 to 10 to turn the recording OFF using an argument of 0 at another time
12. Additional task settings
Double-click the listed task entries visible in step 11. to edit their settings. It is better to run a task also when not logged on into Windows, for that in General tab switch to "Run whether user is logged on or not" and confirm pressing OK; in the appearing dialog provide your credentials. This also helps hiding the command window that shows when the task gets executed.
Moreover it can happen that exactly during a reboot the recording state / sensitivity change is missed. To fix that in Settings tab check "Run task as soon as possible after a scheduled start is missed" and confirm pressing OK.
Note: by enabling this option Windows will run all missed tasks at the same time exactly 10 minutes after the computer is powered back on.
Another usage for CAMERA_REC_SENSITIVITY.bat is to trigger a recording through an external PIR detector.
A. Start/stop PIR detector attached to the computer which on detection-start increases the sensitivity through the following command:
"C:\ContaCam\My Camera\CAMERA_REC_SENSITIVITY.bat" 100
and on detection-stop decreases it running the following command:
"C:\ContaCam\My Camera\CAMERA_REC_SENSITIVITY.bat" 0
B. Start only PIR detector attached to the computer which on detection executes the following .bat file:
call "C:\ContaCam\My Camera\CAMERA_REC_SENSITIVITY.bat" 100
timeout /T 5
call "C:\ContaCam\My Camera\CAMERA_REC_SENSITIVITY.bat" 0
Note: adapt the timeout line according to the wished length of the recording (in seconds).