eipipuz
eipipuz

Reputation: 563

How to make a library for the webcam?

I'm learning Factor and I thought it would be great to have a small program to capture images from the webcam that comes with my mac pro. I know every webcam will be very different but sounds like something I should be able to do. I want to create a library with support for Mac, Linux and Windows. The problem is that I'm not sure where to start.

Factor-based answers are welcome but I'm looking for the language agnostic solutio. When I google for it, all I get is programs that capture images. I want to learn how to interact (in the 3 big operative systems) with the drivers I guess.

I think the only clue I have is the ioctl wiki page. How would you start such a project? What kind of google keywords would you use? Books?

Upvotes: 1

Views: 457

Answers (1)

Wodin
Wodin

Reputation: 3528

It's not clear if you want to write a driver for your particular webcam or a library that makes talking to the existing driver easier.

If you want to write a driver for your webcam, you probably want to investigate libusb for Mac and Linux and libusb-win32 for Windows. You would need to understand the protocol that your webcam talks, though. You could probably read the source code for the existing Linux driver (assuming there is one, which is pretty likely).

As for Google search terms, you might try "video capture" and maybe looking for Python/Ruby etc. code or Open Source programs will get you code you can look at to see how to do what you want to do.

Perhaps if you describe in a little more details what you're trying to accomplish someone could give you better suggestions.

Upvotes: 2

Related Questions