Webcam.

Here you can talk about anything related to BBC BASIC, not covered in another category
The Famous Cash
Posts: 2
Joined: Tue 03 Apr 2018, 13:35

Webcam.

Post by The Famous Cash »

I have used the webcam program with escapi.dll for many years in many of my programs. It still works (with old camera) as expected. A number of users of my programs never had any problems, until now.
However, I purchased a new camera (with microphone) recently which works as expected in Zoom and other apps but not in my programs. I think it was purchased on Amazon from THOUGHIGH at £24.99. Instead of displaying live video, the video area appears (green light indicating video should be showing) but is just a solid black background. If a snapshot is taken, it saves the black area.
After receiving help from a kind member, I was going to continue using the old cameras when developing and not bother with my desktop PC problem. Unfortunately, a client has reported the identical problem with one of my programs on his laptop.
Does anyone know of this or know how to solve please?
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: Webcam.

Post by Richard Russell »

The Famous Cash wrote: Tue 11 Mar 2025, 22:32 I have used the webcam program with escapi.dll for many years in many of my programs. It still works (with old camera) as expected. A number of users of my programs never had any problems, until now.
However, I purchased a new camera (with microphone) recently which works as expected in Zoom and other apps but not in my programs.
I haven't looked at this for years, but my recollection is that ESCAPI has been updated in the interim. You might like to try the latest version, although I suspect it's not fully compatible with the one you are using so your code may need to be changed to suit.

There's some sample C code at the ESCAPI website which can probably be translated to BBC BASIC quite easily.
The Famous Cash
Posts: 2
Joined: Tue 03 Apr 2018, 13:35

Re: Webcam.

Post by The Famous Cash »

Many thanks for your help. I have no knowledge of "C" nor any computer language other than BBC BASIC but will see if I can achieve any result.
I'm not sure if it is important but I notice the actual video and capture code (working as always with the older cameras) which you kindly wrote many years ago, includes SYS "LoadLibrary", @lib$+"escapi.dll" TO escapi% at the start and, in the capture section:-
SYS "LoadLibrary","avicap32.dll" TO avicap32%
SYS "GetProcAddress", avicap32%, "capCreateCaptureWindowA" TO `capCreateCaptureWindow`
SYS "GetProcAddress", avicap32%, "capGetDriverDescriptionA" TO `capGetDriverDescription`

Should I solely try to find an updated version of escapi.dll or avicap32.dll also? Is it safe to download these files from "anywhere"?
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: Webcam.

Post by Richard Russell »

The Famous Cash wrote: Wed 12 Mar 2025, 00:53 the actual video and capture code (working as always with the older cameras) which you kindly wrote many years ago, includes
SYS "LoadLibrary","avicap32.dll" TO avicap32%
Oh. I have no recollection of that at all, I had assumed that everything was done using ESCAPI. You could be right that it complicates the transition to a newer version, but in the circumstances I'd be inclined to worry about that only when and if it arises.

I see that the ESCAPI website has two versions available, 2.1 and 3.0. 3.0 is described as being "a complete rewrite" whilst 2.1 is compatible with the older versions. So I'd try 2.1 first, since it will presumably involve fewer changes to your code, but if that still doesn't work try 3.0.

If you need to make code changes you will need some minimal understanding of C, but only sufficient to translate it into BBC BASIC. I believe ESCAPI comes with wrappers for BlitzMax and PureBasic so they might provide some clues too.
Should I solely try to find an updated version of escapi.dll or avicap32.dll also? Is it safe to download these files from "anywhere"?
Especially these days, I'd be very careful where you download anything from! Get ESCAPI directly from its website.