ezVidCap Component by Ray Mercer (VB6)



Read and add posts to the Visual Basic 6.0 Forums

Download some of my programs and OCXs

Read the Tips here

The old style forum is still available here



ActiveX Control

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 Disclaimers).

When you first place the control on the form, and your webcam is working properly, you will see something like this:

The control on the form

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:

A basic recording application

Write the code for the two buttons as shown below:

Private Sub cmdRecord_Click()
ezVidCap1.CaptureFile = txtAVI.Text
End Sub

Private Sub cmdStop_Click()
End Sub

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 record:

Set the MakeUserConfirmCapture property to False to disable this message box and record straight away.

Video Settings

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.

Video Compression

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 by Radius.

Video Format

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.

Video Source

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.

Archived Comments

From: R0meo Pactol Jr
Date: Friday, February 13, 2009 at 19:31:22
Comments: its so mice website because ive got a lot of knowledge regarding to my ICT project which was the video recording using VB 6.0
From: shankar patil
Date: Saturday, March 22, 2008 at 12:07:28
Comments: thanks for yor active control video display
From: riyadi
Date: Sunday, March 16, 2008 at 18:41:35
Comments: sorry my english very bad,... i have project to save dib and capture  image and video together
From: can
Date: Tuesday, March 6, 2007 at 17:58:13
Comments: thanks
From: Sannex
Date: Saturday, February 10, 2007 at 05:51:42
Comments: Thank you for the very Great and Good program....
Right now i'm using for the
From: Mark
Date: Friday, February 2, 2007 at 13:20:23
Comments: This is a beautiful control. However, recently, it started showing up as Spyware in several detectors upon installation. Anyone know anything about this?
From: Vartan
Date: Tuesday, October 4, 2005 at 02:32:12
Comments: 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
From: neeraj, chandigarh
Date: Thursday, June 9, 2005 at 14:26:10
Comments: Hi,
     I'm quite impressed from comments of other users. I want to use it in my project. Will it work with RVG camera also? If it can then it will be a wonderful add-on for my project. Thanks
From: piñasa
Date: Saturday, June 4, 2005 at 01:16:28
Comments: piña pero tu informacion parece buena
pero no se muy bien el idioma
From: Tia
Date: Tuesday, May 31, 2005 at 23:57:30
Comments: "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.
From: Darrin J. Calcutt, CEO, COO
Date: Monday, February 7, 2005 at 23:04:26
Comments: 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
From: Jaiswar Vipin Kumar R.
Date: Saturday, October 30, 2004 at 15:46:00
Comments: Thanks for giving hint inthe capucting the image from web cam .

Jaiswar Vipin Kumar

From: qijli
Date: Monday, October 25, 2004 at 13:37:31
Comments: hi ray
  I very thanks you for your help ,though I can not understand the explations,but thank you all the same.
From: Daniel
Date: Tuesday, June 1, 2004 at 22:08:47
Comments: I have written a VB program to add captions (such as time/date etc.), and graphics to the video window. Anybody interested, email me ( for copy of source code. (Please state intended use).
From: Marcos Bernardino García
Date: Thursday, May 13, 2004 at 00:44:20
Comments: oye la pagina que me estas espescificando al inicio no existe pero me gustaria que me dijeras en donde puedo bajar los controladores

la pagina que no se puede abrir es

From: jai
Date: Friday, March 26, 2004 at 07:33:31
Comments: I think this just got codes from directshow's amcap
From: Hassan
Date: Saturday, March 13, 2004 at 19:34:53
Comments: Nice work...
From: Ed
Date: Wednesday, February 25, 2004 at 13:59:36
Comments: Is there any way to set the resolution size when the program is launched? I mean start with a specified resolution by default?


Reply: Unfortunately, you will need to use the ShowDlgVideoFormat method and let the user set the resolution, as there is no way of doing it automatically.
From: Jason
Date: Thursday, February 19, 2004 at 09:25:48
Comments: Hi Martin, 

after testing through the activex.. i found it doesn't have a method to control the "Composite Channel" of a video capture card that can have 4 different input... 

or is there a way to configure it through vb6 code without calling out the third party popup selection menu... like (example: invoke source method of the ocx)

Reply: I do not think this is possible with this control.  This control is only used to display video from different sources, which could be webcams or capture cards - it cannot control hardware.

I do not have the source code for this control.  You could try contacting Ray Mercer.

From: Emidio Braga
Date: Tuesday, February 10, 2004 at 20:26:12
Comments: 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.
Reply: 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.
From: qist
Date: Thursday, February 5, 2004 at 10:37:18
Comments: i want to build a webcamera software.can u giv sum advise and tell me how and where to start by using vB.
From: karthick.r
Date: Thursday, January 1, 2004 at 06:03:28
Comments: please help me to develop my project on "video conferencing and voice chat" . i am developing my project in vb6.
From: Danny way
Date: Monday, December 29, 2003 at 21:20:45
Comments: Hi ray!
i'm trying do a basic live video chat program.
i cannot understand the way of using your ocx with the winsocket ocx.
From: lai
Date: Friday, December 12, 2003 at 12:38:38
Comments: thanks for this active control coz it really is of big help in out project.. yet im finding it hard saving my captured image to bitmap type.. How do i use the .SaveDIB method?
Im really new to this..

gud day!


This is how to use the SaveDIB method:

ezVidCap1.SaveDIB "C:\File.dib"
From: Tom McNulty
Date: Wednesday, October 29, 2003 at 01:04:15
Comments: 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.

I have Win98se and a Pentium 4

Thanks for any ideas.


From: James
Date: Tuesday, September 16, 2003 at 10:40:50
Comments: HI ! Very nice control ocx. How I could use it to compress streaming to be sent via tcp/ip using server and client in vb6?
From: Sandy
Date: Sunday, September 14, 2003 at 18:36:27
Comments: Hi Ray,
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.
Reply: 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.
From: Ted Jones
Date: Monday, September 8, 2003 at 18:49:08
Comments: 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?
Reply: I do not think this is possible with this control.
From: Gulzar
Date: Monday, August 25, 2003 at 16:53:45
Comments: hi I have used this webcam activex program in VB6, it works fine. Can i use the same activex for ASP 2.0? If yes can u provide me a sample code for that. I will be very greatfull to u.
From: ali
Date: Thursday, August 7, 2003 at 15:08:40
Comments: hi dear
i want to make a conference room between two person 
in the lan and send webcamera frames to these computers please help me about it.
thanks a lot
From: Hung Nguyen
Date: Friday, August 1, 2003 at 04:45:22
Comments: 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 ?
From: sunil
Date: Monday, July 21, 2003 at 07:37:07
Comments: Thanks a lot for developing this control and giving it free. please keep me informed of any new controls added.
From: Jawed Nawaz
Date: Thursday, July 17, 2003 at 12:45:24
Comments: 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

Reply: I do not think that the source code is available for this control.  You can check for yourself by going to Ray Mercer's website.
From: dagos
Date: Thursday, July 10, 2003 at 16:39:26
Comments: 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, Picture1.Height), vbRed
End Sub

