foreach (var stream in streamFolder.Streams)
{
foreach (var streamChild in stream.StreamUsageChildItems)
{
if (streamChild.LiveDefault == true)
{
String strStreamSel = [streamChild.Name](https://streamChild.Name);
We used to get strStreamSel as “Video Stream 1” in R2 but now we are getting as “Video Stream 01”.
Whereas devStreamChild.DisplayName returns as “Video Stream 1” which is a conflict.
Also the keys were direct names like “Codec”, “Resolution” etc but now the keys are like stream:0.0.0/FPS/6527c12a-06f1-4f58-a2fe-6640c61707e0 - 8.0
Please suggest a solution to handle this.
We are investigating this, but due to the holidays it will take some more time than usual.
Best regards,
Peter
The ‘Name’ contains the edited name by the administrator, I suggest you use the StreamReferenceId, and lookup where it matches the id in the StreamReferenceIdValues - and pick the name from there.
As for the FPS key, I do not see same issue - what version of the VideoOS.Platform.dll are you using in your solution? (From what MIPSDK install?)
Product Version - 12.3.10214.1
MIPS SDK 2018 R3 on XProtect Corporate 2018 R3
Adding more code for your reference.
VideoOS.Platform.ConfigurationItems.Camera tmpCam = new VideoOS.Platform.ConfigurationItems.Camera(fqid);
VideoOS.Platform.ConfigurationItems.StreamFolder streamFolder = tmpCam.StreamFolder;
foreach (var stream in streamFolder.Streams)
{
foreach (var streamChild in stream.StreamUsageChildItems)
{
if (streamChild.LiveDefault == true)
{
String strStreamSel = streamChild.Name;
VideoOS.Platform.ConfigurationItems.DeviceDriverSettingsFolder ddsf = tmpCam.DeviceDriverSettingsFolder;
foreach (var childSetting in ddsf.DeviceDriverSettings)
{
foreach (var devStreamChild in childSetting.StreamChildItems)
{
if (devStreamChild.DisplayName.ToString() == strStreamSel)
{
for (int ig = 0; ig < devStreamChild.Properties.Keys.Count; ig++)
{
if (devStreamChild.Properties.Keys[ig].ToLower().Contains("codec"))
{
strCodec = devStreamChild.Properties.GetValue(devStreamChild.Properties.Keys[ig]);
}
if (devStreamChild.Properties.Keys[ig].ToLower().Contains("fps"))
{
iFPS = Convert.ToInt32(devStreamChild.Properties.GetValue(devStreamChild.Properties.Keys[ig]).Split('.')[0]);
}
if (devStreamChild.Properties.Keys[ig].ToLower().Contains("resolution"))
{
strResolution = devStreamChild.Properties.GetValue(devStreamChild.Properties.Keys[ig]);
}
}
}
}
}
}
}
}
You need to use the ReferenceId, to get from the selected live stream to the defined stream. Insert these lines instead of just picking the strStreamSel:
if (streamChild.LiveDefault == true)
{
String strStreamSel = "";
foreach (var st in streamChild.StreamReferenceIdValues)
{
if (st.Value == streamChild.StreamReferenceId)
{
strStreamSel = st.Key;
break;
}
}
Also, be aware that the FPS match you perform will NOT always work, as some camera definitions has keys like: stream:0.0.0/ZFpsMode/…guid… and the value is ‘fixed’ for this property