The event ImageDisplayedEvent has a issue?

Hi,

We have an event (ImageDisplayedEvent), which we continually validate to be sure we have real time image all the time. Base on that check if a loss of image is detected we load a local video as contingency waiting for the real time image to be available again.

We believe, we are experiencing images loss as a consequence of the event missfunction. We would like to know if you are aware of any bug that event could have or if you know any other users experiencing the same issue.

If that’s the case is there any workaround or hot fix available?

As a comment in case this could guide you in the right direction, sometimes we experience that loss of image for a brief period of time but the image is recovered automatically without taking any action but some other times this period tends to be longer and if you do not restart the application the problem is not solve. This seems to be a random error but we could find yet the origin of the error.

Could you please help us,

if you need more information please let me know.

Thanks

Regards,

_imageViewerControl1.ImageDisplayedEvent += (x, y) =>

           {

               if (!y.WindowSize.IsEmpty)

               {

                   Online();

                   lastCall = DateTime.Now;

               }

               else

{

                  Offline();

               }

           };

No, this does not sound to me like a known issue.

Do you see this in live mode or playback?

When you experience this does the regular Smart Client view show any form of error message on the same camera?

What product and version is your XProtect test server? What version is the MIP SDK?

Is this a Smart Client plugin or standalone application?

Do you see this on all cameras or only one camera (or camera model)?

Please share observations you have made in general while troubleshooting this.

Live mode.

We dont use the Smart Client. In our app we don´t get to see any Milestone message because as soon as we detect image loss we switch to a local video while constantly checking the event to return to live image. This error cannot be easily reproduced as it occurs randomly.

Many times the image returns after a short period of time and the application shows the live video without problems, but sometimes the image does not return and it takes a long time without returning until we restart the application and that’s when the live image returns.

It seems like the event is no longer detecting when the image returns.

I do not think there is much anybody can do given the information at hand. If you are able to find a pattern, that it happens when something else happens, we might have a chance. It would be ideal if you could find a way to reproduce this issue, instructions that when you have this setup and does this action it triggers the issue.

Could you help me to reproduce the error?

Can I capture the sdk messages overlap on the image? how?

Can I do something else within the event ?

Hi @Rie Kiuchi (Milestone Systems)​ and @Bo Ellegård Andersen (Milestone Systems)​ I am Ivan’s coworker and I am colaborating in the same project.

As Ivan has mentioned, it’s a difficult case to reproduce because it’s happening ramdomly. Considering we are suffering in our Production enviroment, for several months, the same issue without being able to identify issue’s root cause, we decided to share this with you to hear other opinions/ideas so we finally put a close to this.

Some time ago we added severals logs in the piece of code that Ivan have shared in the first message. From there, we can see that, on some ocassions, when we swtich to contingency video (offline method above) then it never comes back, meaning if (!y.WindowSize.IsEmpty) event never is true again. When this happening, the only thing that works is to restart the entire application.

Havind said that, we really need your help troubleshooting this. I know that having a way to reproduce will be the best case, but we don’t have it right now so we need a little bit of guidence.

  • Do you have any suggestion?
  • Is there a way to capture the message milestone is returning (similar to the message in grey box in SMART Client) when streaming is lost? Maybe that can help to reduce possible cases.
  • Is there any other information we can consume from that event in order to understand if it’s working well or not?

Thanks in advance for that.

Regards.

We asked around and noone has experienced something like this before (the underlying component is also used by the Smart Client).

It could maybe be somehow related to the image data being corrupt in some way so if the customer is recording the video it could be interesting to know if it plays back correctly in the playback view of the Smart Client for the time the problem occurs? And if not an export of the video in XProtect format could help us investigate it. But if they don’t record that is of course not really an option.

Just to be sure we understand it correctly: You keep getting the ImageDisplayedEvent, but the contents just keep being 0 after this has occurred, correct?

