Replay/retrieve of edge stored H.264 video fails

Hello,

we try to access edge store video from a DVR with MIPDriver framework. Our traces shown that one GOP after each other will be transfered but

a) not stored in RecordingServer

b) not displayed in Smartclient

What could be wrong? Where can I find Milestone traces for that usecase?

SmartClient changes whole time between “Connected to server…” and “Connection to server lost. Reconnecting” but Driver is stable connected with DVR.

Help would be apreciated - thanks a lot & best regards Sascha

Can you please check if there are any errors or warnings in the recording server logs? Also, it would be great if you could share a snippet of code to reproduce the issue if it is possible.

Thanks Rie Kito, in the meantime i saw some frames in SC and database. But the driver is used by multiple threads/tasks from recordingserver/SC. It seems that I can not lock these tasks for our asynchronous communication with DVR. Requests from SC goes out and answers came back to the wrong task.

I tried Semaphore, Monitor, lock() (not possible in async methods) and also NeoSmart.AsyncLock. Nothing works … Do you have any idea? Thanks - Sascha

Hi,

You mention that you are doing asynchronous retrieval from your DVR. It is vital when you retrieve information like this that you match it with the correct request, and therefore put it in the correct PlaybackReadResponse (during playback) or GetLiveFrame output (when streaming live). It’s worth noting that while playback is setup to handle entire GOPs being transferred at once, live streaming is not, and expects a single frame at a time. It is also important that you wrap your asynchronous communication with your device (the DVR, in this case) so that you can hold and wait in the synchronous calls from the driver framework. When several different tasks from the recorder are retrieving information from your driver at the same time, those requests will belong to separate sessions, and it is up to you in your driver to distinguish between them when communicating with the device.

You could do this by caching responses ahead of what you are being asked for in a given session, and then simply sending back the cached data (and caching further forward) upon request, for instance.

The only alternative I can see to caching is to have a static lock object that you wait for, and simply don’t allow multiple requests to go out to your device at the same time. That way when you get a response, you know there is only a single request in-flight that the response could be corresponding to.

Best Regards,

Simon

Hello Simon,

thanks for your reply. Streaming of playback now works for one camera. We have defined base.MaxParallelDevices = 1; in the driver but SmartClient try to play cameras in parallel, whats the problem now?

Thanks in advance - Sascha

Hi,

MaxParallelDevices simply controls how many instances of a driver will be hosted in each driver framework process. If you are communicating with your DVR from the same recorder over the same shared connection anyway, this will not solve your issue.

You will need to be able to handle these responses correctly in your driver, even when multiple cameras send requests simultaneously. This behaviour cannot be disabled.

Best Regards,

Simon