How do I use the ezVidCap control?



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




From: Arnaldo Alvarado
Date: Thursday 14 February 2002 1:51 AM
Subject: video for visual basic
Question: Hi,

I have a form that I want to add video from my webcam.  How do I go about adding the ActiveX control into the form (what ActiveX control do I need, ezVIDC60.oxc?).  I just want keep it very simple, to only display video automatically.  If possible send or tell me the source code that will enable me to do that.  You must be very busy, but I am in need of great help, anything you can do to help me will be of great.

thank you for your time....

Arnaldo Alvarado

This is quite simple to do:

  1. Download the file from here: (see Disclaimers)
  2. Put ezVidC60.ocx into C:\WINDOWS\SYSTEM
  3. Open Visual Basic and check 'ezVidCap Component by Ray Mercer (VB6)'.
  4. Add the control to your form.
  5. You should see a box with the live video being displayed in design time and runtime like this:

Archived Comments

From: Manish
Date: Saturday, October 30, 2010 at 18:52:30
Comments: Actually the .savedib method you discussed above is too slow for real time image processing.
to fetch a single picture it takes nearly 1 second this amounts to 1 frame/s which is too slow for my project.
please suggest a way to process images at atleast 5 fps
From: tauqeer
Date: Tuesday, July 24, 2007 at 09:47:38
Comments: nice good
From: Mark
Date: Friday, February 2, 2007 at 13:24:39
Comments: This is a GREAT control. VERY easy to use. However, recently, it started being detected as spyware on several customer machines. Is there a rogue version of this control out there?
From: Ayyappan
Date: Thursday, March 9, 2006 at 11:24:47
Comments: Thanks for your code, it is greatful for me god bless you.
My email id:
From: warallthetm
Date: Tuesday, January 10, 2006 at 18:40:03
Comments: No trojans, hijackers, or adware right??
Reply: I have never had any problems using this control.
From: Rico Loriaga
Date: Thursday, December 22, 2005 at 05:33:17
Comments: tnx have published a very helpfull control for the developers..tnx for brain sharing...LONG LIVE!!..tnx alot..MERRY XMAS & HAPPY NEW YEAR..
From: Shoazib
Date: Tuesday, May 24, 2005 at 01:53:31
Comments: I have used ezVidCap control on my application and found it very helpful. The only problem i get is when I capture movie it gives me a message box stating the location where the video file is. Is there a way I can get rid of the message box and start recording.
Reply: Set the MakeUserConfirmCapture property to False to disable this message box and record straight away.
From: Venkat
Date: Wednesday, May 18, 2005 at 23:01:41
Comments: Thank you for the beautiful control..
From: shehzeen
Date: Sunday, April 4, 2004 at 22:26:46
Comments: excellent
From: Reeyon
Date: Thursday, March 11, 2004 at 23:39:19
Comments: is it possible to store the avi video of different filenames rather than only CAPTURE.AVI???
I means store video at different location and filenames....
Reply: You need to change the CaptureFile property to the location you want to capture to.
From: Anshul
Date: Monday, February 23, 2004 at 07:18:09
Comments: i can capture video through this control at the specified frame rate.

but is it possible to move at the specified frame location while playing that captured file?

From: Rai
Date: Sunday, February 22, 2004 at 02:52:38
Comments: can i save a video in any video format rather than avi format?
Reply: This control can only capture in AVI format.  You will need to find another way of converting the AVI file into the format you want.
From: Randall
Date: Friday, February 20, 2004 at 17:05:45
Comments: I have built an app that captures AVIs and takes snapshots and saves as JPG.  However, the instant that the window is minimized or loses focus, the ActiveX control stops refreshing, and therefore my snapshots are always the same.  Ideas?

The video preview does not update when none of the ezVidCap control is displayed on the screen, which is causing your problem.  Unfortunately, there are no properties or methods to change this behaviour.  One way around it is to make sure the Form is displayed just before the picture is captured and then hide the Form again if desired.  Put two Timers on the Form as well as the ezVidCap control and try this code:

Private Sub Form_Load()
Timer1.Interval = 5000
End Sub

Private Sub Timer1_Timer()
If WindowState = vbMinimized Then
    WindowState = vbNormal
    Delay 1 'To allow enough time for the Form to be displayed
    ezVidCap1.SaveDIB "C:\Pic.dib"
    WindowState = vbMinimized
