Git Product home page Git Product logo

pyuvc's Introduction

tests Code style: Black https://img.shields.io/badge/skeleton-2022-informational

pyuvc

Python bindings for the Pupil Labs fork of libuvc with super fast jpeg decompression using libjpegturbo (utilizing the tubojpeg api).

  • cross platform access to UVC capture devices.
  • Full access to all uvc settings (Zoom,Focus,Brightness,etc.)
  • Full access to all stream and format parameters (rates,sizes,etc.)
  • Enumerate all capture devices with device_list()
  • Capture instance will always grab mjpeg conpressed frames from cameras.

Image data is returned as Frame object. This object will decompress and convert on the fly when image data is requested. This gives the user the full flexiblity: Grab just the jpeg buffers or have them converted to YUV or Gray or RGB and only when you need.

The Frame class has caching build in to avoid double decompression or conversion.

Install via PyPI

pip install pupil-labs-uvc

Example

See examples/ for code examples.

Install from source

pyuvc requires the following dependencies:

Once the dependencies are installed, you can pip install the source tree:

git clone https://github.com/pupil-labs/pyuvc --recursive
export FORCE_LOCAL_LIBUVC_BUILD=ON
pip install ./pyuvc

Linux

Ubuntu/Debian:

apt-get update -y
apt-get install -y libusb-1.0-0-dev libturbojpeg-dev
Running as a non-root user

One needs to setup udev rules and add the target user to the plugdev group to avoid the privileged access requirement.

echo 'SUBSYSTEM=="usb",  ENV{DEVTYPE}=="usb_device", GROUP="plugdev", MODE="0664"' | sudo tee /etc/udev/rules.d/10-libuvc.rules > /dev/null
sudo udevadm trigger
sudo usermod -a -G plugdev $USER
# logout and back in

macOS

Homebrew:

brew update
brew install libusb jpeg-turbo
Running as a non-root user

Unfortunately, this is currently not possible. See this libusb issue thread for details.

WINDOWS

Run the following code in a powershell to install the dependencies (requires 7z to be installed)

pip install build delvewheel
git clone https://github.com/pupil-labs/pyuvc --recursive
cd pyuvc
scripts/download-deps-win.ps1 -DEPS_TMP_PATH tmp
$Env:DEPS_PATHS_LOC = "tmp/dep_paths.json"
python -m build -w   # will create a wheel in dist/ folder; insert the wheel path below
python scripts/repair-wheels-win.py $Env:DEPS_PATHS_LOC <wheel location> wheelhouse
pip install wheelhouse/<wheel name>
Manual driver installation

pyuvc requires the libUSBk driver to be installed for your corresponding camera. Otherwise, metadata like the product name will be set to "unknown".

Please see these instructions on how to manually install libUSBk drivers for your specific camera.

pyuvc's People

Contributors

abravalheri avatar bhrutledge avatar bjornborg avatar cjmayo avatar cpicanco avatar darkvertex avatar domstoppable avatar dourvaris avatar gmierz avatar hugovk avatar ianphilips avatar jaraco avatar kolanich avatar manasi94 avatar marc-tonsen avatar mkassner avatar ostenh avatar papr avatar patrickfuerst avatar pre-commit-ci[bot] avatar romanroibu avatar webknjaz avatar willpatera avatar wimglenn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyuvc's Issues

[ERROR] uvc : Could not init '...'!

When I run the pupil capture application, I get the following errors:

WORLD Process [ERROR] uvc : Could not init 'Auto Exposure Mode'!
WORLD Process [ERROR] uvc : Could not init 'Auto Exposure Priority'!
WORLD Process [ERROR] uvc : Could not init 'Absolute Exposure Time'!
WORLD Process [ERROR] uvc : Could not init 'Auto Focus'!
WORLD Process [ERROR] uvc : Could not init 'Absolute Focus'!
WORLD Process [ERROR] uvc : Could not init 'Zoom absolute control'!
WORLD Process [ERROR] uvc : Could not init 'Pan control'!
WORLD Process [ERROR] uvc : Could not init 'Tilt control'!
WORLD Process [ERROR] uvc : Could not init 'Backlight Compensation'!
WORLD Process [ERROR] uvc : Could not init 'Brightness'!
WORLD Process [ERROR] uvc : Could not init 'Contrast'!
WORLD Process [ERROR] uvc : Could not init 'Gain'!
WORLD Process [ERROR] uvc : Could not init 'Power Line frequency'!
WORLD Process [ERROR] uvc : Could not init 'Saturation'!
WORLD Process [ERROR] uvc : Could not init 'Sharpness'!
WORLD Process [ERROR] uvc : Could not init 'White Balance temperature'!
WORLD Process [ERROR] uvc : Could not init 'White Balance temperature,Auto'!

I'm on Linux (Fedora), with pyuvc 0.5 (the latest version).

Can you also reproduce that problem?

Won't compile on MacOS Sierra

Hi,

I'm currently trying to install pyuvc using this fork .

Running python setup.y install gives me this error.

wpa-1-211:pyuvc$ python setup.py install
running install
running build
running build_ext
building 'uvc' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c uvc.c -o build/temp.macosx-10.6-intel-2.7/uvc.o
uvc.c:459:10: fatal error: 'libusb-1.0/libusb.h' file not found
#include "libusb-1.0/libusb.h"
         ^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

I couldn't find anything online to help me fix this issue. I'm hoping you guys have some answers. Thank you!

uvc.OpenError

Hi !
I have installed pyuvc after installing libuvc and libjpeg-turbo.
When I try to open the cameras I got this error:

uvc_issue

It seems to detect the 3 cameras but it can't open it.
It is strange because it is working on an other computer. On this computer I can open the 3 cameras and it recognizes them with their name.

Do you know how I can fix it?
Thank you

Calibration Crash (Linux v0.6.20)

Crashes after calibration in most recent release. The terminal log is as follows:

Starting Calibration

Stopping Calibration
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/home/name/Programs/pupil/pupil_src/capture/world.py", line 408, in world
    g_pool.gui.update()
  File "pyglui/ui.pyx", line 136, in pyglui.ui.UI.update (pyglui/ui.c:7741)
  File "pyglui/ui.pyx", line 104, in pyglui.ui.UI.handle_input (pyglui/ui.c:7265)
  File "pyglui/menus.pxi", line 198, in pyglui.ui.Stretching_Menu.handle_input (pyglui/ui.c:33534)
  File "pyglui/menus.pxi", line 202, in pyglui.ui.Stretching_Menu.handle_input (pyglui/ui.c:33388)
  File "pyglui/ui_elements.pxi", line 902, in pyglui.ui.Thumb.handle_input (pyglui/ui.c:27905)
  File "pyglui/ui_elements.pxi", line 924, in pyglui.ui.Thumb.handle_input (pyglui/ui.c:27480)
  File "pyglui/ui.pyx", line 299, in pyglui.ui.Synced_Value.value.__set__ (pyglui/ui.c:42472)
  File "/home/name/Programs/pupil/pupil_src/shared_modules/calibration_routines/natural_features_calibration.py", line 71, in toggle
    self.stop()
  File "/home/name/Programs/pupil/pupil_src/shared_modules/calibration_routines/natural_features_calibration.py", line 91, in stop
    if self.g_pool.binocular:
AttributeError: 'Global_Container' object has no attribute 'binocular'

help wanted to implement c525 sensor features

