1
votes

I am using DirectShow.Net v2.1 to preview the webcam's image.

It works ok, but on some newer webcams like Logitech C920, which is full HD 1080p, it shows black screen instead of webcam's image.

My project is in C# WinForms and compiled with .Net v2.0 I want to run my project on Windows XP / 7 / 8 / 8.1

Can anyone help me how to fix it?

2
When you work with DirectShow, you need to tell effective filter graph topology in use. Without this, without error codes, the troubleshooting is shooting in the dark.Roman R.
@RomanR. I am not that much expert in hardware... where can I find a good sample about your comment?Matin Lotfaliee
See this from "This will add our graph to the running object table", and then this: Loading a Graph From an External Process.Roman R.
@RomanR. Well, It looks pretty complicated for me. I should change the code? or the OS of the users? or should I build extra files that are needed to be attached to my code? Why the DirectShow by itself did not used effective filter graph topology that I have to do it?Matin Lotfaliee

2 Answers

0
votes

Replacing DirectShow.Net with WIA using this sample is the solution.

WIA meets the requirements better because:

  1. Not focusing on Windows Vista, which does not seem to capture webcam in its WIA.
  2. Preview does not need to modify, take a picture, take a video of it.
  3. It looks much more easier to use.
  4. The project will be very lighter.
  5. Works with all cameras.
  6. Gives you built-in camera selection by OS.
0
votes

The issue with Logitech C920 could be solved easily. Just by force another resolution. Think that 19 resolution could be possible for this camera so just put this line before :

VideoSource.Start

YourSourceVideoName.VideoResolution = YourSourceVideoName.VideoCapabilities(X)

X is an integer reagrding to an array: 0 the less resolution and 18 the higher one. Try with 0, you will see that the camera start with image. Then try higher and higher until no image.