Share

DirectShow .NET

Subscribe

Doing something simple, taking a snapshot

  1. 2009-11-05 15:55:25 UTC

    Okay this has proven to be more difficult than I had imagined...

    What I am trying to do: Take a photo (nothing too fancy - just a still) using a webcam.

    Hardware: I currently have a wireless camera that outputs in composite format. So I have a tv card to convert it to something more workable.

    Aim: I am trying to take a photo wihout streaming a video if possible. I only need a still once or twice every five minutes. A video feed has a lower resolution than a still and uses more system resources.

    I intend to use this setup for computer vision so I really want to spare system resources as much as I can.

    What would be the best and efficient way to do this?

  2. 2009-11-09 20:17:32 UTC

    DirectShow is not the best technology to do that. Try WIA...

    http://www.codeproject.com/KB/dotnet/wiascriptingdotnet.aspx

    http://blogs.msdn.com/coding4fun/archive/2006/10/31/912546.aspx

  3. 2009-11-13 14:30:24 UTC

    Unfortunately my TV card isn't WIA compatible. I doubt any such TV card exists with a reasonable price. I do not know if there is such a method without the use of DirectShow. Though I am open to suggestions, I do not believe such a method exists.

    In any case I want my code to work for most cameras that aren't necesarily WIA compatible. Seems like most cameras aren't that WIA friendly. Particularly older ones.

    This is why DirectShow felt like a good idea..

  4. 2009-11-16 05:22:06 UTC

    Then I guess you should look at using the Sample Grabber. Be aware that this can be a challenge if your card output MPEG2.

  5. 2009-11-16 19:36:27 UTC

    Would you mind specifying which sample is that?

    Is it one of the "Capture" samples?

  6. 2009-11-16 21:51:10 UTC

    The SampleGrabber is a DirectShow filter. It is used by several of the samples.

    Probably the closest to what you need is DxSnap. However, some people have had problems getting it to work with their specific HW. It might require some fiddling.

  7. 2009-11-17 12:24:12 UTC

    It seems to seek DirectShow 2005 lib. I think what it wants is DirectShowLib-2005.dll and 10 other files (which in turn may ask for more).

    It seems like the fragments of code I need is scattered into several .cs files. I think I did fiddle with DirectShow before and the end product was quite problematic. So I am a bit hesitant to directly jump into the action...

    I'd like to ask where I need to put the files. I'd prefer not to put them under system32 or some other system directory as I want to keep the code mobile. I am not used to using other peoples code, so I apologize if the question is too dumb.

  8. 2009-11-28 14:15:10 UTC

    May I kindly ask you to direct me at the right direction?

    I have never used a dll in any of the code I developed to date. I avoided other peoples code and wrote my own. So I am really new to all this.

  9. 2009-11-29 01:09:07 UTC

    What language are you coding in? C#? Or c++?

    If you are using c++, you are in the wrong place. You should instead plan on using DirectShow directly (as documented here: http://msdn.microsoft.com/en-us/library/dd375454%28VS.85%29.aspx).

    If you are using c#, I have no idea why you would have something looking for DirectShow2005.lib or any other files. All you should need is the dll.

  10. 2009-11-29 05:31:44 UTC

    I am using c#.

    MSDN gets complicated pretty fast unless you know exactly what you are looking for... So an example would be a better start if possible. And I am not using c++, I'd prefer not to use c++ as I already have c# code that I have coded for image processing, path finding and etc. C# is pretty decent.

    Per the advice above (on this page) I tried compiling Samples\Capture\DxSnap found in DirectShowSamples-2007-July.zip which is found under files in this site. Up on trying to compile it, the compiler was asking for DirectShow2005.lib... Try compiling it using the .sln provided. Those are the errors I got. I am using Microsoft Visual Studio 2008.

  11. 2009-11-29 05:46:03 UTC

    Well, since c# doesn't use .lib files, this is a very confusing error message.

    The only file it should require is DirectShowLib-2005.dll, which is in DirectShowLibV2-0.zip, which is also under files in this site.

  12. 2009-11-29 05:46:33 UTC

    You need to add a reference to DirectShowLib.

  13. 2009-11-29 11:15:28 UTC

    The entire library? Is that just one DLL? If so can you link me to it?

    Sorry for being whiny... :(

  14. 2009-11-29 11:26:16 UTC

    Why not click on fhe 'Files' tab?

    https://sourceforge.net/projects/directshownet/files/

    link text

  15. 2009-11-30 01:47:35 UTC

    It works. Thanks.

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.