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:

@echo off
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:

@echo off
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:


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:

@echo off
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:

@echo off
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



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

 01 task scheduler

2. Under the Actions window click Create Basic Task...

 02 task scheduler create basic task

3. Give a Name describing what it does

 03 task scheduler name

4. Select when to start the task

 04 task scheduler when

5. Set the time

 05 task scheduler time

6. Choose to start a program

 06 task scheduler start program

7. In ContaCam's Camera Advanced Settings dialog copy the control batch file path

 07 task scheduler copy

8. Paste the copied path into the Task Wizard

 08 task scheduler paste

9. As argument set the wished sensitivity

 09 task scheduler argument

10. Click Finish

 10 task scheduler finish

11. Repeat steps 2 to 10 to turn the recording OFF using an argument of 0 at another time

 11 task scheduler both

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.

 12 task scheduler not logged on

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.

 13 task scheduler run task as soon as possible



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:

@echo off
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).