When you add cameras to XProtect VMS this is usually done in the Management Client or Management Application.
For XProtect Enterprise, Professional and Express this is the only way.
For XProtect Corporate and Expert an configuration API was introduced with version 2014 and greatly enhanced with version 2016R2. Using the Configuration API it is possible to add cameras. To see this in use explore the ConfigAPIClient sample.
Thank you!
But I would like to do it without any user interaction whatsoever. Is that possible?
I wish I had asked what model the XProtect server is, there is two scenarios..
XProtect Enterprise, Professional and Express has the automatic camera discovery functionality, check it out, it might be what you need.
If you develop an appplication (for XProtect Corporate and Expert) based on the Configuration API you can decide how much UI you need.
Well am using the XProtect Corportate server. The case I have is that I have an RTSP stream that I would like to inject into the recording server using code and the universal driver. I do not want the user of the application to have to do anything.
I was able to finally add a stream via code. My issue is now in retrieving the newly added stream as a configuration item to edit its port and streaming codec.
Try to do the same operation using the Config API Client and then afterwards analyse how to do it in “code”.
I think the Client API Batch sample is a better fit, so let me change my advise to that one.
I have the same issue. How could I retrieve information about codec and port information about an existing or newly added stream (with universal 16 channels driver) ?
I had done a sample code that is running under 2017 R1 but now it does not run un 2017 R3.
I would like to access to ‘Codec’ and ‘RTSP Port’ property from Video stream 1.
What are the done updates into SDK ?
Thx
@Stephane Erhardt
If you have a piece of code that works on 2017R1 and does not work on 2017R3 we have to suspect that Milestone has broken the backwards compatibility. We really would like to understand. I will open a case on your behalf on Milestone Technical Support and will be requesting you to show us your code so that we can analyse the situation.
Thanks for your reply.
I found a sample that you have done which inspires me: “New sample: Add cameras (Configuration API)”
I try to understand with the new framework how I could modify the stream from “H264 – Streamed” to “JPEG – Streamed”.
Here is, below, my piece of code to try to do that for the first stream of the first camera.
I arrive to read information but I don’t understand how to commit/save my modifications.
ManagementServer managementServer = new ManagementServer(EnvironmentManager.Instance.MasterSite);
CameraGroupFolder folder = managementServer.CameraGroupFolder;
foreach (CameraGroup group in folder.CameraGroups.OrderBy(d => d.DisplayName))
{
Console.WriteLine($"Camera group: {group.DisplayName}");
foreach (Camera camera in group.CameraFolder.Cameras.OrderBy(d => d.DisplayName))
{
Console.WriteLine($"- Camera: {camera.DisplayName}");
foreach (StreamDefinition stream in camera.StreamFolder.Streams.OrderBy(d => d.DisplayName))
{
Console.WriteLine($" - Stream: {stream.DisplayName}");
foreach (StreamChildItem item in stream.StreamChildItems.OrderBy(d => d.DisplayName))
{
Console.WriteLine($" - Item [{item.Name}]: {item.DisplayName}");
//camera.Enabled = true;
//camera.Save();
//return true;
foreach (string propKey in item.Properties.Keys.OrderBy(d => d))
{
string propValue = item.GetProperty(propKey);
Console.WriteLine($" - {propKey} (before) = {propValue}");
// Name = JPEG - streamed
if (propKey == "Name")
{
item.SetProperty(propKey, "JPEG - streamed");
stream.Save();
//camera.Enabled = true;
//camera.Save();
propValue = item.GetProperty(propKey);
Console.WriteLine($" - {propKey} (after) = {propValue}");
return true;
}
}
}
}
}
}
return false;
Thanks a lot.
Stéphane Erhardt
Alpes Ingénierie Informatique