BBC BASIC for Windows
Programming >> Sound, Music and Video >> Webcam http://bb4w.conforums.com/index.cgi?board=multimedia&action=display&num=1284576141 Webcam
Post by JB91 on Sep 15th, 2010, 6:42pm
Is it possible to show what the webcam is seeing? (mine is built in to my laptop)
Re: Webcam
Post by admin on Sep 15th, 2010, 9:31pm
Yes, you can use the AVICAP32 DLL to grab images from the webcam and display them, or do what you like with them. I thought there was a demo program for that on the group, but I can't find it. Either it has been deleted by its author, or it's called something obscure!
Unfortunately, although I've grabbed video from a TV tuner card (the code is basically identical), none of my PCs has a webcam so I can't do any tests here.
If nobody else pops up with some code maybe I should invest in a cheap USB webcam.
Richard.
Re: Webcam
Post by JB91 on Nov 3rd, 2010, 7:05pm
I don't think anyone knows. I've checked through lots of files on the BBC BASIC Yahoo Group, and I can't find anything at all.
Re: Webcam
Post by admin on Nov 3rd, 2010, 10:27pm
I don't think anyone knows. I've checked through lots of files on the BBC BASIC Yahoo Group, and I can't find anything at all.
I have found the program which I was remembering: it's called webcam16.bbc by David Dade and dated August 9th 2006. It contains all the code needed for grabbing pictures from a webcam.
Unfortunately I don't know how to contact the author for permission, so I can't upload the program or let you have it. However the actual process of capturing images is quite straightforward.
Firstly you have to create a capture window which you do by calling the function capCreateCaptureWindowA exported by AVICAP32.DLL. Once you've created that window you grab a frame by sending it a WM_CAP_GRAB_FRAME_NOSTOP message, and then you can save it as a BMP file by sending it a WM_CAP_FILE_SAVEDIBA message.
That's basically all there is to it. You can find documentation for the DLL and the functions on MSDN. Hopefully with that information you can do what you want to do quite easily.
Later: I've bought myself a cheap webcam so I should be able to give assistance if required.
Richard.
Re: Webcam
Post by JB91 on Nov 4th, 2010, 8:28pm
I've managed to create the window, but I can't seem to be able to show the images.
Josh.
Re: Webcam
Post by admin on Nov 4th, 2010, 11:38pm
Re: Webcam
Post by Ironman on Jan 14th, 2012, 1:21pm
Richard, although I'm a yahoo groups member I can't seem to get into the site to download the webcam.bbc file that you have provided. Would you be kind enough to send me an alternate download link for the program or post a code listing, as I am very keen on developing a time lapse capture application using a webcam. Thank you in anticipation.
Re: Webcam
Post by admin on Jan 14th, 2012, 3:40pm
You need to be a member of the BB4W group, not just of Yahoo, to download these files.
Richard.
Re: Webcam
Post by Ironman on Jan 14th, 2012, 5:49pm
Thanks Richard, but when I click 'join this group now' my browser window clears and nothing happens. Most frustrating!! Re: Webcam
Post by admin on Jan 14th, 2012, 9:06pm
Thanks Richard, but when I click 'join this group now' my browser window clears and nothing happens. Most frustrating!!
Try it with a different browser perhaps? Although I generally use IE, I've got Firefox, Opera, Safari and Chrome installed for recalcitrant sites! Re: Webcam
Post by Ironman on Jan 14th, 2012, 10:03pm
Tried Firefox and IE7, still no result....... Re: Webcam
Post by admin on Jan 15th, 2012, 09:43am
Sorry, in that case I have no idea. 794 people are currently members of the group, and nobody else has previously reported any problem joining it.
Richard. Re: Webcam
Post by Ironman on Jan 15th, 2012, 2:00pm
Maybe they're having problems with their website. I've just tried again with Firefox and the same thing occurs. White screen and no web page, although the address bar shows that the page is loaded. Totally miffed!!!! Re: Webcam
Post by admin on Jan 15th, 2012, 4:03pm
If I try to access the group as a non-Yahoo member (using IE's InPrivate Browsing option to disable my cookies) I get the 'Sign in to Yahoo!' page, so at least that seems to be working correctly.
What I can't easily do is to reproduce your situation of already being a Yahoo user, but not a member of the BB4W group. As the group owner, I'm not allowed to leave it!
Can you at least confirm that if you attempt to access the BB4W group without first being signed-in to Yahoo you do get the usual Yahoo sign-in page?
Richard.
Re: Webcam
Post by Ironman on Jan 15th, 2012, 4:20pm
After clicking your link I get a graphic rich page up with a sign in box on the right.
Re: Webcam
Post by admin on Jan 15th, 2012, 4:25pm
As I can't try 'joining' the BB4W group, I repeated exactly the same steps as you with a group of which I'm not already a member ('beebcontrol').
On clicking Join I immediately received a confirmation page saying 'Membership Pending. Your membership request has been submitted to the group beebcontrol! You will receive a confirmation email when your membership has been approved...".
So everything seems to be working fine at the Yahoo end, as far as I can tell.
Have you disabled any malware scanner which might be trying to 'protect' you from malicious web pages?
Richard. Re: Webcam
Post by Ironman on Jan 15th, 2012, 5:03pm
As far as joining the BB4W group, BB4W comes up as not found but BBC Basic does. I hope this is the correct group. I set Firefox for In Private Browsing but all that does is to suspend saving web history. About disabling anti-virus; I wouldn't like to risk it. I'll have another attempt on my netbook later. Thanks for your replies Richard. Will post again if I have any luck.
Re: Webcam
Post by admin on Jan 15th, 2012, 5:26pm
As far as joining the BB4W group, BB4W comes up as not found but BBC Basic does.
BB4W isn't in the 'public' (searchable) list of groups, to avoid spammers. I gave you direct links in an earlier message, or you can use the Discussion Group link in the BB4W Help menu.
Quote:
About disabling anti-virus; I wouldn't like to risk it.
You may have to, as that's a possible cause. It's not going to do any harm so long as you trust the page you are trying to visit. Virus scanners are a mixed blessing and sometimes have to be (selectively) disabled in my experience.
Richard. Re: Webcam
Post by Ironman on Jan 15th, 2012, 5:40pm
Same thing happened on netbook. I'll give it a last shot on my desktop pc; it has a different anti-virus program than my laptop and netbook, which are both running Avast. The desktop uses AVG. Maybe it has a different attitude towards "risky" sites.
Best Wishes
Michael Re: Webcam
Post by Ironman on Jan 16th, 2012, 5:33pm
Tried joining group this evening on desktop with different anti-virus program by using your link pasted into address bar. Pretty much the same thing happened; white screen and no web page. Will probably give up at this stage. Thanks for your help anyway Richard. Have a pleasant evening. Re: Webcam
Post by admin on Jan 16th, 2012, 9:49pm
Pretty much the same thing happened; white screen and no web page. Will probably give up at this stage.
I suggest contacting your ISP, because just about the only common factor is now your internet connection. Sounds almost as though they have put a block on you accessing that Yahoo page.
Maybe a visit to MacDonalds, or somewhere else with a free WiFi hotspot, is the next step!
Richard.
Re: Webcam
Post by Ironman on Jan 16th, 2012, 10:11pm
I never considered a Big Mac would be the answer. Food for thought (Excuse the pun.) I think I'm about ready to throw the towel in. Thanks for your attention.