[{'device_address': 9, 'name': 'HD Webcam C525', 'idVendor': 1133, 'serialNumber': '9D916330', 'bus_number': 1, 'idProduct': 2086, 'uid': '1:9', 'manufacturer': 'unknown'}]
DEBUG:uvc:Found device that mached uid:'1:9'
DEBUG:uvc:Device '1:9' opended.
DEBUG:uvc:avaible video modes: [{'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (640, 480)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (160, 120)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (176, 144)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (320, 176)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (320, 240)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (432, 240)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (352, 288)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (544, 288)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (640, 360)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (752, 416)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (800, 448)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (864, 480)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (960, 544)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1024, 576)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (800, 600)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1184, 656)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (960, 720)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1280, 720)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1392, 768)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1504, 832)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1600, 896)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1280, 960)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1712, 960)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1792, 1008)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1920, 1080)}]
DEBUG:uvc:Adding "Auto Exposure Mode" control.
ERROR:uvc:Could not init 'Auto Exposure Mode'!
DEBUG:uvc:Adding "Auto Exposure Priority" control.
ERROR:uvc:Could not init 'Auto Exposure Priority'!
DEBUG:uvc:Adding "Absolute Exposure Time" control.
ERROR:uvc:Could not init 'Absolute Exposure Time'!
DEBUG:uvc:Adding "Auto Focus" control.
ERROR:uvc:Could not init 'Auto Focus'!
DEBUG:uvc:Adding "Absolute Focus" control.
ERROR:uvc:Could not init 'Absolute Focus'!
DEBUG:uvc:Adding "Zoom absolute control" control.
ERROR:uvc:Could not init 'Zoom absolute control'!
DEBUG:uvc:Adding "Pan control" control.
ERROR:uvc:Could not init 'Pan control'!
DEBUG:uvc:Adding "Tilt control" control.
ERROR:uvc:Could not init 'Tilt control'!
DEBUG:uvc:Adding "Backlight Compensation" control.
ERROR:uvc:Could not init 'Backlight Compensation'!
DEBUG:uvc:Adding "Brightness" control.
ERROR:uvc:Could not init 'Brightness'!
DEBUG:uvc:Adding "Contrast" control.
ERROR:uvc:Could not init 'Contrast'!
HD Webcam C525
Capture device
     device_address:9
     name:HD Webcam C525
     idVendor:1133
     serialNumber:9D916330
     bus_number:1
     idProduct:2086
     uid:1:9
     manufacturer:unknown
DEBUG:uvc:Adding "Gain" control.
ERROR:uvc:Could not init 'Gain'!
DEBUG:uvc:Adding "Power Line frequency" control.
ERROR:uvc:Could not init 'Power Line frequency'!
DEBUG:uvc:Adding "Saturation" control.
ERROR:uvc:Could not init 'Saturation'!
DEBUG:uvc:Adding "Sharpness" control.
ERROR:uvc:Could not init 'Sharpness'!
DEBUG:uvc:Adding "White Balance temperature" control.
ERROR:uvc:Could not init 'White Balance temperature'!
DEBUG:uvc:Adding "White Balance temperature,Auto" control.
ERROR:uvc:Could not init 'White Balance temperature,Auto'!
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 0 times.
DEBUG:uvc:Stream stopped
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
DEBUG:uvc:UVC device closed.

Exception: Could not grab frame. Giving up. c270

[{'device_address': 5, 'name': 'unknown', 'idVendor': 1133, 'serialNumber': '1CEAC320', 'bus_number': 1, 'idProduct': 2085, 'uid': '1:5', 'manufacturer': 'unknown'}]
DEBUG:uvc:Found device that mached uid:'1:5'
DEBUG:uvc:Device '1:5' opended.
DEBUG:uvc:avaible video modes: [{'rates': [30, 25, 20, 15, 10, 5], 'size': (640, 480)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (160, 120)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (176, 144)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (320, 176)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (320, 240)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (352, 288)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (432, 240)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (544, 288)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (640, 360)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (752, 416)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (800, 448)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (800, 600)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (864, 480)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (960, 544)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (960, 720)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (1024, 576)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (1184, 656)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (1280, 720)}, {'rates': [30, 25, 20, 15, 10, 5], 'size': (1280, 960)}]
DEBUG:uvc:Adding "Auto Exposure Mode" control.
DEBUG:uvc:Adding "Auto Exposure Priority" control.
DEBUG:uvc:Adding "Absolute Exposure Time" control.
DEBUG:uvc:Adding "Backlight Compensation" control.
DEBUG:uvc:Adding "Brightness" control.
DEBUG:uvc:Adding "Contrast" control.
DEBUG:uvc:Adding "Gain" control.
DEBUG:uvc:Adding "Power Line frequency" control.
DEBUG:uvc:Adding "Saturation" control.
DEBUG:uvc:Adding "Sharpness" control.
DEBUG:uvc:Adding "White Balance temperature" control.
DEBUG:uvc:Adding "White Balance temperature,Auto" control.
8
1
166
1
128
32
0
2
32
24
4000
1
unknown
Capture device
     device_address:5
     name:unknown
     idVendor:1133
     serialNumber:1CEAC320
     bus_number:1
     idProduct:2085
     uid:1:5
     manufacturer:unknown
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 0 times.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 1 times.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 2 times.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 3 times.
WARNING:uvc:Could not grab frame. Restarting device
DEBUG:uvc:Stream stopped
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 0 times.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 1 times.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 2 times.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 3 times.
WARNING:uvc:Could not grab frame. Restarting device
DEBUG:uvc:Stream stopped
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
Traceback (most recent call last):
  File "/home/rafael/git/pyuvc/example.py", line 23, in <module>
    frame = cap.get_frame_robust()
  File "uvc.pyx", line 500, in uvc.Capture.get_frame_robust (uvc.c:13114)
    raise Exception("Could not grab frame. Giving up.")
Exception: Could not grab frame. Giving up.
DEBUG:uvc:Stream stopped
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
DEBUG:uvc:UVC device closed.

Failure in setup.py install (linker error?)

I am experiencing an error when running setup.py install in a virtual environment under python 3.5 (didn't try outside the virtual env). I have compiled libuvc, including libturbojpeg and both installations didn't report any errors and were done with default arguments. Now I run:

python setup.py install

and I get the following error:

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/uvc.o -lrt -luvc -lturbojpeg -o build/lib.linux-x86_64-3.5/uvc.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

It is unclear to me where this error would come from. I initially thought it might be a permissions problem, but building locally with python setup.py build_ext -i doesn't help and I get the same error.

Thank you for your support.

pyuvc won't compile

Hi, im trying to compile pyuvc.
I get this output:

[root@vision-movil aero]# pip install git+https://github.com/pupil-labs/pyuvc
Collecting git+https://github.com/pupil-labs/pyuvc
  Cloning https://github.com/pupil-labs/pyuvc to /tmp/pip-wbtcvcyo-build
Installing collected packages: uvc
  Running setup.py install for uvc ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-wbtcvcyo-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cnual352-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'uvc' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -I/usr/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c uvc.c -o build/temp.linux-x86_64-3.6/uvc.o
    In file included from /usr/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816,
                     from /usr/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /usr/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from uvc.c:596:
    /usr/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: aviso: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^~~~~~~
    uvc.c: En la función ‘__pyx_f_3uvc_7Capture__start’:
    uvc.c:16159:20: error: demasiados argumentos para la función ‘uvc_stream_start’
       __pyx_v_status = uvc_stream_start(__pyx_v_self->strmh, NULL, NULL, __pyx_v_self->_bandwidth_factor, 0);
                        ^~~~~~~~~~~~~~~~
    In file included from uvc.c:593:
    /usr/include/libuvc/libuvc.h:567:13: nota: se declara aquí
     uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
                 ^~~~~~~~~~~~~~~~
    uvc.c: En la función ‘__pyx_pf_3uvc_7Capture_8get_frame’:
    uvc.c:17331:42: aviso: comparison of integer expressions of different signedness: ‘uint32_t’ {también conocido como ‘unsigned int’} and ‘int’ [-Wsign-compare]
       __pyx_t_8 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
                                              ^~
    uvc.c:17337:43: aviso: comparison of integer expressions of different signedness: ‘uint32_t’ {también conocido como ‘unsigned int’} and ‘int’ [-Wsign-compare]
       __pyx_t_8 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
                                               ^~
    uvc.c: En la función ‘__pyx_f_3uvc_7Capture__enumerate_controls’:
    uvc.c:17500:26: aviso: la asignación descarta el calificador ‘const’ del tipo del destino del puntero [-Wdiscarded-qualifiers]
       __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                              ^
    uvc.c:17509:27: aviso: la asignación descarta el calificador ‘const’ del tipo del destino del puntero [-Wdiscarded-qualifiers]
       __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                               ^
    uvc.c:17518:27: aviso: la asignación descarta el calificador ‘const’ del tipo del destino del puntero [-Wdiscarded-qualifiers]
       __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                               ^
    uvc.c:17527:26: aviso: la asignación descarta el calificador ‘const’ del tipo del destino del puntero [-Wdiscarded-qualifiers]
       __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                              ^
    uvc.c: En la función ‘__pyx_f_3uvc_7Capture__enumerate_formats’:
    uvc.c:18162:23: aviso: la asignación descarta el calificador ‘const’ del tipo del destino del puntero [-Wdiscarded-qualifiers]
       __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                           ^
    En el nivel principal:
    uvc.c:20572:13: aviso: se define ‘__pyx_f_3uvc_on_status_update’ pero no se usa [-Wunused-function]
     static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-wbtcvcyo-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-cnual352-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-wbtcvcyo-build/
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@vision-movil aero]# 

Access to camera settings

Hi,

I am using pyuvc lib in order to access to camera settings. I could not figure it out by myself yet. Can you give some hints for doing this?

Regards,
Guille

windows: 'libusb/libusb.h': No such file or directory

I am triing to install the pupil source code on windows according to.:
https://github.com/pupil-labs/pupil/wiki/Dependencies-Installation-Windows

while installing pyuvc using

$ git clone https://github.com/pupil-labs/pyuvc
$ python setup.py install

libusb seems to be missing (see below). libusb0.dll does exist in /windows/system32 though.

what am i missing?

thanks a lot for your time!

C:\Program Files\pyuvc>python setup.py install
running install
running build
running build_ext
building 'uvc' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\admin\AppData\Local\Programs\Python\Python35\lib\site-packages\numpy\core\include -IC:\work\libjpeg-turbo-VC64\include -IC:\work\libusb -IC:\work\libusb\libusb -IC:\work\libuvc\include -IC:\work\libuvc\bin\include -IC:\Users\admin\AppData\Local\Programs\Python\Python35\include -IC:\Users\admin\AppData\Local\Programs\Python\Python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcuvc.c /Fobuild\temp.win-amd64-3.5\Release\uvc.obj
uvc.c
uvc.c(462): fatal error C1083: Cannot open include file: 'libusb/libusb.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

Please provide wheel for v 0.13

The latest wheel is v 0.11 but pupil requires v >= 0.13. v 0.13 is tagged, but the wheel is not on the release page, and pyuvc is one of the more difficult packages to build because of its dependencies on libusb and libuvc.

Semantic Versioning - `v0.9.1` and not `v0.91` (?)

Shouldn't the version be v0.9.1 and not v0.91?

I have a Windows 10 wheel ready for release - but want to make sure that version number remain consistent and compliant with SemVer before making the release.

The following would need to be changed if this is the case:

And assertion of version would need to be changed in Pupil source code if updated:

mac can't install pyuvc

I'm trying to install the dependencies for mac and I've been following the instructions on the pupil docs, yet I can't install the pyuvc, here is the terminal output after the brew installs...

Marias-MacBook-Air:build mariamihailescu$ git clone https://github.com/pupil-labs/libuvc
Cloning into 'libuvc'...
remote: Enumerating objects: 1059, done.
remote: Total 1059 (delta 0), reused 0 (delta 0), pack-reused 1059
Receiving objects: 100% (1059/1059), 523.21 KiB | 2.07 MiB/s, done.
Resolving deltas: 100% (635/635), done.
Marias-MacBook-Air:build mariamihailescu$ cd libuvc
Marias-MacBook-Air:libuvc mariamihailescu$ mkdir build
Marias-MacBook-Air:libuvc mariamihailescu$ cd build
Marias-MacBook-Air:build mariamihailescu$ cmake ..
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to Release
-- No target type selected, default to shared library
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libusb-1.0'
-- Found libusb-1.0, version 1.0.22
-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

uvc

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/mariamihailescu/libuvc/build/libuvc/build/libuvc/build/libuvc/build
Marias-MacBook-Air:build mariamihailescu$ make && make install
Scanning dependencies of target uvc
[ 11%] Building C object CMakeFiles/uvc.dir/src/ctrl.c.o
[ 22%] Building C object CMakeFiles/uvc.dir/src/ctrl-gen.c.o
[ 33%] Building C object CMakeFiles/uvc.dir/src/device.c.o
[ 44%] Building C object CMakeFiles/uvc.dir/src/diag.c.o
[ 55%] Building C object CMakeFiles/uvc.dir/src/frame.c.o
[ 66%] Building C object CMakeFiles/uvc.dir/src/init.c.o
[ 77%] Building C object CMakeFiles/uvc.dir/src/stream.c.o
/Users/mariamihailescu/libuvc/build/libuvc/build/libuvc/build/libuvc/src/stream.c:479:1: warning:
control reaches end of non-void function [-Wreturn-type]
}
^
/Users/mariamihailescu/libuvc/build/libuvc/build/libuvc/build/libuvc/src/stream.c:530:9: warning:
type specifier missing, defaults to 'int' [-Wimplicit-int]
const first_measure_int = 30 * 30;
~~~~~ ^
2 warnings generated.
[ 88%] Building C object CMakeFiles/uvc.dir/src/misc.c.o
[100%] Linking C shared library libuvc.dylib
[100%] Built target uvc
[100%] Built target uvc
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libuvc.0.0.8.dylib
-- Up-to-date: /usr/local/lib/libuvc.0.dylib
-- Up-to-date: /usr/local/lib/libuvc.dylib
-- Installing: /usr/local/include/libuvc/libuvc.h
-- Installing: /usr/local/include/libuvc/libuvc_config.h
-- Installing: /usr/local/lib/cmake/libuvc/libuvcConfig.cmake
-- Installing: /usr/local/lib/cmake/libuvc/libuvcConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/libuvc/libuvcTargets.cmake
-- Installing: /usr/local/lib/cmake/libuvc/libuvcTargets-release.cmake
-- Installing: /usr/local/lib/pkgconfig/libuvc.pc
Marias-MacBook-Air:build mariamihailescu$ pip3 install PyOpenGL
Requirement already satisfied: PyOpenGL in /usr/local/lib/python3.7/site-packages (3.1.0)
Marias-MacBook-Air:build mariamihailescu$ pip3 install pyzmq
Requirement already satisfied: pyzmq in /usr/local/lib/python3.7/site-packages (17.1.2)
Marias-MacBook-Air:build mariamihailescu$ pip3 install numexpr
Requirement already satisfied: numexpr in /usr/local/lib/python3.7/site-packages (2.6.8)
Requirement already satisfied: numpy>=1.7 in /usr/local/lib/python3.7/site-packages (from numexpr) (1.15.3)
Marias-MacBook-Air:build mariamihailescu$ pip3 install cython
Requirement already satisfied: cython in /usr/local/lib/python3.7/site-packages (0.29)
Marias-MacBook-Air:build mariamihailescu$ pip3 install psutil
Requirement already satisfied: psutil in /usr/local/lib/python3.7/site-packages (5.4.8)
Marias-MacBook-Air:build mariamihailescu$ pip3 install msgpack
Requirement already satisfied: msgpack in /usr/local/lib/python3.7/site-packages (0.5.6)
Marias-MacBook-Air:build mariamihailescu$ pip3 install pyaudio
Requirement already satisfied: pyaudio in /usr/local/lib/python3.7/site-packages (0.2.11)
Marias-MacBook-Air:build mariamihailescu$ pip3 install cysignals
Requirement already satisfied: cysignals in /usr/local/lib/python3.7/site-packages (1.7.2)
Requirement already satisfied: Cython>=0.28 in /usr/local/lib/python3.7/site-packages (from cysignals) (0.29)
Marias-MacBook-Air:build mariamihailescu$ pip3 install git+https://github.com/zeromq/pyre
Collecting git+https://github.com/zeromq/pyre
Cloning https://github.com/zeromq/pyre to /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-r__2dg2h
Requirement already satisfied (use --upgrade to upgrade): pyre==0.3.2 from git+https://github.com/zeromq/pyre in /usr/local/lib/python3.7/site-packages
Requirement already satisfied: pyzmq in /usr/local/lib/python3.7/site-packages (from pyre==0.3.2) (17.1.2)
Requirement already satisfied: ipaddress in /usr/local/lib/python3.7/site-packages (from pyre==0.3.2) (1.0.22)
Building wheels for collected packages: pyre
Running setup.py bdist_wheel for pyre ... done
Stored in directory: /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-ephem-wheel-cache-kj6ixbw2/wheels/9b/0b/64/206d1748773c4708b3bcb11e0a429a6d0e1ef40c8bce622dc7
Successfully built pyre
Marias-MacBook-Air:build mariamihailescu$ pip3 install git+https://github.com/pupil-labs/PyAV
Collecting git+https://github.com/pupil-labs/PyAV
Cloning https://github.com/pupil-labs/PyAV to /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-ekdigjo9
Requirement already satisfied (use --upgrade to upgrade): av==0.4.2.dev0 from git+https://github.com/pupil-labs/PyAV in /usr/local/lib/python3.7/site-packages
Building wheels for collected packages: av
Running setup.py bdist_wheel for av ... done
Stored in directory: /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-ephem-wheel-cache-vizp_oyc/wheels/c7/f1/4c/29c8d78ca3b6ac5474c6f61389edf31ff40d7f2b4e4cbfbb80
Successfully built av
Marias-MacBook-Air:build mariamihailescu$ pip3 install git+https://github.com/pupil-labs/pyuvc
Collecting git+https://github.com/pupil-labs/pyuvc
Cloning https://github.com/pupil-labs/pyuvc to /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6
Building wheels for collected packages: uvc
Running setup.py bdist_wheel for uvc ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-wheel-4t_iyesq --python-tag cp37:
running bdist_wheel
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.12-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.12-x86_64-3.7/uvc.o
In file included from uvc.c:644:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c:16633:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_7 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
uvc.c:16639:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_7 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
uvc.c:16812:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16821:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16830:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16839:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17411:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:19757:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
9 warnings generated.
creating build/lib.macosx-10.12-x86_64-3.7
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.12-x86_64-3.7/uvc.cpython-37m-darwin.so
ld: library not found for -luvc.0.0.7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1


Failed building wheel for uvc
Running setup.py clean for uvc
Failed to build uvc
Installing collected packages: uvc
Running setup.py install for uvc ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-record-r10c7n10/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.12-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.12-x86_64-3.7/uvc.o
In file included from uvc.c:644:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c:16633:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_7 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
uvc.c:16639:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_7 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
uvc.c:16812:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16821:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16830:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:16839:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17411:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:19757:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
9 warnings generated.
creating build/lib.macosx-10.12-x86_64-3.7
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.12-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.12-x86_64-3.7/uvc.cpython-37m-darwin.so
ld: library not found for -luvc.0.0.7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

----------------------------------------

Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-record-r10c7n10/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_s/hyvk6fmd4rlb93n_49ltk_540000gn/T/pip-req-build-e1hoy6t6/

Add to PyPI

The name pyuvc is unused on PyPI - it would be great if you could publish the package there so that this module becomes pip installable

pyuvc on Windows 10 64-bit OpenError

Hi,

I've followed https://github.com/pupil-labs/pyuvc/blob/master/WINDOWS_USER.md and tried out the uvc example code with my See3CAM_CU40 camera. This is what I get:

>>> import uvc
>>> dev_list = uvc.device_list()
>>> print(dev_list)
[{'name': 'unknown', 'manufacturer': 'unknown', 'serialNumber': 'unknown', 'idProduct': 9223, 'idVendor': 5967, 'device_address': 3, 'bus_number': 1, 'uid': '1:3'}, {'name': 'unknown', 'manufacturer': 'unknown', 'serialNumber': 'unknown', 'idProduct': 49472, 'idVendor': 9568, 'device_address': 10, 'bus_number': 1, 'uid': '1:10'}, {'name': 'See3CAM_CU40', 'manufacturer': 'e-con systems', 'serialNumber': '181F9503', 'idProduct': 49472, 'idVendor': 9568, 'device_address': 10, 'bus_number': 1, 'uid': '1:10'}]
>>> cap = uvc.Capture(dev_list[2]['uid'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "uvc.pyx", line 455, in uvc.Capture.__init__
  File "uvc.pyx", line 507, in uvc.Capture._init_device
uvc.OpenError

Similarly, I've tried using libuvc directly. I've followed https://github.com/pupil-labs/libuvc/blob/master/INSTALL_WINDOWS.md. Then tried the below code:

int main()
{

	uvc_context_t *ctx;
	uvc_device_t *dev;
	uvc_device_handle_t *devh;
	uvc_stream_ctrl_t ctrl;
	uvc_error_t res;
	/* Initialize a UVC service context. Libuvc will set up its own libusb
	* context. Replace NULL with a libusb_context pointer to run libuvc
	* from an existing libusb context. */
	res = uvc_init(&ctx, NULL);
	if (res < 0) {
		uvc_perror(res, "uvc_init");
		return res;
	}
	puts("UVC initialized");

	// list_devices(ctx);

	/* Locates the first attached UVC device, stores in dev */
	res = uvc_find_device(
		ctx, &dev,
		0x2560, 0xc140, NULL); /* filter devices: vendor_id, product_id, "serial_num" */
	if (res < 0) {
		uvc_perror(res, "uvc_find_device"); /* no devices found */
	}
	else {
		puts("Device found");
		/* Try to open the device: requires exclusive access */
		res = uvc_open(dev, &devh);
		if (res < 0) {
			uvc_perror(res, "uvc_open"); /* unable to open device */
		}
		else {
			puts("Device opened");
			/* Print out a message containing all the information that libuvc
			* knows about the device */
			uvc_print_diag(devh, stderr);
			/* Try to negotiate a 640x480 30 fps YUYV stream profile */
			res = uvc_get_stream_ctrl_format_size(
				devh, &ctrl, /* result stored in ctrl */
							 // corresponds to 'Y16 '
				UVC_FRAME_FORMAT_GRAY16, /* YUV 422, aka YUV 4:2:2. try _COMPRESSED */
				672, 380, 300 /* width, height, fps */
			);
			/* Print out the result */
			uvc_print_stream_ctrl(&ctrl, stderr);
			if (res < 0) {
				uvc_perror(res, "get_mode"); /* device doesn't provide a matching stream */
			}
			else {
				/* Start the video stream. The library will call user function cb:
				*   cb(frame, (void*) 12345)
				*/
				res = uvc_start_streaming(devh, &ctrl, cb, NULL, 0);
				if (res < 0) {
					uvc_perror(res, "start_streaming"); /* unable to start stream */
				}
				else {
					puts("Streaming...");
					// uvc_set_ae_mode(devh, 1); /* e.g., turn on auto exposure */
#ifdef __unix__
					sleep(3); /* stream for 10 seconds */
#else
					Sleep(3000);
#endif
					/* End the stream. Blocks until last callback is serviced */
					uvc_stop_streaming(devh);
					puts("Done streaming.");
				}
			}
			/* Release our handle on the device */
			uvc_close(devh);
			puts("Device closed");
		}
		/* Release the device descriptor */
		uvc_unref_device(dev);
	}

	/* Close the UVC context. This closes and cleans up any existing device handles,
	* and it closes the libusb context if one was not provided. */
	uvc_exit(ctx);
	puts("UVC exited");

	getchar();

    return 0;
}

I've compiled libusb following https://github.com/pupil-labs/libusb/blob/master/INSTALL_WIN.txt, with ENABLE_DEBUG_LOGGING. Here is what I'm getting when I run the above code:

[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.000000] [00003064] libusb: debug [libusb_init] created default context
[ 0.000000] [00003064] libusb: debug [libusb_init] libusb v1.0.21.11156
[ 0.000000] [00003064] libusb: debug [windows_init] Windows 8 64-bit
[ 0.000000] [00003064] libusb: debug [setup_cancel_io] Will use CancelIoEx for I/O cancellation
[ 0.031215] [00003064] libusb: debug [winusbx_init] using libusbK DLL for universal access
[ 0.031215] [00003064] libusb: debug [winusbx_init] libusbK version: 3.0.7.0
[ 0.046842] [00003064] libusb: debug [winusbx_init] initalized sub API libusbK
[ 0.046842] [00003064] libusb: debug [winusbx_init] initalized sub API libusb0
[ 0.046842] [00003064] libusb: debug [winusbx_init] initalized sub API WinUSB
[ 0.046842] [00003064] libusb: debug [windows_init_clock] hires timer available (Frequency: 2531250 Hz)
[ 0.046842] [00003064] libusb: debug [windows_init_clock] timer thread will run on core #0
[ 0.062469] [00003064] libusb: debug [htab_create] using 1021 entries hash table
[ 0.062469] [00003064] libusb: debug [usbi_add_pollfd] add fd 0 events 1
UVC initialized
[ 0.062469] [00003064] libusb: debug [libusb_get_device_list]
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [91]
[ 0.062469] [00003064] libusb: debug [get_api_type] driver(s): USBHUB3
[ 0.062469] [00003064] libusb: debug [get_api_type] matched driver name against HUB API
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [3D4]
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [B7]
[ 0.062469] [00003064] libusb: debug [init_device] got bus number from ancestor #2
[ 0.062469] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.062469] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 700 bytes)
[ 0.062469] [00003064] libusb: debug [init_device] (bus: 1, addr: 3, depth: 1, port: 4): '\\.\USB#VID_174F&PID_2407#5&3279CB56&0&4'
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [33]
[ 0.062469] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.062469] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 59 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 2, depth: 1, port: 2): '\\.\USB#VID_046D&PID_C52F&MI_00#6&247989BB&0&0000'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [1E7]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 177 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 5, depth: 1, port: 7): '\\.\USB#VID_8087&PID_0A2A#5&3279CB56&0&7'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [2CC]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 59 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 2, depth: 1, port: 2): '\\.\USB#VID_046D&PID_C52F#5&3279CB56&0&2'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] found existing device for session [3D4] (1.0)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 1, depth: 0, port: 0): '\\.\USB#ROOT_HUB30#4&2A97E603&0&0'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] extra GUID: {5CD1E681-C2D8-427D-8AD2-EE2C9B43DA98}
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [3E8]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 373 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 10, depth: 1, port: 14): '\\.\USB#VID_2560&PID_C140&MI_00#6&2887BC08&1&0000'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [232]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 373 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 10, depth: 1, port: 14): '\\.\USB#VID_2560&PID_C140#181F9503'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [F2]
[ 0.093722] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.093722] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 39 bytes)
[ 0.093722] [00003064] libusb: debug [init_device] (bus: 1, addr: 4, depth: 1, port: 5): '\\.\USB#VID_0BDA&PID_0129#20100201396000000'
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] extra GUID: {4BA2D189-D0F3-499B-AAFC-2B5293C627D9}
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): usbccgp
[ 0.093722] [00003064] libusb: debug [get_api_type] matched driver name against Composite API
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [B7] (1.3)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): usbccgp
[ 0.093722] [00003064] libusb: debug [get_api_type] matched driver name against Composite API
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [2CC] (1.2)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): BTHUSB
[ 0.093722] [00003064] libusb: debug [get_api_type] lower filter driver(s): ibtusb
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [1E7] (1.5)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): RTSUER
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [F2] (1.4)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): usbccgp
[ 0.093722] [00003064] libusb: debug [get_api_type] matched driver name against Composite API
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [232] (1.10)
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [2CC]:
[ 0.093722] [00003064] libusb: debug [set_composite_interface] interface[1] = \\.\HID#VID_046D&PID_C52F&MI_01&COL01#7&2246F788&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [2CC]:
[ 0.093722] [00003064] libusb: debug [set_composite_interface] interface[1] already set - ignoring HID collection: \\.\HID#VID_046D&PID_C52F&MI_01&COL02#7&2246F788&0&0001
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [2CC]:
[ 0.109348] [00003064] libusb: debug [set_composite_interface] interface[1] already set - ignoring HID collection: \\.\HID#VID_046D&PID_C52F&MI_01&COL03#7&2246F788&0&0002
[ 0.109348] [00003064] libusb: debug [windows_get_device_list] unlisted ancestor for '\\.\HID#LENOVOVHID#1&632D18&0&0000' (non USB HID, newly connected, etc.) - ignoring
[ 0.109348] [00003064] libusb: debug [get_api_type] driver(s): libusbK
[ 0.109348] [00003064] libusb: debug [get_api_type] matched driver name against libusbK
[ 0.109348] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [232]:
[ 0.109348] [00003064] libusb: debug [set_composite_interface] interface[0] = \\.\USB#VID_2560&PID_C140&MI_00#6&2887BC08&1&0000#{5CD1E681-C2D8-427D-8AD2-EE2C9B43DA98}
[ 0.109348] [00003064] libusb: debug [get_api_type] driver(s): libusbK
[ 0.109348] [00003064] libusb: debug [get_api_type] matched driver name against libusbK
[ 0.109348] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [232]:
[ 0.109348] [00003064] libusb: debug [set_composite_interface] interface[2] = \\.\USB#VID_2560&PID_C140&MI_02#6&2887BC08&1&0002#{4BA2D189-D0F3-499B-AAFC-2B5293C627D9}
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [parse_configuration] skipping descriptor 0xb
[ 0.109348] [00003064] libusb: debug [parse_endpoint] skipping descriptor 25
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.124975] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.124975] [00003064] libusb: debug [parse_configuration] skipping descriptor 0xb
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 25
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.124975] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.140602] [00003064] libusb: debug [parse_configuration] skipping descriptor 0xb
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 25
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.140602] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.140602] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.2
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.5
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.2
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.4
[ 0.140602] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.140602] [00003064] libusb: debug [libusb_open] open 1.3
[ 0.156229] [00003064] libusb: debug [libusb_open] open 1.3 returns -5
[ 0.156229] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.156229] [00003064] libusb: debug [libusb_open] open 1.10
[ 0.156229] [00003064] libusb: debug [unsupported_open] unsupported API call for 'open' (unrecognized device driver)
[ 0.156229] [00003064] libusb: debug [libusb_open] open 1.10 returns -12
[ 0.156229] [00003064] libusb: debug [libusb_unref_device] destroy device 1.3
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.10
Device found
[ 0.171855] [00003064] libusb: debug [libusb_open] open 1.10
[ 0.171855] [00003064] libusb: debug [unsupported_open] unsupported API call for 'open' (unrecognized device driver)
[ 0.171855] [00003064] libusb: debug [libusb_open] open 1.10 returns -12
uvc_open: Not supported (-12)
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.10
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.1
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.0
[ 0.171855] [00003064] libusb: debug [libusb_exit]
[ 0.171855] [00003064] libusb: debug [libusb_exit] destroying default context
[ 0.171855] [00003064] libusb: debug [usbi_remove_pollfd] remove fd 0
[ 0.201649] [000006b4] libusb: debug [windows_clock_gettime_threaded] timer thread quitting
UVC exited

