webcam access

43 views
Skip to first unread message

Tamer Higazi

unread,
May 7, 2013, 2:26:29 PM5/7/13
to wx-u...@googlegroups.com
Hi people!
I am interested to access the webcam. Any ideas which classes at the API
are for me important ?!

And, if any of your have you already done it before, for any support I
kindly thank you.



for any answer of yours, thank you!



Tamer

Eric Jensen

unread,
May 7, 2013, 2:37:27 PM5/7/13
to Tamer Higazi
Hello Tamer,

Tuesday, May 7, 2013, 8:26:29 PM, you wrote:

TH> Hi people!
TH> I am interested to access the webcam. Any ideas which classes at the API
TH> are for me important ?!

there is nothing for this in wxWidgets.

I personally use OpenCV for this. It's a little bit of overkill, but
it's very easy to use. It will be video only though (no audio).

http://docs.opencv.org/

Regards,
Eric

Satz Klauer

unread,
May 8, 2013, 1:25:15 AM5/8/13
to wx-users
OpenCV does provide some functions for accessing a webcam but they are
quite buggy. I found that you can't get the maximum native resolution
of a camera (but always have 640x480 instead) and you can't influence
brightness, contrast and other values. On the other hand you will
depend on quite huge binaries just for this poor functionality.

In case your application is GPLed may be this helps you:
https://git.fedorahosted.org/cgit/OpenAPC.git/tree/plugins/libio_grabimg
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to wx-users+u...@googlegroups.com
> or visit http://groups.google.com/group/wx-users
>
>

Steve Cookson

unread,
May 8, 2013, 5:25:02 AM5/8/13
to wx-u...@googlegroups.com

On Linux you use wxMediactrl. I have it working beautifully.

Look at my earlier posts.

I did have it working on Windows too, but it's a bit painful.

Regards

Steve.

Tamer Higazi

unread,
May 8, 2013, 9:04:25 AM5/8/13
to wx-u...@googlegroups.com
How is it about Windows ???

Am 08.05.2013 11:25, schrieb Steve Cookson:
> On Linux you use wxMediactrl. I have it working beautifully.
>

Tamer

John Labenski

unread,
May 8, 2013, 10:47:24 AM5/8/13
to wx-u...@googlegroups.com
You might be able to use wxVidCap, it supports MSWindows and Linux.

Get the SVN version, works in wx 28 and 29. I recommend using the CMake build.
http://sourceforge.net/p/wxcode/code/HEAD/tree/trunk/wxCode/components/vidcap/

In MSW it uses VideoForWindows (VFW) which is an old API that MS has deprecated, but it still works in Windows 7 at least. Note that the MSW/Linux API is not identical since the MSW port allows saving AVI files and that has not been implemented in Linux.

Regards,
    John




 

stevec...@gmail.com

unread,
May 8, 2013, 1:09:13 PM5/8/13
to wx-u...@googlegroups.com
> How is it about Windows ???

I didn't know about wxVidCap, it sounds good.

However on Linux wxMediaCtrl uses Gstreamer and there *is* a Windows version
of Gstreamer. If you could install this and then use wxMediactrl over it,
it might work.

On Windows I did manage to get it working, again with wxMediaCtrl, after
downloading a number of drivers but there was always a large latency (like a
few seconds).

Good luck.

Regards

Steve

Tamer Higazi

unread,
May 13, 2013, 5:38:31 PM5/13/13
to wx-u...@googlegroups.com
I don't make myself nuts anymore.
I will make use of the "DirectShow" API which is in the Windows 8 SDK
available.

There is for me no need for a cross plattform API. I just fetch the OS
Identifier and write the code for it.


Tamer

John Roberts

unread,
May 13, 2013, 10:57:37 PM5/13/13
to wx-u...@googlegroups.com
On 14/05/2013 5:38 AM, Tamer Higazi wrote:
> I don't make myself nuts anymore.
> I will make use of the "DirectShow" API which is in the Windows 8 SDK
> available.
>
> There is for me no need for a cross plattform API. I just fetch the OS
> Identifier and write the code for it.
>
>
> Tamer
>
You might find the link below of some help. I did use it in a Visual
Basic project a long time ago.
http://www.eztwain.com/eztwain1.htm

Regards, John

John Roberts

unread,
May 13, 2013, 11:32:47 PM5/13/13
to wx-u...@googlegroups.com
Not sure whether this is what you are looking for either but there is
some cross platform hope there.
http://www.twain.org/scanner-application-developers/specification-and-tools.html
John

Satz Klauer

unread,
May 15, 2013, 1:13:58 AM5/15/13
to wx-users
On Mon, May 13, 2013 at 11:38 PM, Tamer Higazi <th9...@googlemail.com> wrote:
> I don't make myself nuts anymore.
> I will make use of the "DirectShow" API which is in the Windows 8 SDK
> available.

Why don't you use the solution from
https://git.fedorahosted.org/cgit/OpenAPC.git/tree/plugins/libio_grabimg
? It already contains working implementations for Directshow and
Video4Linux2.

Tamer Higazi

unread,
May 15, 2013, 3:25:19 PM5/15/13
to wx-u...@googlegroups.com
Hi Satz,
I need Vdeo and recording and sound, does this sollution support it?!


By the way, the DirectShow API doesn't seem to be very difficult. So,
instead of making use of cross libraries, I'll make a sollution for each
plattform's API

Linux GStreamer and Windows Directshow



Tamer

Satz Klauer

unread,
May 16, 2013, 2:41:17 AM5/16/13
to wx-users
Tamer,

this solution seems to capture single images only but you can extend
it easily. Especially the - very complicated to us - DirectShow part
is already there and needs to be changed only slightly for this.

For V4L2 the same is true, there you only need to pick up every frame
that arrives - and sound is delivered via a different channel there in
every case.
Reply all
Reply to author
Forward
0 new messages