Results 1 to 11 of 11

Thread: Webcam

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Webcam

    Is there a way to have a web cam record in vb?

    This is going to be hard for me to test, because i dont have a web cam.. so i am going to trust you code until i can test it
    My usual boring signature: Something

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Webcam

    You'll be having hard time i am telling you.

    If you have a webcam installed with its software, there might have an OCX included with it. Like for instance in A4tech webcams, it has an OCX.

    So just add it in components.

  3. #3

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Webcam

    Accessing WebCam in Visual Basic 6

    I don't have a webcam either. So I can't test the code.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Webcam

    It does work ... sort of. It puts the picture from the web cam into a picture box. It's good code to start with.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  6. #6
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Webcam

    There are some 'fake webcam' programs that install a 'virtual' webcam. Search for them. They may work.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  7. #7

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Webcam

    Quote Originally Posted by iPrank
    There are some 'fake webcam' programs that install a 'virtual' webcam. Search for them. They may work.
    that makes no sense what so ever
    My usual boring signature: Something

  8. #8
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: Webcam

    Quote Originally Posted by dclamp
    Quote Originally Posted by iPrank
    There are some 'fake webcam' programs that install a 'virtual' webcam. Search for them. They may work.
    that makes no sense what so ever
    He means programs that trick the computer into thinking a webcam is installed, so you can test your program without actually needing to connect one.

  9. #9
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Webcam

    check this out .. it does work ..
    http://www.planet-source-code.com/vb...64535&lngWId=1

    though it could use some cleaning up (not my code) ..
    it should give you the basics .. i actually used the idea to create motion detection for an activeX i use for a CCTV DVR remote video app ..
    in other words i didnt want to use the activeX's built in motion detection function as it kept crashing.

    I then looked at this one which is better documented (slightly) ..
    http://www.planet-source-code.com/vb...47404&lngWId=1

    but the first one i linked (is in spanish) also has the record part ..
    or at least save image

    You need to use something to capture the video though, such as the VidCap, or the EZVIDC60.OCX from http://www.shrinkwrapvb.com. Optionally you can use whatever the Webcam manufacturer gives you .. most have some kind of ActiveX or even a way just to access the images.

    Baically the picture box idea is this ..

    Connect to the Webcam/DVR etc. . using their ActiveX .. if they dont have one, most have access to update the images, eg, such as Axis .. by using a web page .. so you could simply keep throwing that query at the URL to refresh the images, then put the images in the picture box ..

    using an activeX ... etc .. slightly different, easier .. use the ActiveX controls built in SaveImage (may be called something different depending on the system, eg could be SnapShot) and set the image to a temp file (can be placed anywhere once you can access it again in the code). Simply in a loop you keep filling the picture box with that updated file. If the timer is at least 100mlls then it looks real time .. but this also depends on the speed of the captured video, remote connection, etc. Some will crash if you do it this fast though, such is the case of the DVR i work with, so I had to make it 500mlls which is slightly slower, but since i was only concerned with motion detection it was not an issue, i use the actual ActiveX to display the live video and just the picture box (hidden in my case) to check for motion and update a border on the main activeX video box.

    I believe the code that Iprank linked to requires an existing Webcam window to already be open .. not sureas I have no local source ...

    All that said, I dont have experience with webcams, more so with just Industrial products, and the remote video side.
    Last edited by rory; Feb 18th, 2007 at 08:47 AM.

  10. #10

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Webcam

    all the examples i downloaded and opened gave me errors for the ocx's. Maybe it is because i have vb5.0?
    My usual boring signature: Something

  11. #11
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Webcam

    No, you first have to register the OCX ..
    In the case of at least one of them, its that EZVid ActiveX Control and its included in a Drivers.zip file in the main zip.

    or its located here ..
    http://www.shrinkwrapvb.com/vbctrls.htm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width