End If
End Sub

Sub Delay(t As Integer)
Timer2.Interval = t * 1000
Timer2.Enabled = True
Do While Timer2.Enabled
End Sub

Private Sub Timer2_Timer()
Timer2.Enabled = False
End Sub

From: Roberto Chavez
Date: Saturday, February 14, 2004 at 18:17:11
Comments: I have used ezvidcap very succesfully with a variety of video cature devices. Recently i tried to make it work with a d-link dub-t200 tv tuner USB 2.0 but it is not recognized as a video capture device by de ezvidcap control, although it works with other video applications.  What can i do to fix this problem?
From: jim
Date: Sunday, February 8, 2004 at 23:53:16
Comments: i would like to capture video in a separate thread. Although there is a property to do it, whenever i use it my application crashes.
any help would be appreciated 
From: basem kamal
Date: Sunday, February 8, 2004 at 19:09:08
Comments: hi iam in last year gardution project and i making robot control iam using tv tunner to recive vedio from  vedio cam and i wanna to recice the vedio in the vb page how can i do that i use the ezvidc60 and dun work the eroor message say that
( bitvid : failer loading vxd driver )  ok or help

i dun understand what is the message mean
iam sorry about distributeded you but replay me as quickly as you can plz iam sorru again
                       thanks alot                     yours/basem

From: Zia Syed
Date: Saturday, December 27, 2003 at 18:38:36
Comments: Hi.I have a final year project of a computer controlled surveillance vehicle.I have placed a wireless surveillance camera on top of it.I have programmed the car in VB 6.0. Now i have installed a Pixelview TV tuner card and i can see the result of the camera on the TV tuner s/w but i have to get that result on the form of my car's S/W.The Camera has AV output so TV tuner was necesary.Can anyone plz help me ASAP.I have to give the presentation very soon.
Reply: The ezVidCap control can be used for this purpose.
From: naresh
Date: Friday, November 21, 2003 at 05:15:25
Comments: how to set compression options programatically for video being captured?
how to record live videos with use of two buttons recursively?
From: Guds del Solar
Date: Friday, November 14, 2003 at 05:34:19
Comments: Can I use this control to get the video and send it thru lan in real time without show a local window? 
I can write all the stuff but I haven't figure out yet how to capture frames (no pics or video) from this control. That would be very useful for a security system. Thanks!
Reply: You can find out how to capture video and still images on this page.
From: edreve
Date: Monday, November 10, 2003 at 15:18:59
Comments: Hi, I'am using the ezVidCap and it works very well. I need to save a .DIB file as .JPG picture. It's possible with this control??
Reply: This is discussed on this page.
From: Shane Soboroff
Date: Thursday, October 30, 2003 at 17:29:29
Comments: We are starting a project at my lab where we need to incorporate a still image captured by a webcam into a vb screen.  So I need the program to initiate the picture and project it after it is taken at a certain spot on the form.  The programmer is gone for a semester, and I've never used VB before, but my boss doesn't care how to do it as long as it gets done.  If you can, please help!

Put an Image, a Command Button and an ezVidCap control onto the Form and try this code:

Private Sub Command1_Click()
ezVidCap1.SaveDIB "C:\Pic.dib"
Image1.Picture = LoadPicture("C:\Pic.dib")
End Sub

The image from the ezVidCap control will appear in the Image control.

From: Dolly Jain
Date: Saturday, October 18, 2003 at 09:08:32
Comments: I have a question , When any user fill my application form i want to provide a webcam control on form so that he can capture his live image while filling up the form and upload it then only or later .My problem is to create webcam control on form. If u have solution to my problem then please mail me the code,system requirement,details to implement it as soon as possible . I will be very thankful to u .
Reply: Have you tried the ezVidCap control?  I think it is what you are looking for.
From: Kev
Date: Friday, October 10, 2003 at 14:15:20
Comments: i need to change the image to 256 colours only, can i do that by code using this control?
From: James Hayter
Date: Thursday, October 2, 2003 at 21:46:41
Comments: Hey Guys, 

Please please please let me know if there's a way to select the video programmatically compression codec without having to use the dropdown.

Thank you so much,