Looks like the same error when trying to use pyuvc.

I've made sure I've installed the libusbK driver with the Zadig program. I've verified my camera appears under "libusbK USB Devices" in the Device Manager.

Any clues please?

feedback ELP-USBFHD01M-L21

ELP-USBFHD01M-L21

This model is running with no bugs (until now), as an eye camera. I am having performance issues with my Intel® Core™ i3 CPU M 370 @ 2.40GHz × 4, 64 bits, and integrated GPU:

#00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller
rafael@B14HM21:~$ lspci -v -s 00:02.0
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18) (prog-if 00 [VGA controller])
    Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer Device 2013
    Flags: bus master, fast devsel, latency 0, IRQ 44
    Memory at fe000000 (64-bit, non-prefetchable) [size=4M]
    Memory at d0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at f080 [size=8]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
    Capabilities: [d0] Power Management version 2
    Capabilities: [a4] PCI Advanced Features
    Kernel driver in use: i915

screenshot from 2015-12-07 13 36 45
screenshot from 2015-12-07 18 36 53

Capture crash

Attempting to use leap motion uvc stream for pupil capture, I get the following error after selecting the leap motion as the source
image

Exception: Can't get stream control: Error:'Mode not supported.' VX-800

[{'device_address': 10, 'name': 'Microsoft LifeCam VX-800', 'idVendor': 1118, 'serialNumber': 'unknown', 'bus_number': 1, 'idProduct': 1894, 'uid': '1:10', 'manufacturer': 'Microsoft'}]
DEBUG:uvc:Found device that mached uid:'1:10'
DEBUG:uvc:Device '1:10' opended.
DEBUG:uvc:avaible video modes: []
DEBUG:uvc:Adding "Auto Exposure Mode" control.
DEBUG:uvc:Adding "Absolute Exposure Time" control.
DEBUG:uvc:Adding "Backlight Compensation" control.
DEBUG:uvc:Adding "Brightness" control.
DEBUG:uvc:Adding "Contrast" control.
DEBUG:uvc:Adding "Gain" control.
DEBUG:uvc:Adding "Power Line frequency" control.
DEBUG:uvc:Adding "Hue" control.
DEBUG:uvc:Adding "Saturation" control.
DEBUG:uvc:Adding "Sharpness" control.
DEBUG:uvc:Adding "Gamma" control.
DEBUG:uvc:Adding "White Balance temperature" control.
DEBUG:uvc:Adding "White Balance temperature,Auto" control.
8
116
1
2
10
34
2
0
4
0
130
6500
1
Microsoft LifeCam VX-800
Capture device
     device_address:10
     name:Microsoft LifeCam VX-800
     idVendor:1118
     serialNumber:unknown
     bus_number:1
     idProduct:1894
     uid:1:10
     manufacturer:Microsoft
