Error getting playback frames

Hi, I´m having trouble with a software development in which we are working. I´m getting the following error:

Error reading from stream! : Operation was cancelled while waiting for move operation response, or connection was closed by peer!

The code is the following:

private void ShowRotacion()

{

ShowImagen = false;

if (VideoOS.Platform.SDK.Environment.IsLoggedIn(new Uri(“http://” + ConfigurationManager.AppSettings.Get(“UrlMilestoneServer”))))

{

GetCamerasData();

var item = allCameras.FirstOrDefault(x => x.FQID.ObjectId == Guid.Parse(“EF99B2F2-BA76-4409-8585-EE1E21C25025”));

VideoOS.Platform.Data.JPEGVideoSource videoSource = new VideoOS.Platform.Data.JPEGVideoSource(item);

videoSource.Init();

JPEGData data = (JPEGData)videoSource.Get(DateTime.Now.AddDays(-1));

MemoryStream strmImg = new MemoryStream(data.Bytes);

Imagen = new BitmapImage();

Imagen.BeginInit();

Imagen.StreamSource = strmImg;

Imagen.DecodePixelWidth = 200;

Imagen.EndInit();

ShowImagen = true;

}

}

The line that is producing the error is JPEGData data = (JPEGData)videoSource.Get(DateTime.Now.AddDays(-1));

The complete stack is:

ERROR Uncaught Thread Exception EXCEPTION OCCURRED:VideoOS.Platform.MIPException: Error reading from stream! : Operation was cancelled while waiting for move operation response, or connection was closed by peer! —> VideoOS.Toolkit.StreamException: Error reading from stream!

at VideoOS.Toolkit.LivePlaybackSourceToolkit.MoveTo(DateTime timeStamp, SearchCriteria searchCriteria)

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.DataGet[TReturnType](Object sessionId, FQID deviceFqid, DateTime time, Func`2 getAndHandleToolkitDataFunc, SearchCriteria searchCriteria)

-– End of inner exception stack trace —

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.HandleToolkitExceptions(String method, Exception ex)

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.DataGet[TReturnType](Object sessionId, FQID deviceFqid, DateTime time, Func`2 getAndHandleToolkitDataFunc, SearchCriteria searchCriteria)

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.ImageExporterJPEGGetAt(Object sessionId, FQID deviceFQID, DateTime time)

at VideoOS.Platform.Data.GenericVideoSource`1.FireCommandInternal(Func`1 command)

at VideoOS.Platform.Data.GenericVideoSource`1.FireCommandInternal(Func`4 command, DateTime dateTime)

at VideoOS.Platform.Data.GenericVideoSource`1.Get(DateTime dateTime, TimeSpan maxTimeAfter, Int32 maxCountAfter)

at VideoOS.Platform.Data.GenericVideoSource`1.Get(DateTime dateTime)

at VideoOS.Platform.Data.JPEGVideoSource.Get(DateTime dateTime)

at XeoCode.ViewModels.Modal.ListadoRotacionesViewModel.ShowRotacion() in [D:\SVN\xeocode](file:D:/SVN/xeocode) limpio\XeoCode\ViewModels\Modal\ListadoRotacionesViewModel.cs:line 216

at XeoCode.ViewModels.Modal.ListadoRotacionesViewModel.ConsultarRotaciones() in [D:\SVN\xeocode](file:D:/SVN/xeocode) limpio\XeoCode\ViewModels\Modal\ListadoRotacionesViewModel.cs:line 178

at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)

at System.Windows.Controls.Primitives.ButtonBase.OnClick()

at System.Windows.Controls.Button.OnClick()

at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)

at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)

at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)

at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

at System.Windows.Input.InputManager.ProcessStagingArea()

at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)

at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)

at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)

at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) XeoCode.App.App_DispatcherUnhandledException([D:\SVN\xeocode](file:D:/SVN/xeocode) limpio\XeoCode\App.xaml.cs:421)

The error you are seeing are most typically happening due to network issues or in rare cases due to compatibility or authentication issues with the server.

Does this happen consistently (every time you try) or just once in a while? Does Smart Client playback work as it should or do you also see problems there occasionally?

Also, could you please check the XProtect Recording Server logs to see if something about what is going wrong is written there and if not maybe check Windows Event Viewer for potential network issues.

Finally, if none of the above helps and you can reproduce this consistently could you then please provide a small sample (potentially based on one of the SDK samples) that reproduces this?

Thanks for your reply, finally the problem was related to permissions on the user. We checked that and it was fixed right away!

Thanks for all the help.