Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Capture picture with Digital Video Card


Reply
 
Thread Tools Display Modes
  #1  
Old 07-05-2012, 03:01 AM
carnation's Avatar
carnation carnation is offline
Junior Contributor
 
Join Date: Apr 2003
Posts: 306
Default Capture picture with Digital Video Card


Hi all,

I am using Digital Video Card to connect the camera and view video. But I want to write program to view video and capture picture by my own program. Can I do this. Pls help to show me how to do.

Thanks a lot.
Reply With Quote
  #2  
Old 07-05-2012, 09:02 AM
dilettante's Avatar
dilettante dilettante is offline
Underclocked lifestyle

Forum Leader
* Guru *
 
Join Date: Feb 2005
Location: Michigan, USA
Posts: 4,184
Default

Much of this depends on your camera and card combination, the drivers provided, what SDK (if any) is provided for it, and what versions of Windows you are using. There is nothing in VB meant to support this directly so you aways need to go "outside the box" even if it is just making system API calls.

If your camera has Video For Windows capture drivers or drivers that can work with the WDM/VFW adapter driver you may be able to use AviCap32.dll calls to accomplish this.


There are a lot of crude AviCap code samples floating around the Web. These are often "good enough" depending on what you are trying to accomplish.

If you merely want to see the video on the same PC, you can probably get by just setting up an AviCap Preview Window and viewing that. If you need to actually grab individual images you might be able to use the next (small) step up by capturing video frames from the Preview Window to the system clipboard. Examples of these are all over the place.

There is also a non-Clipboard technique based on the Preview Window, catching frames via a callback routine.

To get around the limitations of those techniques (trashing the clipboard, not working if the window is minimized, breaking in other special scenarios) you can do "no file capture" instead of using a Preview Window.


I recently worked on this exploring "capture and send to another computer." This added the elements of JPEG compression and transmission over TCP and HTTP to simple capture. To keep the examples simple I use WIA 2.0 for JPEG compression and a previously written Gossamer embedded web server UserControl. This means Windows XP SP1 or later is required.

However you could substitute GDI+ techniques (or use a 3rd party library to do JPEG compression if you need it on ancent Windows versions). You could ignore or rip out the Gossamer modules if you aren't interested in true "web cam" functionality, etc.


These examples are at AVICap32 Cam Streaming w/o Clipboard.

"Remote Cam" (RemCam) versions through 2.x there use a non-Clipboard, Preview technique.

RemCam 3.0 and later and GossCam 1.0 and later there use a non-Clipboard, non-Preview technique (though they also include "local preview" using a Preview Window).


All of these examples were written and presented assuming you have some prior experience with AviCap32 capturing. The main thing left out is the topic of enumerating and selecting capture devices, but since you don't find "true" VFW devices much anymore they all "appear" to AviCap32 as a single WDM device (device 0) anyway.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->