Traceback (most recent call last):
  File "/home/rafael/git/pyuvc/example.py", line 23, in <module>
    frame = cap.get_frame_robust()
  File "uvc.pyx", line 493, in uvc.Capture.get_frame_robust (uvc.c:12932)
    frame = self.get_frame()
  File "uvc.pyx", line 508, in uvc.Capture.get_frame (uvc.c:13216)
    self._start()
  File "uvc.pyx", line 464, in uvc.Capture._start (uvc.c:12435)
    self._configure_stream()
  File "uvc.pyx", line 456, in uvc.Capture._configure_stream (uvc.c:12340)
    raise Exception("Can't get stream control: Error:'%s'."%uvc_error_codes[status])
Exception: Can't get stream control: Error:'Mode not supported.'.
DEBUG:uvc:UVC device closed.

Could not get image reading from The Image Source camera

Hi,

I am working on a project to build a stereo camera using two USB industrial cameras (Model DFK 33UX252, The Imaging Source). And I want to use the pyuvc to get the image from camera. However, I have some problems to read the image.

When I run "cap = uvc.Capture(dev_list[0]['uid'])", it appears the error:
ERROR:uvc:Could not init 'White Balance temperature red'! Error: range() arg 3 must not be zero
and the cap.avaible_modes is none. So can not get the image.

