Sample code for using mac camera in a program?

前端 未结 6 1225
挽巷
挽巷 2021-02-13 13:06

I\'d like to use the camera in my Macbook in a program. I\'m fairly language agnostic - C, Java, Python etc are all fine. Could anyone suggest the best place to look for documen

6条回答
  •  执笔经年
    2021-02-13 13:50

    If you want to manipulate the camera directly from your code, you must use the QuickTime Capture APIs or the Cocoa QTKit Capture wrapper (much better).

    The only caveat is: if you use a QTCaptureDecompressedVideoOutput, remember that the callbacks aren't made on the main thread, but on the QuickTIme-managed capture thread. Use [someObject performSelectorOnMainThread:... withObject:... waitUntilDone:NO] to send messages to an object on the main thread.

提交回复
热议问题