Skip to main content

pyusbcameraindex

Identify and select your USB cameras in Python for use with OpenCV.

🚀🤯 Stop guessing the camera index in OpenCV! 🤯🚀

PyPI PyPI - License PyPI - Python Version

PyPI - Downloads GitHub repo size

The pyusbcameraindex package enumerates USB video devices on Windows using DirectShow APIs.

Linux and Mac are not supported, but pull requests are welcome.

Usage:

import cv2
from pyusbcameraindex import enumerate_usb_video_devices_windows

# List the devices.
devices = enumerate_usb_video_devices_windows()
for device in devices:
    print(f"{device.index} == {device.name} (VID: {device.vid}, PID: {device.pid}, Path: {device.path}")

# Show a frame from each.
for device in devices:
    cap = cv2.VideoCapture(device.index, cv2.CAP_DSHOW)
    ret, frame = cap.read()
    cv2.imshow(f"Device={device.name}", frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
    cap.release()
cv2.destroyAllWindows()

Release files for pyusbcameraindex 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyusbcameraindex 1.0.1
File Size Uploaded
pyusbcameraindex-1.0.1.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyusbcameraindex 1.0.1
File Interpreter ABI Platform
pyusbcameraindex-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / pyusbcameraindex-1.0.1.tar.gz

Download URL pyusbcameraindex-1.0.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
88b1c42d7cb98745129f652140264b912f58976b917a6f285872ab9a3d06cd4c
BLAKE2b-256 checksum
How to use checksums
0fdbbe5dbb838328c4bd7d74960f0fb8bc3ab6aea3f4ee3dd2e0578851d36fc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.1 CPython/3.11.9 Windows/10

Release files / pyusbcameraindex-1.0.1-py3-none-any.whl

Download URL pyusbcameraindex-1.0.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3fe457bf6085466912f952b7b9338ae5aed99684cb144fc7b1e591beb83dee8
BLAKE2b-256 checksum
How to use checksums
24fbac5b6197953f21b785b910905906278cfc0b286fda279987a47b03ae30cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.15.1 CPython/3.11.9 Windows/10

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page