This looks for a "Still" pin on your capture device. However, not all capture devices have a pin of category "still" (apparently including yours). This code never checks to see if this call succeeded, so the program continues on its merry way until it tries to use m_pinStill, at which point it crashes.
How to fix it depends on what capabilities your device has. What pins do you have on your capture device? Perhaps just changing this to PinCategory.Preview will work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for the delay. SF is supposed to notify me when someone posts a message. Anyway.
A video capture device exposes 1 or more "pins". These pins are generally one of several categories: Still, Preview, Capture, a few others (see PinCategory in uuids.cs for a more complete list).
You can think of pins sort of like the connectors on the back of a VCR. On a VCR you have video in, video out, audio in, audio out, etc. And just as you can connect things into and out of your vcr, you can connect things to the pins on your capture device.
A webcam will normally have a "capture" pin. You can connect this output pin to the input pin of a file writer, and save a movie to disk. Get it?
A "still" pin is another type of pin that some video devices expose. Some devices will be able to capture streaming video at one frame size (maybe 640x480), but can also take still images at a larger frame size (maybe 1024x768). Some do this on a "stilll" pin, some do it on a "preview" pin, and some don't do it at all.
Usually you will find that the docs that accompany your hardware will give you absolutely no information on any of this.
If you want to find out what capabilities your hardware has, you might check out DumpVCap at www.LimeGreenSocks.com/DShow. Take the output and read open it with a spreadsheet (ie Excel).
However, since you have tried both capture and preview, you'll probably need something a little different. Let me thing about this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear sir,
I have this error running the DxSnap project.
Error message:
Additional information: Object reference not set to an instance of an object.
The error occured at this line:
hr = videoStreamConfig.GetFormat(out media);
I would apreciate it if there's anyone who can help, I'm very new to DirectShow, am a Vb .net programmer myself. Thanks
Regards,
Andrew
from SetConfigParms procedure.
Hi there,
Thanks for the reply,
What's this still pin for? Anyway, I'm using a usb webcam.
I have also changed the code to PinCategory.Preview and the same error still occurs.
Any ideas or workaround for taking snap shots?
Thanks
Andrew
I remember downloading a fix for this error a week ago, it was a new capture.cs.
I am trying to find that file again, but I believe the link to it was in the Help Forum, which is now closed.
Could you post that link in this forum. Thanks!!
I assume you mean this:
http://cvs.sourceforge.net/viewcvs.py/checkout/directshownet/directshowlib/Samples/Capture/DxSnap/Capture.cs?rev=1.3
Yes, thanks.
Oops!
Your problem is probably coming in SetupGraph. There is a line:
m_pinStill = DsFindPin.ByCategory(capFilter, PinCategory.Still, 0);
This looks for a "Still" pin on your capture device. However, not all capture devices have a pin of category "still" (apparently including yours). This code never checks to see if this call succeeded, so the program continues on its merry way until it tries to use m_pinStill, at which point it crashes.
How to fix it depends on what capabilities your device has. What pins do you have on your capture device? Perhaps just changing this to PinCategory.Preview will work.
Sorry for the delay. SF is supposed to notify me when someone posts a message. Anyway.
A video capture device exposes 1 or more "pins". These pins are generally one of several categories: Still, Preview, Capture, a few others (see PinCategory in uuids.cs for a more complete list).
You can think of pins sort of like the connectors on the back of a VCR. On a VCR you have video in, video out, audio in, audio out, etc. And just as you can connect things into and out of your vcr, you can connect things to the pins on your capture device.
A webcam will normally have a "capture" pin. You can connect this output pin to the input pin of a file writer, and save a movie to disk. Get it?
A "still" pin is another type of pin that some video devices expose. Some devices will be able to capture streaming video at one frame size (maybe 640x480), but can also take still images at a larger frame size (maybe 1024x768). Some do this on a "stilll" pin, some do it on a "preview" pin, and some don't do it at all.
Usually you will find that the docs that accompany your hardware will give you absolutely no information on any of this.
If you want to find out what capabilities your hardware has, you might check out DumpVCap at www.LimeGreenSocks.com/DShow. Take the output and read open it with a spreadsheet (ie Excel).
However, since you have tried both capture and preview, you'll probably need something a little different. Let me thing about this.
Hi, I'm new to DirectShow.NET.
I encountred the same problem.
The link you provided:
http://cvs.sourceforge.net/viewcvs.py/checkout/directshownet/directshowlib/Samples/Capture/DxSnap/Capture.cs?rev
=1.3
seems don't exist any more.
Can I find the file somewhere else?
Thank you.
Scroll up to the top of this page. Click on "code."