user1988824
user1988824

Reputation: 2957

Camera device on MAC OS

Having my webcam plugged in, I'm able to manipulate the video/audio stream in my MAC OS app. Now I'd like to output it as a new virtual video/audio device that I can select as a camera input in apps like "Skype" or QuickTime.

I've looked into i/o kit framework and the reference webpage says this:

"To add digital video capabilities to your software, use the QuickTime APIs."

I believe this needs to be updated because QuickTime APIs have been replaced by CoreMedia IO.

So I looked into CoreMediaIO and found a sample code from Apple dev website that also is obsolete and won't run on XCode 7.x with OS Yosemite+.

I've also looked in AVFoundation but it seems like a dead end.

I'm lost at this point. I know it's doable since CamTwist software is doing it.

Anyone has an idea how to approach this?

Upvotes: 2

Views: 3444

Answers (2)

Allen
Allen

Reputation: 143

Is your webcam using the old video-digitaizer driver (driver .component file is located in /Library/QuickTime)? I was able to see my UVC-camera and DAL camera in QuickTime player. My understanding is that Apps written in AVFoundation will not recongize old vdig driver. On the contrary, Apps written using Sequence Grabber (very old) / QTCapture (old) will recongize your device.

Hope this helps.

Upvotes: 1

pmdj
pmdj

Reputation: 23428

CoreMediaIO is definitely the way to go, as that's what Apple currently uses in its hardware. On my system (2015 rMBP), /Library/CoreMediaIO/Plug-Ins/DAL/ contains AppleCamera.plugin and iOSScreenCapture.plugin, for the webcam and capturing from iDevice.

I assume the example you're referring to is this one?

It doesn't quite compile out of the box, but I got it to build with the OSX 10.11 SDK eventually. You need Apple's Core Audio Utility Classes, point the 'Sources/Extras/CoreAudio/PublicUtility' group in the Xcode project at those, and then fix a variable initialisation (remove the = NULL where it complains about a private constructor) and comment out a few lines in SamplePrefix.h. I haven't run it, but I see no reason why it wouldn't. If you don't have a kext signing certificate, you may need to take steps to load unsigned kexts to run the sample.

Upvotes: 2

Related Questions