2

I am have used Aforge, emgu and Direct.Net to display image stream from a connected USB camera.

What I am having issues with is that if the usb has been unplugged (etc) and then reconnected the stream does not resume.

So, I assume I will have to detect a usb camera detection and then in code restart the stream.

I have been looking for some time now and cannot find a sample in C# to do this.

If anyone has a recommended link then I will be very grateful.

thanks

Andrew Simpson
  • 6,883
  • 11
  • 79
  • 179
  • @closer why off topic? This requires a C# code answer? – Andrew Simpson Apr 13 '15 at 17:47
  • 1
    There is no specific disconnection event. I suppose you will end up polling for camera to see that it is available again and restart the entire streaming from there. If this is USB, note that it might be plugged into another connector and technically this might be a different device. Handling [`WM_DEVICECHANGE`](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363480%28v=vs.85%29.aspx) might be of some help. – Roman R. Apr 13 '15 at 17:59
  • Hi, thanks for your comment. I did look at that too. And yes, the program could fail if the device is a different device. I was hoping for some more robust solution hence my question. But thanks :) – Andrew Simpson Apr 13 '15 at 18:03
  • Questioned asked some time ago now - did you eventually find a solution? – MOnsDaR May 23 '18 at 07:14
  • @MOnsDaR I think what I had to do was do a Polling to determine if still connected. Things have moved on now and i think there could be a better solution, good luck – Andrew Simpson May 23 '18 at 07:16

0 Answers0