openpnp / openpnp-capture

A cross platform video capture library with a focus on machine vision.
MIT License
118 stars 49 forks source link

Test fails for built-in Macbook Pro webcamera #26

Closed sampepose closed 5 years ago

sampepose commented 6 years ago

It cannot create a UVC control object for the built-in webcamera on my Macbook Pro (High Sierra):

==============================
 OpenPNP Capture Test Program
 OSX 64 bit debug HEAD-HASH-NOTFOUND Mar 26 2018 
==============================
Usage: openpnp-capture-test <camera ID> <frame format ID>

..continuing with default camera parameters.

[DBG ] Platform context created
[DBG ] enumerateDevices called
[DBG ] Name : FaceTime HD Camera (Apple Inc.)
[DBG ] Model: UVC Camera VendorID_1452 ProductID_34304
[DBG ] U ID : FaceTime HD Camera (Apple Inc.) 0x1420000005ac8600
[DBG ] USB      : vid=05AC  pid=8600
[DBG ] Location : 14200000
Number of devices: 1
ID 0 -> FaceTime HD Camera (Apple Inc.)
Unique:  FaceTime HD Camera (Apple Inc.) 0x1420000005ac8600
  Number of formats: 4
  Format ID 0: 640 x 480 pixels  30 FPS(max)  FOURCC=2vuy
  Format ID 1: 1280 x 720 pixels  30 FPS(max)  FOURCC=2vuy
  Format ID 2: 640 x 480 pixels  30 FPS(max)  FOURCC=420v
  Format ID 3: 1280 x 720 pixels  30 FPS(max)  FOURCC=420v
[DBG ] Setup for capture format (640 x 480)...
[DBG ] UVCCtrl::findDevice() called
[DBG ] UVCCtrl::findDevice() Camera control error -536870210
[DBG ] Could not create a UVC control object! -- settings will not be available!
[DBG ] FOURCC = 2vuy
Stream ID = 0
Stream is open
Failed to get exposure limits!
Failed to get exposure!
Failed to get auto exposure!
Captured frames: 1
Captured frames: 2
Captured frames: 3
Captured frames: 4
Captured frames: 5
Captured frames: 6
Captured frames: 7
Captured frames: 8
Captured frames: 9
Captured frames: 10
Captured frames: 11
Captured frames: 12
Captured frames: 13
Captured frames: 14
Captured frames: 15
Captured frames: 16
Captured frames: 17
Captured frames: 18
Captured frames: 19
Captured frames: 20
Captured frames: 21
Captured frames: 22
Captured frames: 23
Captured frames: 24
Captured frames: 25
Captured frames: 26
Captured frames: 27
Captured frames: 28
Captured frames: 29
Captured frames: 30

[INFO] closing stream
[DBG ] Stream::~Stream reports 34 frames captured.
[DBG ] Platform context destroyed
[DBG ] m_captureDevice released
[DBG ] Context destroyed
trcwm commented 6 years ago

Hi Sam,

Thanks for your report!

The Built-in Apple iSight camera has a very minimal USB UVC implementation. As a result, OSX cannot create a proper USB control interface for it and OpenPNP-capture will complain. OSX reports error 0xE00002BE (-536870210), which is IOKIT error 'Unable to create plug in interface for USB device'.

As you can see from the output, the library is still able to capture images, although it has no control over the camera's image properties. This is a know issue which cannot be fixed unless Apple changes their USB interface/driver for the iSight cameras.

The openpnp-capture library was primarily written for pick&place machines and generic USB cameras. Are your requirements much different?

Regards, Niels.

vonnieda commented 5 years ago

Closing this as it's a limitation of the camera, not the library. For what it's worth, my FaceTime camera is the same.