Private Sub cmdSave_Click()
SavePicture Picture1.Image, "C:\File.bmp"
End Sub

Private Sub Form_Load()
Picture1.AutoRedraw = True
End Sub

Remember to set the PictureBoxes AutoRedraw property to True otherwise the line won't save.

From: Hanumanth Reddy
Date: Friday, June 27, 2003 at 09:14:17
Comments: Hello Ray,

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.

Thank u!

Hanumanth Reddy

From: Jefferson Paredes
Date: Thursday, June 19, 2003 at 21:24:42
Comments: Hi.

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?


From: Philippe Signoret
Date: Tuesday, June 17, 2003 at 00:17:36
Comments: Hello,
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 ()
    End Sub

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)
       vid.SaveDIB pth
    End Sub

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,
Philippe Signoret


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 String)
    vid.SaveDIB pth
End Sub

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.

From: MagiCminD
Date: Monday, June 16, 2003 at 04:51:22
Comments: Well, what can I say... Thank God guys like you exist!!!  You saved me a whole lotta work writing an ocx.
Bless you.
If there is anything you need, write me. Maybe I can help you too.



From: Rob
Date: Saturday, June 14, 2003 at 01:42:08
Comments: ezvidcap is great. But do you have any info on how I can control tilt and pan using visual basic for my website.
From: fred
Date: Sunday, May 25, 2003 at 03:53:51
Comments: i like it. it helps me a lot... more power.
From: rohit
Date: Wednesday, May 21, 2003 at 10:19:12
Comments: Hi All,

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).

Thanks in advanced

From: alwyn dsouza
Date: Saturday, May 10, 2003 at 06:15:09
Comments: great software . really needed this one
From: Anish
Date: Friday, April 18, 2003 at 10:18:32
Comments: Hi Ray,
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.
From: Andy
Date: Wednesday, April 16, 2003 at 05:18:00
Comments: 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?
Reply: 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.
From: Fahry
Date: Thursday, April 10, 2003 at 07:05:53
Comments: Thanks For Help.
Actually I am trying to run an audio using vb not video
From: Mehdi Nazer
Date: Friday, March 7, 2003 at 22:41:43
Comments: Dear Ray
Hello ,

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

From: lisa
Date: Friday, February 28, 2003 at 13:51:06
Comments: hi ray..
sorry.. i'm really don't know which one the "control'... i can't catch it up...
From: alex
Date: Friday, February 21, 2003 at 22:51:41
Comments: HI ! Very nice controlo. Do you know I could use it to compress streaming to be sent via tcp/ip ?
From: sadegh
Date: Tuesday, December 10, 2002 at 15:46:48
Comments: 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 !
From: Pieter
Date: Sunday, December 8, 2002 at 01:10:50
Comments: 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 ?
Reply: You can capture still pictures (.dib images) using the SaveDIB method.
From: Rich Fairchild
Date: November 22, 2002 at 11:14:20
Comments: 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?
From: kwan wah
Date: Thursday, November 21, 2002 at 03:07:48
Comments: hi ray,

thanks for yor active control video display, it is very useful and solve my problem.  I want to draw lines on the video display (overlay ), how i going to do it. please advise

Martin Allen 1999 - 2013.  Last updated Wednesday 27 March 2013 11:03:50 PM -0000.