This project is read-only.

Tutorial 8: No video capturing devices

Mar 25, 2009 at 7:47 PM
Running Windows Vista, using a Creative Webcam Live! I am running into the following exception:

C:\"Tutorial8 - Optical Marker Tracking.exe"

Unhandled Exception: GoblinXNA.GoblinException: No video capturing devices are f
ound at GoblinXNA.Device.Capture.DirectShowCapture.InitVideoCapture(Int32 videoDev
iceID, Int32 audioDeviceID, FrameRate framerate, Resolution resolution, Boolean
grayscale) in C:\Users\ray\Desktop\brody\goblinxna\src\Device\Capture\DirectShow
Capture.cs:line 221 at Tutorial8___Optical_Marker_Tracking.Tutorial8.SetupMarkerTracking() in C:\
Users\ray\Desktop\brody\goblinxna\tutorials\Tutorial8 - Optical Marker Tracking\
Tutorial8.cs:line 116 at Tutorial8___Optical_Marker_Tracking.Tutorial8.Initialize() in C:\Users\ray
\Desktop\brody\goblinxna\tutorials\Tutorial8 - Optical Marker Tracking\Tutorial8
.cs:line 65
   at Microsoft.Xna.Framework.Game.Run()
   at Tutorial8___Optical_Marker_Tracking.Program.Main(String[] args) in C:\User
s\ray\Desktop\brody\goblinxna\tutorials\Tutorial8 - Optical Marker Tracking\Prog
ram.cs:line 14

With Steve Henderson's advice I have tried the following:

I have installed the camera drivers
I have seen the camera work through AmCap
I have turned off AmCap
I have checked TaskManager for processes that might be holding the camera
I have confirmed that both "Creative WebCam Live!" options show video in AmCap
I have tried to call captureDevice.InitVideoCapture at 0-50
I have done the above with sound at -1
I have done the above with resolution at 320x240
I have confirmed that the camera appears in GraphEdit/Insert Filters/Video Capture Sources
I have run the tests with the camera plugged into each and every USB port

Here is my modified code from Tutorial8.cs SetupMarkerTracking():

            for (int i = 0; i <= 10; i++)
            {
                try
                {
                    Console.Out.WriteLine("Trying " + i);
                    captureDevice.InitVideoCapture(i, 0, FrameRate._30Hz, Resolution._640x480, false);
                    //captureDevice.InitVideoCapture(i, -1, FrameRate._30Hz, Resolution._640x480, false);
                    //captureDevice.InitVideoCapture(i, 0, FrameRate._30Hz, Resolution._320x240, false);
                }
                catch
                {
                    Console.Out.WriteLine(i + " failed");
                }
                
                if (captureDevice.Initialized)
                    Console.Out.WriteLine(i + " DID NOT FAIL");
            }

Please help, thanks
Coordinator
Mar 25, 2009 at 8:01 PM
The exception "No video capturing devices are found" is thrown when the DirectShow library cannot find any cameras connected to your machine. If there are more than one camera, and the deviceID is incorrect, it will throw different exception "device ID out of range". Can you try to run the original DirectShow program that you downloaded separately from Goblin? If the test program for DirectShow doesn't recognize your camera, then it's either that the DirectShow.NET doesn't support your camera, or there is a bug with the DirectShow library. If the test program can recognize your camera, and it works fine, then it's a problem with Goblin. Please let me know the result.

Ohan
Mar 25, 2009 at 10:21 PM
Thank you Ohan,

In fact, CaptureTest.exe throws an exception on line 26 of CaptureTest.CaptureTest in the call

private Filters filters = new Filters();

which is exactly where it crashes for me otherwise.
Coordinator
Mar 26, 2009 at 6:27 PM
Thanks for the information, brody. In that case, the DirectShowNET library does not support your camera unfortunately. We know that most embedded cameras, Microsoft Lifecam series, and Logitec series work fine with the DirectShowNET library.

Ohan
Apr 4, 2009 at 7:58 PM
Ohan,

I finally found a camera that works! It does something odd with Tutorial 8 however. The window appears with two very wide and short windows showing video capture and the bottom 80% of the screen is black. Also, when the program initializes I get this in the command-window:

double artag_camera_fx,artag_camera_fy,artag_camera_cx,artag_camera_cy=638.05200
2,633.672974,320.000000,240.000000
reading coordframe file <ARTag.cf>

Brody
Coordinator
Apr 6, 2009 at 9:34 PM
Hi Brody,

It seems like the camera resolution you're using is not supported by DirectShowNET. What resolution are you using? Can you try the same
resolution with the CaptureTest program which came with the DirectShow download? If CaptureTest doesn't work, then the resolution won't work
on Goblin XNA either.


The message you see on the command-window is from ARTag library. It's just a debug message, not an error message.

Ohan