I have also tried a webcam from logitech, and it works well.

Thanks so much!

raise InitError("Can't open stream control: Error:'%s'."%uvc_error_codes[status])

I followed exact step given for WINDOWS_USER.
After ran the example, I got the error

raise InitError("Can't open stream control: Error:'%s'."%uvc_error_codes[status])

uvc.InitError

It showed correctly the dev_list and supported format.
However, it won't open the stream.

env:
windows 10
python 3.6.3
webcam: logitech c525

OpenError on Arch

Hello! I've opened an issue for this because I could find little to no information on this error other than a Windows-only fix.
Here is the relevant code:
import uvc
dev_list = uvc.device_list()
print([x['uid'] for x in dev_list])
cam1 = uvc.Capture(dev_list[1]["uid"])
cam2 = uvc.Capture(dev_list[2]['uid'])

Here is the std. out and error message:
['1:3', '1:7', '1:6', '1:5']
Traceback (most recent call last):
File "facialrec_opencv.py", line 108, in <module>
run_feed()
File "facialrec_opencv.py", line 81, in run_feed
cam1 = uvc.Capture(dev_list[1]["uid"])
File "uvc.pyx", line 455, in uvc.Capture.__init__
File "uvc.pyx", line 507, in uvc.Capture._init_device
uvc.OpenError
The last 3 devices in the device_list std. out (1:7, 1:6, 1:5) are pupil labs cameras from the headset. Here they are in output from lsusb:

Bus 001 Device 007: ID 05a3:9230 ARC International Camera
Bus 001 Device 006: ID 05a3:9230 ARC International Camera
Bus 001 Device 005: ID 05a3:9232 ARC International
I'm running Arch Linux, and have compiled pyuvc, libuvc, libjpeg-turbo, and libusb from the pupil-labs repos. I have additionally tried building everything and trying again on a different desktop also running arch, only to get the exact same error. Anything would help, thank you.

unable to receive uncompressed image frames directly from camera

Hi - Is it possible to receive uncompressed (YUYV) image frames directly from cameras instead of converting MJPEG to YUV (jpeg2yuv)?

I have tried below changes in uvc.pyx

In _enumerate_formats()
frame_desc.bDescriptorSubtype == uvc.UVC_VS_FRAME_UNCOMPRESSED

status = uvc.uvc_get_stream_ctrl_format_size( self.devh, &self.ctrl, uvc.UVC_FRAME_FORMAT_UNCOMPRESSED, mode[0],mode[1],mode[2] )

In the received uvc_frame, frame_format(uvc_frame_format) is UVC_FRAME_FORMAT_YUYV which is correct but the frame dump shows it is still an mjpeg frame and jpeg2yuv call also succeeds. Please tell me what am I missing here.

OS - Windows 10, Cameras - USB cameras in Pupil ET addon for Oculus DK2
Camera Device Configuration file attached
camera_configuration.txt

can't compile pyuvc

Hi,
I am setting up dependencies on MacOS, when I run "pip3 install git+https://github.com/pupil-labs/pyuvc", I got error and warnings like the followings.

Collecting git+https://github.com/pupil-labs/pyuvc
Cloning https://github.com/pupil-labs/pyuvc to /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6
Building wheels for collected packages: uvc
Running setup.py bdist_wheel for uvc ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-wheel-n1y2splx --python-tag cp37:
running bdist_wheel
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.13-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.13-x86_64-3.7/uvc.o
In file included from uvc.c:601:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c:17379:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
uvc.c:17385:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
uvc.c:17548:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17557:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17566:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17575:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:18210:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:20620:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
9 warnings generated.
creating build/lib.macosx-10.13-x86_64-3.7
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.13-x86_64-3.7/uvc.cpython-37m-darwin.so
ld: library not found for -luvc.0.0.7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1


