1

I'm trying to get image from a usb device using Aforge (directShow). The device (USB3HDCAP) has 3 diferent inputs (HDMI, DVI and S-Video). Using the code above, i can access and get the default input image (only from HDMI). However, when I change the physical input on the device (from HDMI to DIV, example) the image is black. What can i do to get video from other input (DVI or S-Video).

    LocalWebCamsCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice); 
    LocalWebCam = new VideoCaptureDevice(LocalWebCamsCollection[0].MonikerString);
    LocalWebCam.NewFrame += new NewFrameEventHandler(Cam_NewFrame);
    LocalWebCam.Start();
Roman R.
  • 68,205
  • 6
  • 94
  • 158
Eduardo Preto
  • 21
  • 1
  • 1
  • 8

1 Answers1

1

Your code snippet is what just captures video. To switch inputs on video capture hardware you need to use crossbar to re-configure the device.

In plain DirectShow it is like his:

With AForge.NET you should be looking up for a similar method, e.g. see:

... VideoCaptureDivece.AvailableCrossbarVideoInputs gives array of available video inputs. VideoCaptureDivece.CrossbarVideoInput accepts what? - yes video input. So combine those two together:

VideoKaynagi.CrossbarVideoInput  = CrossbarVideoInput.AvailableCrossbarVideoInputs[0];

Of course you need to change 0 with an index of the S-Video input.

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • I will try the first one (DirectShow) because the second one, i already tried and i won't get any result from - AvailableCrossbarVideoInputs - array was empty. – Eduardo Preto Oct 26 '17 at 20:06