Which statistics are required? The diagnostic overlay in Smart Client is part of the decoder and there is no API for grabbing that information to my knowledge. But if you want FPS, codec, and image size, I think the RecorderStatusService2 client would be enough to get those.
Thanks for your reply Joshua. At a minimum we need to extract FPS info for a specific stream for a given period of time.But path as defined in the documenation does not work for me. “http://X.X.X.X:7563/recorderstatusservice/recorderstatusservice2.asmx”. I am using 2019R1
When you type this URI in a browser then it works.
http://localhost:7563/recorderstatusservice/recorderstatusservice2.asmx?wsdl
On the other hand, this one doesn’t work when you type it in the browser.
http://localhost:7563/recorderstatusservice/recorderstatusservice2.asmx
Following code might be helpful;
When navigating to the service address for RecorderStatusService2, you can get a working wcf client proxy with.
public RecorderStatusService2 GetRecorderStatusService2(string host, int port)
{
var uri = new Uri($"http://{host}:{port}/RecorderStatusService/RecorderStatusService2.asmx");
return new RecorderStatusService2(uri);
}
This one will also be helpful for you. (This one uses the MIP library “proxy” class.)
static private void ShowCameraFPF()
{
VideoOS.Platform.Login.LoginSettings loginSettings = VideoOS.Platform.Login.LoginSettingsCache.GetLoginSettings(EnvironmentManager.Instance.CurrentSite);
Guid cameraGuid = new Guid(CAMERAGUIDSTRING);
Item cameraItem = VideoOS.Platform.Configuration.Instance.GetItem(cameraGuid, Kind.Camera);
VideoOS.Platform.SDK.Proxy.Status2.RecorderStatusService2 client = new VideoOS.Platform.SDK.Proxy.Status2.RecorderStatusService2(cameraItem.FQID.ServerId.Uri);
VideoOS.Platform.SDK.Proxy.Status2.DeviceStatisticsBase[] deviceStatisticsBases = client.GetVideoDeviceStatistics(loginSettings.Token, new Guid[] { cameraGuid });
VideoOS.Platform.SDK.Proxy.Status2.DeviceStatisticsBase deviceStatisticsBase = deviceStatisticsBases.FirstOrDefault();
VideoOS.Platform.SDK.Proxy.Status2.VideoStreamStatistics[] videoStreamStatistics = (deviceStatisticsBase as VideoOS.Platform.SDK.Proxy.Status2.VideoDeviceStatistics).VideoStreamStatisticsArray;
string fpsStateString = videoStreamStatistics.FirstOrDefault().FPS.ToString();
Console.WriteLine("Camera FPS: " + fpsStateString);
}