Reply: Unfortunately, I do not think this is possible.
From: Reza Firoozy
Date: Tuesday, September 9, 2003 at 07:05:09
Comments: hi martin !
i have sent 3 or 4 mail for you but ,i dont have recieved any reply yet.
i want to do an image processing project, that  have to use ezcamc60. i need to have still pictures from ezvidc60, and then, send this still pictures, to a picturebox for processing. how can i do it?
maybe use of saveDIB method can be useful, but i dont know,how i perform it?
thanks a lot for ur time.

You can capture a picture using ezVidCap and then load it into a PictureBox with this code:

ezVidCap1.SaveDIB "C:\Pictures\Capture.dib"
Picture1.Picture = LoadPicture("C:\Pictures\Capture.dib")
From: jaavid firoozi
Date: Thursday, September 4, 2003 at 16:38:59
Comments: hi 
i have sent you two time.
i have a project in image processing that need to have ,still image form ezvidc60,moving video,and then send still images to a picturebox for processing.
how can i do it.
with regards
Reply: To capture still images, use the .SaveDIB method.  A project that shows how to capture video is included in the download (see above).  Have a look at this page, which gives a very simple example of a video capture program.
From: Tim Cinel
Date: Thursday, September 4, 2003 at 08:35:24
Comments: Is there any way i could contact Ray Mercer, if so, could somebody please email me how?
Reply: I have never been able to contact Ray myself, but I believe these are his e-mail addresses (hope you don't mind, Ray):

From: jason
Date: Thursday, September 4, 2003 at 03:35:07
Comments: Guys, 

   Is there a way to release the capture card driver which is currently being used???? how can i set the ezvidcap current driver to null or some sort so that i can free the device for others to use it
Reply: I have had a look at the control and cannot see any way of doing this except to change the Capture Source using the .ShowDlgVideoSource method.
From: fred
Date: Saturday, July 12, 2003 at 14:15:31
Comments: how can i decrease the size of the file and the size of the picture.
Reply: Use the .ShowDlgVideoFormat method to let the user reduce the resolution of the live video.  This will result in smaller pictures being captured using the .SaveDIB method.
From: Peter Finlay
Date: Monday, June 30, 2003 at 17:50:45
Comments: Hi,
Your ezvidcap.ocx control seems pretty helpful. I want to be able to start up my app using the previously selected drivers. Every time I start the demo it prompts for a driver even PRIOR to the load event occuring. Is there a way to save and recall the settings to fully automate the start-up procedure. (Save settings to a file or a reg-key etc.) I can do the coding if you can tell me how to intercept the driver call! Your help would be appreciated.



Reply: This control was made by Ray Mercer.  Your problem is something that is happening with your computer and I don't think there is a way around it.  I have three video sources and the control always chooses the correct source to use.  Are all your video sources webcams?
From: Dmytro T
Date: Wednesday, June 11, 2003 at 05:13:57
Comments: I used your control, but the problem is that the refresh rate is too slow and doesnt react on the changes of the PreviewRate, please advise how to fiz this problem. I appretiate your help
From: Daniele
Date: Friday, May 23, 2003 at 14:22:52
Comments: I need to change a parameter thats i find into video display window. I call it by this:ezVidCap1.ShowDlgVideoSource, but how i can change
a single parameter about this window from source code ?
Thanks !!!
Reply: I don't think this is possible because each video source uses its own settings.  You would need an ActiveX control written specifically for the video source to be able to change these settings.
From: saeed
Date: Monday, May 12, 2003 at 12:46:14
Comments: Hi
My name is saeed.I want to reseve a video file from 
webcam and send it to a PC for image processing without
saving on PC.Tell me the name of activex that can do it
and the website that I can download it.
From: Mohammad Zaidi Khan
Date: Monday, March 31, 2003 at 17:32:14
Comments: Hello, Thanks for the control. I would like to know how the captured file(earlier) can be shown(later)?

The information on this page should help.  Here is some code you could use to record a .avi file using two buttons:

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

Private Sub cmdStop_Click()
End Sub

From: j
Date: Monday, March 3, 2003 at 19:33:14
Comments: is it possible to save the stream as jpgs rather than avis? email me if pls.
Reply: You will need an ActiveX control to do this.  See this page for more information.
From: **keichi**
Date: Tuesday, January 7, 2003 at 03:22:30
Comments: gracias por su ayuda pero si me dirian como utilizar esta ocx seria chevere

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