0

I'm a complete beginner in C#, but I'm trying to write a very simple application in C# (VS2013) to simply view video stream or capture frames from a Sony FCB-EV7500 camera. The camera connects to a small USB3 board using CN401, and the board connects to the laptop via USB3. I can view video in VLC for example, but i'd like to write code in a C# application to get video/grab frames.

Google searching this brought me to DirectShow which apparently is only a C++ library. There used to be a DirectShow.NET wrapper available here: http://directshownet.sourceforge.net/about.html but it seems they haven't updated the project since 2010 and a lot of functions/interfaces at that time remained untested.

Are there any commonly used libraries for accomplishing this in C#? Perhaps something included in the .NET framework? Thanks for any advice or direction.

Asif
  • 748
  • 3
  • 9
  • 32

1 Answers1

0

You really don't want to be marshaling full frame rate video into a C# application.
You should probably take a look at the .net bindings for gstreamer, I have personally only used the C and python bindings so YMMV. If that doesn't work you will need to:

  1. Use direct show, gstreamer, or ffmpeg to deal with media.
  2. Write a native wrapper around your media handling code.
  3. Write C# code to interop with your wrapper.

depending on if you are using winforms or wpf you will either use a NativeWindow or D3DImageSource as your render target.

Yaur
  • 7,333
  • 1
  • 25
  • 36
  • If I have a .dll for DirectShow (implemented in C++), would I be able to just add that .dll to my resources in a C# project in visual studio? – Asif Jul 15 '15 at 21:01
  • Direct Show filters are not normal DLLs. They are COM objects designed to work with a bunch of other COM objects that are part of the DS framework, so you might be able to add it to your project but it won't do what you expect. – Yaur Jul 16 '15 at 14:48