I want to store the field of view of the cameras connected to BVMS. Is there an easy way to achieve this without opening every camera manually?
The embedded BVMS script engine makes this easy to achieve. The steps below explain how to achieve this and it is included an example script.
You can use this concept to document the camera positions. The script does not take PTZ camera presets into account, but can be expanded to loop through camera pre-sets as well.
Create script
Create a new client scriptlet in the Command Script Editor.
Copy and paste in the code below.
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
List<DeviceInfo<Camera>> lc = (List<DeviceInfo<Camera>>)Api.CameraManager.GetCameraInfoList(); foreach (DeviceInfo<Camera> dc in lc) { // Parameters // Files are stored in C:\BVMS_Data // Existing files are not overwritten! Please clear folder before starting script. Camera c = (Camera)dc.Device; String strCameraName = Api.DeviceManager.GetName(c);
// Folder BVMS_Data needs to be manually created String strFileName = "C:\\BVMS_Data\\" + strCameraName + ".jpg";
// Execution ImagePane ip = new ImagePane(1,1); Api.ContentManager.DisplayCamera(ip,c); // Give system time to open camera System.Threading.Thread.Sleep(1500); // Store snapshot Api.ContentManager.SaveImagePane(ip,strFileName); } |
The result should be similar to the image below (the scriptlet ID and method name might be different).
Save and activate the configuration. Run the script from the Operator Client and observe it from looping through all camera automatically.
The script stores the snapshots in C:\BVMS_data as shown below. The script uses the camera names as filename.