And you are not doing any extensive work in the OffLine() method? E.g. the launching of the other video clip should be done in a separate thread. If the work here takes too long it might cause the image viewer to miss something and then not being able to get back in the right state.

Final suggestion which is more a work-around than an actual solution: Would it be possible for you to, based on a timer or similar, to actually disconnect and reconnect or entirely renew the image viewer, if the offline mode has been going on for too long?

Hi again.

I am going back to this issue again because we are experiencing a similar issue but with some changes.

In our enviroment, we have two management servers, each one with some Recording Servers. We have the same camera added to both management Servers, in this way.

  1. Management Server 1 - Recording Server 1 - Camera.
  2. Management Server 2 - Recording Server 1 - Camera.

The thing is, we are experiencing issues with the method Ivan has mentioned in the original thread but now we are only doing the online part, as follows:

                imageViewerControl.ImageDisplayedEvent += (x, y) =>
                {
                    if (!y.WindowSize.IsEmpty)
                    {
                        Online();
                        lastCall = DateTime.Now;
                        lastImage = DateTime.Now;
                    }
                };

Thin is, when camera goes down and image is lost and then streming is recover, image is being showed again only in Management 2 and it’s not in Management 1. Both Management Servers are XProtect Corporate 2018R3.

Doing troubleshooting we figure out that for those cases where live view is not comming back, it never enters to ImageDisplayedEvent. As far as I understood, this event is triggered any time live streaming is available.

In this case, it never goes to this event.

Checking at Streaming Form, we see a meesage that says: “Connection to camera failed”.

If I restart the application, live view is showed right. In fact, I have some other apps streaming the same camera without problem - same goes for SMART Client.

The most curious part is, it’s only ocurring with Management 1 Recording Server. If I switch my camera to Managament 2, once live view is back, I have the image again without any issue.

Any idea what should I check?

Configuration in both management servers is the same, either at Recording Server as well as camera level.

Thanks in advance for your help.

Regards.

Milestone Development will start an investigation.

Let me add more info. During the last days we were doing A LOT of troubleshooting trying to identify what’s happening.

We were able to reproduce the following in our test enviroment.

  1. We open our App until the ImageViewerControl shows live video.
  2. We disable the hardware from Milestone Management Client. Dueto that, live stream goes offline.
  3. We wait several minutes (let’s say more than five minutes).
  4. We enable de hardware again.
  5. Live view image never comes back again.

Doing troubleshoting we have idenified that when a camera is offline for several minutes, neither ImageDisplayedEvent nor LiveStreamInformationEvent is triggered again once camera is online again.

Not sure why, but the we are not seeing that those events are triggered.

How we are “solving” this right now: we have a process that if camera is offline for more than 5 min, we login to milestone server again, delete the old form and create a new one. This way, because it’s a new form, those events works fine again.

Did you know about someone experiencing the same issue?

As you could guess, our workaround is not the best one because live view is not going back instanstanously, we need to wait until the 5 min cicle is triggered.

Hope this message helps to clarify what we are experiencing.

Don’t hesitate to ask for more information.

Regards.

Regarding your repro the reported behavior is as expected. Disabling the hardware (or even just the camera device) from the Management Client will to the client (your application) look like the device has been removed and thus reconnect mechanisms will be shut down.

We have been running tests with the Video Viewer sample which we modified to also listen for the ImageDisplayedEvent and the LiveStreamInformationEvent. We then used DemoDriver sample as the camera to have a simple way of simulating camera disconnects (the accompanying service contains start and stop service buttons, which will from the VMS side correspond directly to a camera disconnect).

In this setup even with longer disconnects the live stream came back in the Video Viewer sample within a few seconds and both event handlers were also called.

Could you please try:

  • using the DemoDriver as the camera and use Start/Stop service as the disconnect mechanism and see if you can still reproduce the missing events in your application?
  • using Video Viewer sample in the current setup and see whether it reconnects after a camera has been disconnected?