Desktop Videocam image capture library

mjcoon

Well-Known Member
Licensed User

That was quick; thanks.

I see that your interface is derived from
B4X:
HWND VFWAPI capCreateCaptureWindow(
  LPCTSTR lpszWindowName,
  DWORD dwStyle,
  int x,
  int y,
  int nWidth,
  int nHeight,
  HWND hWnd,
  int nID
);
so the derived order of parameters would indeed be "left, top". But then the parameters are passed to
B4X:
SetWindowPos(int hwnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
but with the order reversed. All rather confusing...

Mike.
 

mjcoon

Well-Known Member
Licensed User
I should have used Refactor to rename the parameters but didn't so the call to SetWindowPos didn't get corrected. It's nearly four years since I last touched that library!

What I found strange was that none of the people who were early adopters back then seemed to notice!

BTW one of the things I must study is why the list of "devices" just yields WDM whereas there are two PCI cards that offer video via DirectX. They can be selected by other video display programs. Maybe this is somethng to do with the driver stack...

Mike.
 

petrbury

Member
Licensed User
Longtime User
Draw through the video window ?

Hi,
is there any way to draw a line through the video window? I tried several possibilities but or the line was hidden by the video window either I became an error message.
Regards
Petr
 

hung

Active Member
Licensed User
Longtime User
I have a HD webcam - Logitech c920

I have a HD webcam - Logitech c920.

I run your Videocamdesktop program and try to use resolution higher than 640x480. I clicked button Format but cannot see higher resolution. Anyway to do that?:sign0085:


By popular demand! This isn't finished but it is usable. This captures bitmaps from your videocam if you have one. Desktop and .NET 2.0 only.

EDIT : Version 1.1 with demo and help file posted. Can now save an image to a file and show continuous video.

EDIT : Version 1.2 with updated demo and help can now show two dialogs for the user to adjust camera settings if the capture driver implements this.

EDIT : :signOops: Version 1.3 now has as a dialog missing unintentionally from version 1.2
 

Basic4Life

Member
Licensed User
I have a HD webcam - Logitech c920.

I run your Videocamdesktop program and try to use resolution higher than 640x480. I clicked button Format but cannot see higher resolution. Anyway to do that?

The problem is probably that Video For Windows is an old API.
So drivers or the capture window might not be updated to work with higher resolutions.

Here's a simple DirectShow webcam wrapper from another project based on the DirectShow.Net library.
It's only good for showing the cam preview on a from and taking snapshots, but if that's all that you need it might be good enough.
 

Attachments

  • webcam.zip
    107.4 KB · Views: 12

hung

Active Member
Licensed User
Longtime User
The problem is probably that Video For Windows is an old API.
So drivers or the capture window might not be updated to work with higher resolutions.

Here's a simple DirectShow webcam wrapper from another project based on the DirectShow.Net library.
It's only good for showing the cam preview on a from and taking snapshots, but if that's all that you need it might be good enough.

Thanks. Yes that is what I want. I get the running well except I cannot try use resolution other than 640, 480.

Putting 1280 x 720 and 1024 x 768 generated error. Anyway to know the resolution lists?
 

Basic4Life

Member
Licensed User
Thanks. Yes that is what I want. I get the running well except I cannot try use resolution other than 640, 480.

Putting 1280 x 720 and 1024 x 768 generated error. Anyway to know the resolution lists?

Here's a modified version of the webcam library, which gives you the option to check for devices and supported resolutions.
You can try it out and see if 1280x720 or higher shows up in that list.
 

Attachments

  • webcam.zip
    109 KB · Views: 8

hung

Active Member
Licensed User
Longtime User
Here's a modified version of the webcam library, which gives you the option to check for devices and supported resolutions.
You can try it out and see if 1280x720 or higher shows up in that list.

Thanks again. Yes I can see the resolution list. The Logitech HD Pro C910 show a lot of resolutions. Excellent! :icon_clap:



I plug another unbranded webcam that show from device list as "PC Camera" then the maximum resolution is 640x480x16 only. So I need another driver may be? Any idea if there is a common driver for high resolution?
 

Basic4Life

Member
Licensed User
Thanks again. Yes I can see the resolution list. The Logitech HD Pro C910 show a lot of resolutions. Excellent! :icon_clap:



I plug another unbranded webcam that show from device list as "PC Camera" then the maximum resolution is 640x480x16 only. So I need another driver may be? Any idea if there is a common driver for high resolution?

If the camera does support higher resolutions it might be a driver issue.
You can try the driver update in the device properties in the windows device manager in the crontrol panel or google the hardware id from the details tab in the device properties.
 
Top