Python bindings for 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.
See example.py
for an code example.
git clone https://github.com/pupil-labs/libuvc
cd libuvc
mkdir build
cd build
cmake ..
make && sudo make install
sudo ldconfig
wget -O libjpeg-turbo.tar.gz https://sourceforge.net/projects/libjpeg-turbo/files/1.5.1/libjpeg-turbo-1.5.1.tar.gz/download
tar xvzf libjpeg-turbo.tar.gz
cd libjpeg-turbo-1.5.1
./configure --with-pic --prefix=/usr/local
sudo make install
sudo ldconfig
sudo pip install cython
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
git clone https://github.com/pupil-labs/libuvc
cd libuvc
mkdir build
cd build
cmake ..
make && sudo make install
brew install libjpeg-turbo
pip install cython
pip install numpy
python setup.py build_ext -i
python setup.py install
Please have a look at WINDOWS_USER.md for install instructions if you want to use PYUVC. Please have a look at WINDOWS_DEVELOER.md for install instructions if you want to modify PYUVC.