If you have a webcam and you want to use it in Visual Basic
6.0, then this is the ActiveX control for you. This control can receive
video from different sources, which can be changed at runtime. It can take
pictures, which makes it a good base for creating webcam software, as long as
you know how to use FTP in Visual Basic. A good example of some webcam
software using this control can be found here
- Easy Free WebCam from UK Software.
Download the control from here (see
When you first place the control on the form, and your webcam is working
properly, you will see something like this:
At the moment, all you will see is live video from the camera, but this control has a lot of
properties and methods for you to use.
To record an AVI video, you set the CaptureFile property to the filename that
you want to record to use the CaptureVideo and CaptureEnd methods to start and
stop recording. Create two buttons - cmdRecordn and cmdStop and a textbox
- txtAVI e.g:
Write the code for the two buttons as shown below:
ezVidCap1.CaptureFile = txtAVI.Text
Private Sub cmdStop_Click()
Next test your program. Warning - don't leave it recording for too long
as AVI files can get quite big. An AVI file will have been created in the
location that you specified.
By default, the CaptureAudio property is set to False. If you want to
record audio with your video, you must set this to True either at design time or
runtime. Also, make sure that your microphone is setup properly.
If want to click at a higher frame rate than 15 (which is the default),
change the CaptureRate property.
To capture a picture in DIB format (a type of bitmap), use the SaveDIB
method and then a filename ending with .dib. Microsoft Paint will be able
to open files of this format.
In the above example, a dialog box is shown to ask whether or not you want to
Set the MakeUserConfirmCapture property to False to disable this message box
and record straight away.
There are a number of dialog boxes that can be shown only at runtime to let
the user configure the video and audio settings for the video sequence.
These dialog boxes are shown when the relevant method is executed. I have
included notes that you may want to include in your program's helpfile e.g.
higher quality sound will result in a larger file etc.
Select Sound Format
This dialog box is shown when the .ShowDlgAudioFormat method is used.
The user can change the audio format as well as each formats
attributes. Clicking OK will accept the settings. Note for the user:
a higher quality sound format will result in a larger video file.
This dialog box is shown when the .ShowDlgCompressionOptions method is used.
The video compression codecs that are installed on the computer are shown
here. The user can change the settings for the codecs here as well as look
at more advanced settings and 'About' information about the codec. Note
for the user: not all computers have the same codecs installed so a video
recorded on one computer may not necessarily play correctly on another computer
if an uncommon codec is used. Use a common one such as the Cinepak Codec
This dialog box is shown when the .ShowDlgVideoFormat method is used.
This dialog allows the user to change the resolution and the pixel depth
(bits) and compression of the stream. Note for the user: a higher
resolution will result in a larger video file.
This dialog box is shown when the .ShowDlgVideoSource method is used.
There are two parts to this dialog box - Camera controls and Capture
Source. The Camera controls section allows the user to change precise
settings for their camera such as brightness and contrast etc. The second
section, Capture Source, lists the Video Devices on the computer. E.g. a
webcam and a TV card.
I am using this capture control in my program, but it stops capturing when I click the mouse in the program or outside the program, and when another screen (exmp: My
Computer" is overlaying the capture screen
"VB6.exe has generated errors and will be closed by Windows. You will need to restart the program." I got this error while I'm exiting the application. This only occurs when there is an ezVidCap component within the application. It always shuts down my program. Could you assist me with this problem? thank you.
I found a bug with the OCX file. I can place some object on top of the video screen. I was hoping to place a transparent picture over the video (to make it lok like you are looking out the windshield of a locomotive) see
I have written a VB program to add captions (such as time/date etc.), and graphics to the video window. Anybody interested, email me
(firstname.lastname@example.org) for copy of source code. (Please state intended use).
is it possible to use four web cams at the same time and show them in four pictures at the same time ???
I need to write a security VB6 program and i need, at least, 4 web cams being captured at the same time. thanks.
This should be possible. Unfortunately, you would need to use
the ShowDlgVideoSource method for each ezVidCap control to let the user
choose each webcam, as there is no way of doing it automatically.
I am really keen to use this as the reviews seem great and the code seems simple enough, however.....
I have a Hauppauge 350 and I keep getting an error as soon as I paste the control onto the form, saying the capture card is in use but I have nothing running and it works fine using the supplied app but when I try to use it in VB this error stops me.
Do I need the C:\Capture.avi, because it well not let me delete it in the properties window. And the ezVidCap1 turns black and will show the picture at times. I have to close the project and reopen it. Hope you can help.
You cannot delete it, you can only change it to a valid
filename. The folders must already exist, but the file doesn't
have to. If the webcam image is turning black, it looks like a
problem with your webcam drivers or the webcam itself.
I have just downloaded the ezvidcap files and I have a question about multiple sources. I am using an ATI TV Wonder that has a TV Tuner port and a Composite video port. I see hoe to choose between them on the source dialog page, but how do I select it from code without the dialog box so the composite video is selected by default?
I do not think this is possible with this control.
ezVidC60.ocx is great. I use it in my VB6 program to control the AverMedia EZCapture card (v2.1, 2.3).
But now, I can't control the AverMedia EZCapture card (v2.5) with it.
Can you show me a new ActiveX control or give some advises ?
I liked ur software it is goood and my work is half done as iam a final year student and this part of my final year project i had one problem if i can get the source code of the active x u used names ezvidc60.ocx and ezvidcap.ocx b/c i had give in my report and they r not approving my project any ur project is very nice
Thanks from jawed
I do not think that the source code is available for this control. You can
check for yourself by going to Ray
Very good ActiveX control. I saw that someone else wants to draw lines over the video. I have the same problem. Please could you tell how to do?
I am not sure how to draw lines over the live video, but it can be
done on a .dib file that has been created using the .SaveDIB method of the control e.g.:
Private Sub cmdLoad_Click()
Picture1.Picture = LoadPicture("C:\Picture.dib")
Picture1.Line (0, 0)-(Picture1.Width,
Private Sub cmdSave_Click()
SavePicture Picture1.Image, "C:\File.bmp"
Private Sub Form_Load()
Picture1.AutoRedraw = True
Remember to set the PictureBoxes AutoRedraw property to True
otherwise the line won't save.
I am Hanumanth working as a VB/Oracle Programmer.I have a 2+yrs exp. in this platform.
Recently i developed one project for security purpose. Meana in this project i have to capture the visitor photos through web camera and store it in database. Here i used your control. It works fine.
I am very thankful to u for providing this tool for capturing photos from any web camera.
I am facing one more problem here. I want compare (check) two photos are equal or not (not size, check for photography). Is it possible for checking two photos? Please give me solution as soon as possible. Becs i want to implement this project in next month.
I hope u are able to give solution to this problem.
I am interested in developing an image analisys solution in realtime for
a shooting training device, using a webcam looking to the target board
and a laser pointer in the barrel tip of the rifle to capture the "red dot"
track over the target board and the track must be overlayed over the target board
image. How can I recognize the red dot in the image and how can I do overlay?
First of all, great control, just what I was looking for.
Just one little problem...
I have a form that hides itself when loaded:
Private Sub Form_Load ()
Then tell it to take a picture of what is in the camera. The ezVidCap control is visible and previewing at 4 fps.
Sub takePicture (pth as string)
The first time I take the picture it takes it fine, but if I try to take another one, it turns out the same as the first.
Any suggestions as to why this is happening?
Another thing, is there a difference between [ezVidCap1.SaveDIB "C:\img.dib"] and [ezVidCap1.SaveDIB "C:\img.bmp"]?
Thanks in advance,
From what I can tell, the video display does not update when the
control is hidden or even behind another window. Therefore, you
should make sure the control is visible on the screen when you want to
take a picture i.e.:
Sub takePicture(pth As
I don't think it will cause any problems saving the picture as a .bmp
rather than a .dib, but you should save it as a .dib.
Can any one tell me how to capture and stream data using this control over the internet via TCP/IP (i am using winsock) and how to view the received stream. What compression should i use and how to go about it all. Can I use Open H323(How).
This is exactly the kind of thing I was looking for. I'm doing a project on a webcam reader for the blind and have been carrying out tests with various webcams and digital cameras to capture an image of some text and run it through an OCR(Optical Character Recognition) system and subsequently through a text-to-speech engine to get audio output. The whole thing works fine with a 1.3MP digital camera and a usb webcam. However when I use a FirewireDirect firewire (IEE1394) web camera and capture a single frame and try to save it using SaveDIB , it gives me an error saying DIB couldn't be saved. Any suggestions on what the problem might be ? I'm using a simple VB6 form with ezvidcap control.
I am working on a project which use TV turner card and stream to output. However, I cannot find any function from your OCX to channel the TV channel from PROGRAM code. Can you tell me how can I do this without prompting any window for manual change the TV channel?
This control was made by Ray
Mercer. As this control was probably made with webcam in mind,
I don't there is a way to change TV channels using it.
This is the 4th email that i send to you.
I'm very thank you for your active control video display and your help in every page of your web page .Please Help me , How I can Programing With VB6 to Video Transfer and Help me about using Ezvidcap.ocx to Display Overlay or Preview Capture Viewer On Multi Windows Or any description about this.
I'm Programing with Other ActiveX Controller to video transfer but they are'nt Suitable for my target, because I want to Send video to over than one person and recording it to file .
Please inform me a.s.a.p. to have more information about requested items .
I thank you in advance and wish to have ability to use your Help .
Waiting for your instant reply .
Best Regards : Mehdi Nazer
HI. I am just a VB beginner and but I have to work on a Video project so that I should Inverse The Captured video and make garphical effect on video in real time Could you tell me how can do that or where can I find informations about this.I look forward to receiving your valuable advice. Thanks very much !
please help me please help me please help me !
Sunday, December 8, 2002 at 01:10:50
Ray, Nice program ! I have two Video Devices under the Capture Source tab and would like to create still images from both of them. How can I do that ? Any ideas ?
You can capture still pictures (.dib images) using the SaveDIB
I'm using ezvidcap in one of my VB 6 programs. I'm trying to determine when the capture device is plugged in or not so i can enable/disable video buttons accordingly. I tried using the ezvidcap1.NumCapDevs statement, but it returns "1" whether the device is plugged in or not. Can you assist?