Failed building wheel for uvc
Running setup.py clean for uvc
Failed to build uvc
Installing collected packages: uvc
Running setup.py install for uvc ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-record-8aaiej5i/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.13-x86_64-3.7
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c uvc.c -o build/temp.macosx-10.13-x86_64-3.7/uvc.o
In file included from uvc.c:601:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18:
In file included from /usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:
/usr/local/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c:17379:42: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
uvc.c:17385:43: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
__pyx_t_8 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
uvc.c:17548:26: warning: assigning to 'uvc_input_terminal_t *' (aka 'struct uvc_input_terminal *') from 'const uvc_input_terminal_t *' (aka 'const struct uvc_input_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17557:27: warning: assigning to 'uvc_output_terminal_t *' (aka 'struct uvc_output_terminal *') from 'const uvc_output_terminal_t *' (aka 'const struct uvc_output_terminal *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17566:27: warning: assigning to 'uvc_processing_unit_t *' (aka 'struct uvc_processing_unit *') from 'const uvc_processing_unit_t *' (aka 'const struct uvc_processing_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:17575:26: warning: assigning to 'uvc_extension_unit_t *' (aka 'struct uvc_extension_unit *') from 'const uvc_extension_unit_t *' (aka 'const struct uvc_extension_unit *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:18210:23: warning: assigning to 'uvc_format_desc_t *' (aka 'struct uvc_format_desc *') from 'const uvc_format_desc_t *' (aka 'const struct uvc_format_desc *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uvc.c:20620:13: warning: unused function '__pyx_f_3uvc_on_status_update' [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
9 warnings generated.
creating build/lib.macosx-10.13-x86_64-3.7
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.13-x86_64-3.7/uvc.o -L/usr/local/opt/jpeg-turbo/lib/ -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -lturbojpeg -luvc.0.0.7 -o build/lib.macosx-10.13-x86_64-3.7/uvc.cpython-37m-darwin.so
ld: library not found for -luvc.0.0.7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

----------------------------------------

Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-record-8aaiej5i/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1_/jj2z81rx13j94vrbfytr532w0000gn/T/pip-req-build-bi9d7jy6/

By the way I install libuvc from https://github.com/pupil-labs/libuvc. I didn't get this error before until I want to check the version of libuvc since log above said it can't find libuvc.0.0.7. Then I got log below. I am a newbie so hope someone can help. Thank you so much!

naliu@105:/libuvc/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/naliu/libuvc/build
naliu@105:
/libuvc/build$ make && make install
[100%] Built target uvc
[100%] Built target uvc
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /usr/local/lib/libuvc.0.0.8.dylib
CMake Error at cmake_install.cmake:44 (file):
file INSTALL cannot set permissions on "/usr/local/lib/libuvc.0.0.8.dylib"

make: *** [install] Error 1

Exception: Can't get stream control: Error:'Mode not supported.'. USB 2.0 Camera

[{'device_address': 4, 'name': 'USB 2.0 Camera', 'idVendor': 1266, 'serialNumber': 'SN0001', 'bus_number': 2, 'idProduct': 45537, 'uid': '2:4', 'manufacturer': 'Chicony Electronics Co., Ltd.'}]
DEBUG:uvc:Found device that mached uid:'2:4'
DEBUG:uvc:Device '2:4' opended.
DEBUG:uvc:avaible video modes: []
DEBUG:uvc:Adding "Auto Exposure Priority" control.
DEBUG:uvc:Adding "Backlight Compensation" control.
DEBUG:uvc:Adding "Brightness" control.
DEBUG:uvc:Adding "Contrast" control.
DEBUG:uvc:Adding "Power Line frequency" control.
DEBUG:uvc:Adding "Hue" control.
DEBUG:uvc:Adding "Saturation" control.
DEBUG:uvc:Adding "Sharpness" control.
DEBUG:uvc:Adding "Gamma" control.
1
1
18
20
2
0
28
3
100
USB 2.0 Camera
Capture device
     device_address:4
     name:USB 2.0 Camera
     idVendor:1266
     serialNumber:SN0001
     bus_number:2
     idProduct:45537
     uid:2:4
     manufacturer:Chicony Electronics Co., Ltd.
Traceback (most recent call last):
  File "/home/rafael/git/pyuvc/example.py", line 23, in <module>
    frame = cap.get_frame_robust()
  File "uvc.pyx", line 493, in uvc.Capture.get_frame_robust (uvc.c:12932)
    frame = self.get_frame()
  File "uvc.pyx", line 508, in uvc.Capture.get_frame (uvc.c:13216)
    self._start()
  File "uvc.pyx", line 464, in uvc.Capture._start (uvc.c:12435)
    self._configure_stream()
  File "uvc.pyx", line 456, in uvc.Capture._configure_stream (uvc.c:12340)
    raise Exception("Can't get stream control: Error:'%s'."%uvc_error_codes[status])
Exception: Can't get stream control: Error:'Mode not supported.'.
DEBUG:uvc:UVC device closed.

pyuvc on windows

I've modified the code on setup.py in this way

elif platform.system() == 'Windows':
    try:
        tj_lib = 'C:/libjpeg-turbo-gcc/lib/libturbojpeg.a'
    except IndexError:
        raise Exception("Please install libturbojpeg")

I ran python setup.py install (i test locally and globally) from the Visual C++ 2008 64-bit Command Prompt of the python package but it gives me this error:
error_pyuvc

Have you any suggestion? I think is a problem based on the different paths between the Microsoft compiler for VisualStudio and the free version for python...

Can't compile pyuvc

After installing libuvc (git) and fixing include paths, I still can't compile pyuvc (which is exactly what I need for my current opensource 3D scanner project).

gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -I/usr/lib/python2.7/site-packages/numpy/core/include -I/usr/include/libusb-1.0/ -I/usr/include/python2.7 -c uvc.c -o build/temp.linux-x86_64-2.7/uvc.o
In file included from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
                 from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                 from /usr/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from uvc.c:302:
/usr/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " \
  ^~~~~~~
uvc.c: In function '__pyx_f_3uvc_7Capture__start':
uvc.c:13872:20: error: too many arguments to function 'uvc_stream_start'
   __pyx_v_status = uvc_stream_start(__pyx_v_self->strmh, NULL, NULL, __pyx_v_self->_bandwidth_factor, 0);
                    ^~~~~~~~~~~~~~~~
In file included from uvc.c:298:0:
/usr/include/libuvc/libuvc.h:554:13: note: declared here
 uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
             ^~~~~~~~~~~~~~~~
uvc.c: In function '__pyx_f_3uvc_7Capture__enumerate_controls':
uvc.c:14989:26: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                          ^
uvc.c:14998:27: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                           ^
uvc.c:15007:27: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                           ^
uvc.c:15016:26: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                          ^
uvc.c: In function '__pyx_f_3uvc_7Capture__enumerate_formats':
uvc.c:15601:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                       ^
error: command 'gcc' failed with exit status 1

"Can't get stream control: Error:'%s'."%uvc_error_codes[status]

image

raise InitError("Can't get stream control: Error:'%s'."%uvc_error_codes[status])
uvc.InitError

I don't understand why I have this error when I run example.py
I have done the same installation on my Laptop, example.py is working with the integrated webcam, but as soon I want to plug the Headset, I have this error.

I think that the error is coming from this command: frame = cap.get_frame_robust()

Exception: Could not grab frame. Giving up. c920

[{'device_address': 3, 'name': 'HD Pro Webcam C920', 'idVendor': 1133, 'serialNumber': 'ED3E505F', 'bus_number': 2, 'idProduct': 2093, 'uid': '2:3', 'manufacturer': 'unknown'}]
DEBUG:uvc:Found device that mached uid:'2:3'
DEBUG:uvc:Device '2:3' opended.
DEBUG:uvc:avaible video modes: [{'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (640, 480)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (160, 90)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (160, 120)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (176, 144)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (320, 180)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (320, 240)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (352, 288)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (432, 240)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (640, 360)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (800, 448)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (800, 600)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (864, 480)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (960, 720)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1024, 576)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1280, 720)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1600, 896)}, {'rates': [30, 24, 20, 15, 10, 7, 5], 'size': (1920, 1080)}]
DEBUG:uvc:Adding "Auto Exposure Mode" control.
DEBUG:uvc:Adding "Auto Exposure Priority" control.
DEBUG:uvc:Adding "Absolute Exposure Time" control.
DEBUG:uvc:Adding "Auto Focus" control.
DEBUG:uvc:Adding "Absolute Focus" control.
DEBUG:uvc:Adding "Zoom absolute control" control.
DEBUG:uvc:Adding "Pan control" control.
DEBUG:uvc:Adding "Tilt control" control.
DEBUG:uvc:Adding "Backlight Compensation" control.
DEBUG:uvc:Adding "Brightness" control.
DEBUG:uvc:Adding "Contrast" control.
DEBUG:uvc:Adding "Gain" control.
DEBUG:uvc:Adding "Power Line frequency" control.
DEBUG:uvc:Adding "Saturation" control.
DEBUG:uvc:Adding "Sharpness" control.
DEBUG:uvc:Adding "White Balance temperature" control.
DEBUG:uvc:Adding "White Balance temperature,Auto" control.
8
1
250
1
0
100
0
0
0
128
128
0
2
128
128
4000
1
HD Pro Webcam C920
Capture device
     device_address:3
     name:HD Pro Webcam C920
     idVendor:1133
     serialNumber:ED3E505F
     bus_number:2
     idProduct:2093
     uid:2:3
     manufacturer:unknown
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 0 times.
DEBUG:uvc:Could not get Frame. Error: "JPEG header corrupted.". Tried 1 times.
DEBUG:uvc:Could not get Frame. Error: "JPEG header corrupted.". Tried 2 times.
DEBUG:uvc:Could not get Frame. Error: "JPEG header corrupted.". Tried 3 times.
WARNING:uvc:Could not grab frame. Restarting device
DEBUG:uvc:Stream stopped
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
DEBUG:uvc:Could not get Frame. Error: "Operation timed out.". Tried 0 times.
DEBUG:uvc:Could not get Frame. Error: "JPEG header corrupted.". Tried 1 times.
DEBUG:uvc:Could not get Frame. Error: "JPEG header corrupted.". Tried 2 times.
DEBUG:uvc:Could not get Frame. Error: "JPEG header corrupted.". Tried 3 times.
WARNING:uvc:Could not grab frame. Restarting device
DEBUG:uvc:Stream stopped
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
Estimated / selected altsetting bandwith : 309 / 384. 
DEBUG:uvc:Stream start.
Traceback (most recent call last):
  File "/home/rafael/git/pyuvc/example.py", line 23, in <module>
    frame = cap.get_frame_robust()
  File "uvc.pyx", line 500, in uvc.Capture.get_frame_robust (uvc.c:13114)
    raise Exception("Could not grab frame. Giving up.")
Exception: Could not grab frame. Giving up.
ERROR:uvc:Can't stop stream: Error:'Operation timed out.'. Will ignore this and try to continue.
DEBUG:uvc:Stream closed
DEBUG:uvc:Stream stop.
DEBUG:uvc:UVC device closed.

pyuvc wont compile

sudo pip3 install git+https://github.com/pupil-labs/pyuvc
The directory '/home/skellis/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/skellis/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting git+https://github.com/pupil-labs/pyuvc
Cloning https://github.com/pupil-labs/pyuvc to /tmp/pip-_sxtiiuy-build
Installing collected packages: uvc
Running setup.py install for uvc ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-_sxtiiuy-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-w_hs0c2t-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.5m -c uvc.c -o build/temp.linux-x86_64-3.5/uvc.o
In file included from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /usr/lib/python3/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from uvc.c:515:
/usr/lib/python3/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_controls’:
uvc.c:17297:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^
uvc.c:17306:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^
uvc.c:17315:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^
uvc.c:17324:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_formats’:
uvc.c:17962:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^
uvc.c: At top level:
uvc.c:20423:13: warning: ‘__pyx_f_3uvc_on_status_update’ defined but not used [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
creating build/lib.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/uvc.o -lrt -luvc -lturbojpeg -o build/lib.linux-x86_64-3.5/uvc.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-_sxtiiuy-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-w_hs0c2t-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-_sxtiiuy-build/

Can I build pyuvc on Raspberry PI 3?

Hi:

I tried the library quickly on a Raspberry PI, and I got the compilation failed. My initial impression is that the C compiler/libraries on Pi is not the same as the C compiler/library on Ubuntu, and it is much older.

Any idea of changes I can make to build the library on PI and that I can run 16-bit inputs from a camera?

Thanks,

David

"could not initialize" when requesting device_list()

Hi,

I'm trying to run the pupil app in a docker container. I installed libuvc from pupil-labs/libuvc and pyuvc from this repository.
However, I get the following error when running the example:

$ python example.py

ERROR:uvc:could not initialize
None
Traceback (most recent call last):
  File "example.py", line 13, in <module>
    cap = uvc.Capture(dev_list[0]['uid'])
TypeError: 'NoneType' object has no attribute '__getitem__'

The same in the python console:

>>> import logging
>>> import uvc
>>> logger = logging.getLogger('uvc').addHandler(logging.StreamHandler())
>>> devices = uvc.device_list()
could not initialize

The could not initialize error comes from https://github.com/pupil-labs/pyuvc/blob/master/uvc.pyx#L282.

I passed the X socket and the /dev/video* devices to the docker container, so I have no problem viewing the camera image with e.g. vlc:

$ cvlc v4l2:///dev/video1

Might be related to pupil-labs/pupil#157.

Any ideas on this?

capture initialization failed

Hi All,
Just received my Pupil Labs eye tracking camera, seems to have a problem with both the world and eye tracking camera.
Pupil capture environment recognize both the eye tracker and the pupil camera within the selection menu, still I’m getting the following message when I try to choose on of the cameras.
“The camera selected is already in use or blocked.”
Under capture source I can see “capture initialization failed”.

When I try to initiate the eye tracker I receive "init failed. capture started in ghost mode. No images will be supplied".

I’m Working with:

  1. Logitech C920 (interface 2)
  2. Pupil Cam1 ID0 (interface 0)
  3. Running Python 3.5 (64 bit) on windows 10

Tried already -

  1. Updated the latest windows UVC
    https://github.com/pupil-labs/pyuvc/blob/master/WINDOWS_USER.md
    *didn’t find a link for uvc-0.7.2-cp35-cp35m-win_amd64.whl, assumed that this is the relevant one - uvc-0.10-cp35-cp35m-win_amd64.whl

  2. Re-verified that both cameras are working with libusbk drivers under device manager
    image

There were several threads on this issue, but wasn’t solved
pupil-labs/pupil#681
pupil-labs/pupil#603

Any thoughts on this?
Many thanks
Itay

pyuvc not compiled

I have pyhton 3.5, 16.04 Ubuntu system.

I have installed all dependencies required on this page https://github.com/pupil-labs/pyuvc

I tried:
sudo pip3 install git+https://github.com/pupil-labs/pyuvc

I got following error:

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-ce0ft5xj-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-s5_yrcp6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ce0ft5xj-build/

More details in log:

Collecting git+https://github.com/pupil-labs/pyuvc
Cloning https://github.com/pupil-labs/pyuvc to /tmp/pip-ce0ft5xj-build
Installing collected packages: uvc
Running setup.py install for uvc ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-ce0ft5xj-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-s5_yrcp6-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/ics_vr/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -c uvc.c -o build/temp.linux-x86_64-3.5/uvc.o
In file included from /home/ics_vr/.local/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816:0,
from /home/ics_vr/.local/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/ics_vr/.local/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from uvc.c:555:
/home/ics_vr/.local/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_controls’:
uvc.c:17423:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^
uvc.c:17432:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^
uvc.c:17441:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^
uvc.c:17450:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_formats’:
uvc.c:18085:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^
uvc.c: At top level:
uvc.c:20548:13: warning: ‘__pyx_f_3uvc_on_status_update’ defined but not used [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
^
creating build/lib.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/uvc.o -lrt -luvc -lturbojpeg -o build/lib.linux-x86_64-3.5/uvc.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-ce0ft5xj-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-s5_yrcp6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-ce0ft5xj-build/

windows get_sys_time_monotonic vs frame.timestamps have different epoch.

get_sys_time_monotonic
and
timestamps from received frames have different epoch on windows. (posix is fine).

To recreate the issue:

  1. start capture and set world capture to fake image (this generates frames that use uvc.get_sys_time_monotonic )
  2. record world and eye video.
  3. compare timestamps

They should start at roughly the same time.

Dataset recorded by @papr on windows using v1.1 bundle shows this is not the case.

doesn't enumerate v4l2loopback device

I'm using v4l2loopback to send video across application.

I have :

$ v4l2-ctl --list-device
Laptop_Integrated_Webcam_2HDM (usb-0000:00:1a.0-1.4):
        /dev/video0

Dummy video device (0x0000) (v4l2loopback:0):
        /dev/video1

Dummy video device (0x0001) (v4l2loopback:1):
        /dev/video2

and I can open and view the stream in VLC (on /dev/video1)

but example.py doesn't enumerates v4l2loopback devices.
Here is the log.

How can I use v4l2loopback device with pyuvc ?

The stream comes from a raspberry pi over the lan, and gstreamer push it on v4l2loopback device.
That works but I would like to access the stream in Python.

PyUVC won't compile for Ubuntu 16.04...

Here's the command...
pip install git+https://github.com/pupil-labs/pyuvc.git

Here are my error messages. :( I've tried looking through previous issues with similar problems, but I've tried for hours and can't get this package to compile.

  Cloning https://github.com/pupil-labs/pyuvc.git to /tmp/pip-zi4fzzwb-build
Installing collected packages: uvc
  Running setup.py install for uvc ... error
    Complete output from command /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-zi4fzzwb-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qdusoti6-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'uvc' extension
    creating build
    creating build/temp.linux-x86_64-3.6
    gcc -pthread -B /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib/python3.6/site-packages/numpy/core/include -I/home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/include/python3.6m -c uvc.c -o build/temp.linux-x86_64-3.6/uvc.o
    In file included from /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1809:0,
                     from /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from uvc.c:547:
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^
    uvc.c: In function ‘__pyx_pf_3uvc_7Capture_8get_frame’:
    uvc.c:17239:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       __pyx_t_8 = ((__pyx_v_uvc_frame->width == __pyx_v_j_width) != 0);
                                              ^
    uvc.c:17245:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       __pyx_t_8 = ((__pyx_v_uvc_frame->height == __pyx_v_j_height) != 0);
                                               ^
    uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_controls’:
    uvc.c:17408:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                              ^
    uvc.c:17417:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                               ^
    uvc.c:17426:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                               ^
    uvc.c:17435:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                              ^
    uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_formats’:
    uvc.c:18070:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                           ^
    uvc.c: At top level:
    uvc.c:20533:13: warning: ‘__pyx_f_3uvc_on_status_update’ defined but not used [-Wunused-function]
     static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
                 ^
    creating build/lib.linux-x86_64-3.6
    gcc -pthread -shared -B /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat -L/home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib -Wl,-rpath=/home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib,--no-as-needed build/temp.linux-x86_64-3.6/uvc.o -L/home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/lib -lrt -luvc -lturbojpeg -lpython3.6m -o build/lib.linux-x86_64-3.6/uvc.cpython-36m-x86_64-linux-gnu.so
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-transupp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdatadst-tj.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdatasrc-tj.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcapimin.o): relocation R_X86_64_32S against symbol `jpeg_natural_order' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jccolor.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcmainct.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcmarker.o): relocation R_X86_64_32 against symbol `jpeg_natural_order' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcmaster.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcparam.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcphuff.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcprepct.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcsample.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jctrans.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdapimin.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdinput.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdmarker.o): relocation R_X86_64_32S against symbol `jpeg_natural_order' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdmaster.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdmerge.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdphuff.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdpostct.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdsample.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jerror.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jquant1.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jquant2.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jmemmgr.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcarith.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdarith.o): relocation R_X86_64_32S against symbol `jpeg_aritab' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jccoefct.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jcdctmgr.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jchuff.o): relocation R_X86_64_32 against symbol `jpeg_natural_order' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdcoefct.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdcolor.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jddctmgr.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdhuff.o): relocation R_X86_64_32S against symbol `jpeg_natural_order' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-jdmainct.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
    /home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/compiler_compat/ld: final link failed: Nonrepresentable section on output
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/home/peter-lee/ComputerScience/Academics/Berkeley/Research/BDD/.miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-zi4fzzwb-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qdusoti6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-zi4fzzwb-build/

Cannot acquire images from dual cameras

Hi,
I'm using your pyuvc python module to get images from two cameras. I set bandwidth_factor=2. The code is working fine when I run it for 5 times. After again I tried run, it is showing the below error:
I checked the uvc.pyx code line mentioned below and the line 547 says "isochronous stream error". One camera is working fine but I'm not able to acquire images from another.How to solve this error?

Traceback (most recent call last):
File "eff2.py", line 54, in
frame = cap.get_frame_robust()
File "uvc.pyx", line 572, in uvc.Capture.get_frame_robust (uvc.c:15904)
File "uvc.pyx", line 588, in uvc.Capture.get_frame (uvc.c:16341)
File "uvc.pyx", line 547, in uvc.Capture._start (uvc.c:15455)
uvc.InitError

I appreciate your help.
Thanks.

Imposible to import uvc after having install it regarding README.md

I can't import uvc.
If I try to run from the terminal I have this error: ImportError: No module named uvc.

I installed libuvc and libjpeg-turbo like it is explained. Do I need to do anything else? Do I need to clone this repo? I am lost

I am using Python 2.7

Thank you

ImportError after fresh install

I've just installed pyuvc with all listed dependencies and I'm stuck at this error:

[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uvc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/libuvc.so.0: undefined symbol: libusb_handle_events_completed

I've already tried reinstalling libuvc but with no luck

help wanted to implement c615 sensor features

Good news for me, I think. Since the v4.6 the Logitech C615 loads succesfully, but without some sensor features.

WORLD Process [ERROR] uvc : Could not init 'Auto Exposure Mode'!
WORLD Process [ERROR] uvc : Could not init 'Auto Exposure Priority'!
WORLD Process [ERROR] uvc : Could not init 'Absolute Exposure Time'!
WORLD Process [ERROR] uvc : Could not init 'Auto Focus'!
WORLD Process [ERROR] uvc : Could not init 'Absolute Focus'!
WORLD Process [ERROR] uvc : Could not init 'Zoom absolute control'!
WORLD Process [ERROR] uvc : Could not init 'Pan control'!
WORLD Process [ERROR] uvc : Could not init 'Tilt control'!
WORLD Process [ERROR] uvc : Could not init 'Backlight Compensation'!
WORLD Process [ERROR] uvc : Could not init 'Brightness'!
WORLD Process [ERROR] uvc : Could not init 'Contrast'!
WORLD Process [ERROR] uvc : Could not init 'Gain'!
WORLD Process [ERROR] uvc : Could not init 'Power Line frequency'!
WORLD Process [ERROR] uvc : Could not init 'Saturation'!
WORLD Process [ERROR] uvc : Could not init 'Sharpness'!
WORLD Process [ERROR] uvc : Could not init 'White Balance temperature'!
WORLD Process [ERROR] uvc : Could not init 'White Balance temperature,Auto'!

One should be able to choose the frame rate thought.

I have no idea how to begin :) would appreciate some help.

can't install pyuvc

After installing libuvc from pupil-labs github, I can't install pyuvc

python3 setup.py install

Compiling uvc.pyx because it changed.
[1/1] Cythonizing uvc.pyx
running install
running build
running build_ext
building 'uvc' extension
creating build
creating build/temp.macosx-10.13-x86_64-3.6
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/lib/python3.6/site-packages/numpy/core/include -I/usr/local/opt/jpeg-turbo/include/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c uvc.c -o build/temp.macosx-10.13-x86_64-3.6/uvc.o uvc.c:556:10: fatal error: 'libuvc/libuvc.h' file not found #include "libuvc/libuvc.h" ^~~~~~~~~~~~~~~~~ 1 error generated. error: command 'clang' failed with exit status 1

libuvc/libuvc.h is in

/Users/chalgand/libuvc/build/include

Cannot install last version of pyuvc on Linux Mint 18 with Python 3.5

I have installed the specified fork of libuvc and libjpeg-turbo-1.5.1, however, when I try to run
sudo -H pip3 install git+https://github.com/pupil-labs/pyuvc

I get

Collecting git+https://github.com/pupil-labs/pyuvc
  Cloning https://github.com/pupil-labs/pyuvc to /tmp/pip-gacfscrv-build
Installing collected packages: uvc
  Running setup.py install for uvc ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-gacfscrv-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xpii6a94-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'uvc' extension
    creating build
    creating build/temp.linux-x86_64-3.5
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python3/dist-packages/numpy/core/include -I/usr/include/python3.5m -c uvc.c -o build/temp.linux-x86_64-3.5/uvc.o
    In file included from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
                     from /usr/lib/python3/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
                     from /usr/lib/python3/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from uvc.c:461:
    /usr/lib/python3/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it by " \
      ^
    uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_controls’:
    uvc.c:16709:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
                              ^
    uvc.c:16718:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
                               ^
    uvc.c:16727:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
                               ^
    uvc.c:16736:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
                              ^
    uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_formats’:
    uvc.c:17374:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       __pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
                           ^
    uvc.c: At top level:
    uvc.c:19728:13: warning: ‘__pyx_f_3uvc_on_status_update’ defined but not used [-Wunused-function]
     static void __pyx_f_3uvc_on_status_update(CYTHON_UNUSED enum uvc_status_class __pyx_v_status_class, CYTHON_UNUSED int __pyx_v_event, CYTHON_UNUSED int __pyx_v_selector, CYTHON_UNUSED enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__pyx_v_data, CYTHON_UNUSED size_t __pyx_v_data_len, CYTHON_UNUSED void *__pyx_v_user_ptr) {
                 ^
    creating build/lib.linux-x86_64-3.5
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/uvc.o -lrt -luvc -lturbojpeg -o build/lib.linux-x86_64-3.5/uvc.cpython-35m-x86_64-linux-gnu.so
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
    /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libturbojpeg.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-gacfscrv-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xpii6a94-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-gacfscrv-build/
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Also I noticed it uses the pip from python2 (which has version 8.1.1) instead of pip3, which is up-to-date:
pip3 --version
pip 9.0.1 from /home//.local/lib/python3.5/site-packages (python 3.5)

opening pupil IR cameras

Hi, when I run (basically) the example code in the README:

import uvc
import logging
import cv2
logging.basicConfig(level=logging.INFO)

dev_list =  uvc.device_list()
print( dev_list)
cap = uvc.Capture(dev_list[0]['uid'])
print (cap.avaible_modes)
# cap.print_info()


cap.frame_mode = (400,400,60)
cap.frame_rate = 60
cap.frame_size = (400,400)
cap.bandwidth_factor = 1.3

while True:
    frame = cap.get_frame_robust()
    # frame =cap.get_frame()
    # print( frame.img.shape)
    cv2.imshow("img",frame.img)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap = None

with the connected pupil 200 Hz IR cameras I only get a black screen. What am I missing?

pyuvc only python2 compatible?

Looks like pyuvc is a bit old????

jiapei:pyuvc$ sudo python setup.py install
running install
running build
running build_ext
building 'uvc' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/numpy/core/include -I/usr/include -I/usr/include/python3.5m -c uvc.c -o build/temp.linux-x86_64-3.5/uvc.o
In file included from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,
from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from uvc.c:311:
/usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by "
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__start’:
uvc.c:12774:20: error: too many arguments to function ‘uvc_stream_start’
__pyx_v_status = uvc_stream_start(__pyx_v_self->strmh, NULL, NULL, __pyx_v_self->_bandwidth_factor, 0);
^
In file included from uvc.c:307:0:
/usr/local/include/libuvc/libuvc.h:554:13: note: declared here
uvc_error_t uvc_stream_start(uvc_stream_handle_t *strmh,
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_controls’:
uvc.c:13891:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_input_terminal = uvc_get_input_terminals(__pyx_v_self->devh);
^
uvc.c:13900:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_output_terminal = uvc_get_output_terminals(__pyx_v_self->devh);
^
uvc.c:13909:27: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_processing_unit = uvc_get_processing_units(__pyx_v_self->devh);
^
uvc.c:13918:26: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_extension_unit = uvc_get_extension_units(__pyx_v_self->devh);
^
uvc.c: In function ‘__pyx_f_3uvc_7Capture__enumerate_formats’:
uvc.c:14503:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_format_desc = uvc_get_format_descs(__pyx_v_self->devh);
^
In file included from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/ndarrayobject.h:27:0,
from /usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
from uvc.c:311:
uvc.c: At top level:
/usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/__multiarray_api.h:1448:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
_import_array(void)
^
uvc.c:16589:13: warning: ‘__pyx_f_3uvc_on_status_update’ defined but not used [-Wunused-function]
static void __pyx_f_3uvc_on_status_update(enum uvc_status_class __pyx_v_status_class, int __pyx_v_event, int __pyx_v_selector, enum uvc_status_attribute __pyx_v_status_attribute, CYTHON_UNUSED void *__py
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
jiapei:pyuvc$

Cheers
Pei

For Mac OS X installation, add note to install libusb, cmake

I just helped a friend get this installed and we noticed that we couldn't make libuvc build without first installing libusb with brew install libusb.

Also we had to install cmake with brew install cmake.

So maybe add a note in the readme to

brew install cmake
brew install libusb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.