I now have this nice and cheap webcam, so I can work and try things out even when I am at home. The package said something like "UVC". That's Universal Video Class, a specific protocol atop of USB which many video devices share. It also had a "MacOS X" sticker on it. This is because UVC is nativly supported by MacOS X which I thought was pretty great. So, I plug in the camera and nothing happens. That's just fine. So I launch "Photo Booth", this silly and totally useless application that shipped with MacOS X and indeed, the camera works. But well, it works quite slow. My trained eyes sense something around five frame per second. I thought this might be because the resolution is too high and the exposure too long so that the camera is not able to provide images that fast. Now the problem was: How can you adjust that camera parameters on a mac? Im used to the windows style: Everywhere you use a camera you can open up that familiar DirectShow configuration panel and adjust whatever you like (or, at least, the camera likes you to like). And even if this fails, there is that neat AMCap that comes with some SDK. Usually you can use that one to adjust everything according to your needs. But it turns out, that there is nothing you can do on your Mac.
So, it looks like as one has to mess with UVC directly to get in charge of their camera on their own. So I started understanding all this USB and UVC stuff, and I have to admit that USB is quite a horrible invention. On my journey I've found some interesting work already done by Dominic (link). He provides you with a small Obj-C class where you can switch the auto-exposure, exposure-time and some other important parameters of the camera. Nevertheless, still QuickTime implements the main UVC parts and provides you with images at a rate which QuickTime decides to be good.
That's why I have started writing my own userland UVC driver. To do everything myself and get full control over the camera. To be able to configure the stupidest details. To get frames really fast. That was the idea. Now i've been coding for quite a while in my little and precious spare time to get this working and I am still quite away from a state which I would consider "stable enough to release". But I'll get this done so I'll set up an own page in the wiki to document my progress (and pressure myself not to waste my spare time with cinema or eating out but coding usb!).
While restructuring my website, the original dedicated page for this project is gone.
2010-02-02 14:10
5 Comments:
anonymous wrote
paulo barcelos wrote
paulo barcelos wrote
zerm wrote
Peter wrote
Comment on this?
2011-07-16 13:16
2011-12-17 01:07
Hey Max,
Did you have any progress with your driver?
I found your comments on http://www.phoboslab.org/log/2009/07/uvc-camera-control-for-mac-os-x?nocache#post and filled my heart with hopes that a driver would be on it's way...
Do you mind sharing the code you've done so far? No problem if it's not stable... If you are interested I can setup a github repo with your code and we could collaborate in the development there.
Well, let me know what you think,
cheers
2011-12-17 01:10
Sorry, I totally missed out this page http://ioctl.eu/blog/2010/03/06/uvc_mac_release. Ignore my last message :)
2011-12-19 10:24
Hey Paulo!
Feel free to work on the code and even set up some github repo - sadly, I am currently unable to continue working on that code since I am quite busy otherwise. I hope though, that the code might help you so far :)
2012-01-12 16:54
There is a copy of the wiki page from September 2010 on Archive.org, which includes a couple interesting points like the code is released under the free zLib-License, and folder uvc contains the uvc.framework, while UVCCap contains a very basic sample application (Cocoa) that uses the framework to render the video stream. Looking at the SVN checkout, there is also a third folder, UVCCap_Old which I think we can ignore.
http://web.archive.org/web/20100925115511/http://ioctl.eu/wiki/uvc_mac