Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / September 2004

Tip: Looking for answers? Try searching our database.

video capture in Visual C# .NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ravi - 20 Jun 2004 07:56 GMT
Hi,
   Im trying to develop a Visual C# .NET app. that uses DirectShow filters to capture video from camera source. However, after going through a series of articles, I've seen that DirectShow is not directly supported in Visual C#.NET.

  Im wondering if there's any way to use the video-capture filters of DirectShow in Visual C#.

  Otherwise, would it be possible to create a Visual C++ DLL that uses DirectShow filters to capture video from a WDM camera source, and use it in Visual C# .NET program.

Please suggest.
John Young - 20 Jun 2004 12:51 GMT
Try this

http://www.codeproject.com/dotnet/wiascriptingdotnet.asp

I worked for me, although make sure you read the comments at the bottom of
the page, because there was a bug in the source code.  I've put the post
about the bug here to save you the trouble....

HTH, John

             Correction to sample code   DavidDavison  4:20 2 Nov '03

             I suggest a correction to the NetMaster's code.

                       foreach( object wiaObj in wiaDevs )
                       {
                       devInfo = (DeviceInfoClass)
Marshal.CreateWrapperOfType( wiaObj, typeof(DeviceInfoClass) );

                       //Marshal.ReleaseComObject( wiaObj ); <- MOVE THIS

                       if( devInfo.Type.IndexOf( "Video" ) > 0 )
                       {
                       foundID = devInfo.Id;
                       foundCount++;
                       }

                       Marshal.ReleaseComObject( wiaObj ); // <- TO HERE

                       Marshal.ReleaseComObject( devInfo ); devInfo = null;
                       }

                       I have found that the devInfo you have just
marshalled is released before you can use it to check the type.

                       Other than that, Nice one NetMaster!

> Hi,
>    Im trying to develop a Visual C# .NET app. that uses DirectShow filters
[quoted text clipped - 10 lines]
>
> Please suggest.
Ravi - 20 Jun 2004 14:38 GMT
Thank you John. That link is quite useful. Thanks a lot for suggesting the correction to that code too..

> Try this
>
[quoted text clipped - 47 lines]
> >
> > Please suggest
Ravi - 24 Jun 2004 19:34 GMT
Hey John,
              I was trying to use the WIA Device class for video capture, and the correction that you've suggested saved me time. Thank you.

              However, the program is not able to detect my Creative Lab webcam and one other USB 2.0 webcam as WIA devices. Its able to detec a hp scanner as a source for images, but, not the webcams.

              Is this a limitation of the WIA script, or am I doing something wrong here?

Thanks in advance.
Ravi.

> Try this
>
[quoted text clipped - 47 lines]
> >
> > Please suggest
John Young - 24 Jun 2004 22:45 GMT
I honestly could not say because I am a complete beginner to WIA as well.
I do remember somewhere that some camera drivers dont seem to work with WIA.
The only other way would be to use TWAIN, which is on the CodeProject site
as well.  Although I haven't tried TWAIN yet.

Good luck, and let the group know how you get on...

HTH

John

> Hey John,
>               I was trying to use the WIA Device class for video capture,
[quoted text clipped - 68 lines]
>> >
>> > Please suggest
ChainsawDude - 30 Sep 2004 18:33 GMT
John,

I was wondering if you tried to use this code in a batch program?  The
supplied code requires a user to be present to click the capture button, I
want to put something on a schedule and run unattended.

Thanks

> Try this
>
[quoted text clipped - 47 lines]
> >
> > Please suggest

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.