• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 879
  • Last Modified:

Handling various Webcam connected to a USB Hub using VB6

Hello,

I'm trying take snapshots with three webcams using a USB Hub in a USB port. I need to know how can I do this, because  I'm using a USB hub and I know that the USB bandwith is divided, So I will have to take a snapshot by camera sequentialy, but I need to know how access the different USB ports of the USB hub and take snapshot.  Regards  
0
tarkust
Asked:
tarkust
  • 2
1 Solution
 
tarkustAuthor Commented:
I will do a cheap security system usign webcam, so I need at least four cams and process the pictures.  Any code for VB6 will help very much...
0
 
vb_elmarCommented:
This VB project (68kB) lets you see which USB devices are currently plugged into the USB port :
http://omnibus.uni-freiburg.de/~albers/snippets/usbinfo10.zip
0
 
vb_elmarCommented:
needs :
1 Form
1 ezvidcap1 (download:  http://www.shrinkwrapvb.com/ezvidcap.htm)
3 buttons (to select the video devices)

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Const WM_CAP_START = &H400
Const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10
Dim myVideoWindowHWND As Long
Public Function UseVideoSource(ByVal hwnd As Long, ByVal myDeviceNumber As Integer) As Boolean
UseVideoSource = SendMessage(hwnd, WM_CAP_DRIVER_CONNECT, myDeviceNumber, 0)
End Function

Private Sub Command1_Click()
   UseVideoSource myVideoWindowHWND, 0 '1st video device
   ezVidCap1.Preview = True
End Sub

Private Sub Command2_Click()
   UseVideoSource myVideoWindowHWND, 1 '2nd video device
   ezVidCap1.Preview = True
End Sub

Private Sub Command3_Click()
   UseVideoSource myVideoWindowHWND, 2 '3rd video device
   ezVidCap1.Preview = True
End Sub

Private Sub Form_Load()
    Command1.Caption = "device1"
    Command2.Caption = "device2"
    Command3.Caption = "device3"
    myVideoWindowHWND = ezVidCap1.hwnd
End Sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now