How to detect whe "the server hast lost connection to the camera"?

We have already implemented a solution with MIP SDK that identify when a camera is not being streamed and switch into a pre-recording video.

In order to identify that, we are using the following MIP Event:

_imageViewerControl1.ImageDisplayedEvent += (x, y) =>
 
{
 
   if (y.WindowSize.Height != 0 && y.WindowSize.Width != 0)
 
            Online();
 
          else if (y.WindowSize.Height == 0 && y.WindowSize.Width == 0)
 
            Offline();
 
};

We did some testing, and it seems to be working fine when (for example) network connection is lost at our app side. As soon as connection is lost, Height and Widhth goes to 0, so Offline applies.

On the other hand, if I unplug the network cable from camera, the live stream shows “the server hast lost connection to the camera” and directly, _imageViewerControl1.ImageDisplayed Event is never triggered.

Having said that, I would like to ask you: What would be the best way to detect this type of streaming lost using MIP SDK?

Thanks in advance.

We did more testing and the following behavior about ImageDisplayedEvent was identified.

  • If network connection is lost at our App side, ImageDisplayedEvent is triggered and Height and Width = 0. Conclusion, we are capturing that there is any image to show and switch to recorded video.
  • If network cable is unpluged from the camera, ImageDisplayedEvent is never triggered. Conclusion, we are not capturing lost of connectivity.

Questions:

  • Why is that event not being triggered when the streaming is not available from Recording Server?
  • Is there any other way to identify the described situation?

Thanks.

Please see these links:

VideoOS.Platform.Client.ImageViewerControl.LiveStreamInformationEvent

https://doc.developer.milestonesys.com/html/miphelp/class_video_o_s_1_1_platform_1_1_client_1_1_image_viewer_control.html#a1a46e60680c2d5d8cb4ea5bd268a8991

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_client_1_1_image_viewer_control.html&tree=tree_search.html?search=livestreaminformationhandler

When you unplug a cable from your camera the data in the ImageViewerControl.LiveStreamInformationEvent will tell you.

NOTE: If you are using ImageViewerWpfControl, please see LiveStreamInformationReceived -

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_client_1_1_image_viewer_wpf_control.html&tree=tree_search.html?search=livestreaminformationreceived

Hi Rie, thanks for your feedback. So, does that mean anytime I receive this event and need to go and read an xml file? Or how that xml information is being exposed?

You get the xml with the eventargs..

See - https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_client_1_1_live_stream_information_event_args.html&tree=tree_search.html?search=livestreaminformationeventargs