Skip to main content

Usb Video Class Device bindings with format conversion tool

Project description

https://img.shields.io/pypi/v/pupil-labs-uvc.svg https://img.shields.io/pypi/pyversions/pupil-labs-uvc.svg 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pupil_labs_uvc-1.0.0-cp311-cp311-win_amd64.whl (996.1 kB view details)

Uploaded CPython 3.11Windows x86-64

pupil_labs_uvc-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pupil_labs_uvc-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl (669.1 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

pupil_labs_uvc-1.0.0-cp310-cp310-win_amd64.whl (996.1 kB view details)

Uploaded CPython 3.10Windows x86-64

pupil_labs_uvc-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

pupil_labs_uvc-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl (669.6 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

pupil_labs_uvc-1.0.0-cp39-cp39-win_amd64.whl (996.8 kB view details)

Uploaded CPython 3.9Windows x86-64

pupil_labs_uvc-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

pupil_labs_uvc-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl (669.7 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pupil_labs_uvc-1.0.0-cp38-cp38-win_amd64.whl (997.1 kB view details)

Uploaded CPython 3.8Windows x86-64

pupil_labs_uvc-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

pupil_labs_uvc-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl (668.4 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pupil_labs_uvc-1.0.0-cp37-cp37m-win_amd64.whl (992.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

pupil_labs_uvc-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

pupil_labs_uvc-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (658.0 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

pupil_labs_uvc-1.0.0-cp36-cp36m-win_amd64.whl (991.3 kB view details)

Uploaded CPython 3.6mWindows x86-64

pupil_labs_uvc-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

pupil_labs_uvc-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl (655.7 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file pupil_labs_uvc-1.0.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0c8e33ec59fcef020bad7ffa081fb88e1cb97dbb1342309834ccec0db93cfb5b
MD5 37d653b67087846ee7c6cb8226bcf61a
BLAKE2b-256 4a91e98c7b7c7d6998173a62f308ac63a0ef3c388b99617ec40563aaca12513a

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6b118690954f4b6903e0b47dc9a8fdb08b2dde89f4f04e632617e38166fa4419
MD5 96e0c5e12694aefa66d55e4afe2dccef
BLAKE2b-256 fff801924022f5d9b4d83594a67a8cd0efe2dacacba7c2a7e69f4d6ecf727dff

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9a869e554a6946626916fba7d37af3397339c1aa5cb95caf3527278fef6107f6
MD5 3f5501fa6cabde9af6dc44f85c502858
BLAKE2b-256 82bb223e6ed1c55c3ec725a073f31d31055f0b9613642ed336fea9b8e26de3fa

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 74c6805e456057fe4f2bb699e8b2680bbb30e3c6da5ba8e7d41ebaedfd6199e3
MD5 19d47a25ee7229caa303232bb1ebd857
BLAKE2b-256 401972b48c38e5d6fd60570f596242b118b487d9f6fd1938f7f61b4ef4863d61

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99559018987ca8cffe22c49cac3585af9035f798c6ff3c804dd72ed2d20116d0
MD5 31f5032a95979e4dac568b58e81680ba
BLAKE2b-256 fb660a3d3d7f264ab784ddf9371f39c06bc8690955285e74fa9041774ad602cb

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a1f7a18553fc6a58cfd593412f8936cccfb4ab3f4e0b7da1a0c5968844280cc6
MD5 879a22e7ac8a43ee7eb44377b8c6be2b
BLAKE2b-256 bf8856cdc1e4b08ff3879edb75b9353541dde27cc854c7a7e95567c91622c822

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c05eef3e643ef0e1440eb255569f70d88f7865bd4a4cff43be8ba011c4fdee79
MD5 6122ed92ddb64ca288c11c953c144f2c
BLAKE2b-256 ddd948693d989652293f4c9a2a5d6b56c60560995110723a7877d1d19835b8c0

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6fcdb0dd33c00fd60b0276011e28799420f12744307ccbf16793c963dfdda22
MD5 aaef69d50d4061e5975d16a834bae3be
BLAKE2b-256 1df9826e91f8f1cb021fddef6abceaa14614769a9d51dc4c9330a5dd0057c965

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6c66b91da21e9e8549978fb3d517b4cb0bac868219edebcb118319a23be36373
MD5 40ef59b7ca94930d81a1b08a8a1d6c26
BLAKE2b-256 5a341bb48f2a4ed6d84b3af23437c8a6d1abb626eb836459901e1577bc23c1e3

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b5408bb49bc6f2d517d39ff2d19c1329ec1fc563978474afe65728312398f8ba
MD5 5ab3690675b26448d039d0e2a1f627e6
BLAKE2b-256 05447970b2c0ccc44495237b421c31fdc704e002ac194afb5e14991cce902b95

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19e2f2083ac9afed3785fbb2e51876fdc4efce4a7b59829d4288e4c1301b58bd
MD5 fcf7feba2d46c987424d0a82c898c3eb
BLAKE2b-256 7048d4a63a0fb3847792ec9cea52c6ef68f6590b5ebb7b1bd1c57eb93bf5b782

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2ce0e145e9157aaff8beb57bc80f432c102a6d4a38672a467068ff9ae9b9b14a
MD5 9ba111673633c12645d1f8687147c042
BLAKE2b-256 9f76ffab4ed34660b0cdb6d719196f1590facbd391908d5015b3ebc154f1f575

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fcffa60c72ede37a165472a0313ca1af6d68e2260078e28599566161f4628c88
MD5 a0deed29d5f791ec20275926e8a356b2
BLAKE2b-256 79c66faeee747528103592294c7753d74e610f9f7fa8af85d7951973147190e6

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e25248ac2aa790741c9da230078a42c5aae5fb2ee1f453aa2f34f317a70bc94c
MD5 640cabc6ed87aaea9a067e19b8101fdd
BLAKE2b-256 99dbf56891ff931f7fa944714560d6197aa274e459b51249a9996dbeffedf603

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 785646c6176d726335ad4e243030203cf12759c1b47bb78a3b1e8dfe87efd792
MD5 3777933d3fcae0eb757224d682ffd863
BLAKE2b-256 a2ac0b053362c1c7d12369d0a3bdfefe471a659b669b4ea3c00230773fdbcbfd

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3adaba7dff4b6bc48cbb93a720facece1cdcea91d5fc15bcfc4ac13b20b2e75d
MD5 db7b4fbf3ccbac10d9ca8e7e07b8671f
BLAKE2b-256 21213d1c825a280459f5e50fd0eb166d7369881b80c5eca341540dae00196dcc

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 741b18e77e7fc680600bb2474e016a9644e48c41ca697add83122daf4139e5ff
MD5 9cda1b5320a99b3dd26297da23b2d153
BLAKE2b-256 903ca8ccb12be841e479c2e92edc8b86b8272889e044bfc4215fe325b9dfa9ae

See more details on using hashes here.

File details

Details for the file pupil_labs_uvc-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pupil_labs_uvc-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a90e4edb18cf9b07745c53a7e6f86583815817762b792fb58196bd0017c6f0de
MD5 e96858ad74e88bad5e4dd4a7325cd30c
BLAKE2b-256 68e0d4aac1955937161270478f747f104698dacbe010525098c9c5ab9ed2b3ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page