Skip to main content

Windows DirectShow camera enumerator with stable USB location IDs via CfgMgr32

Project description

comgrab3

Windows DirectShow camera enumerator with stable USB location IDs.

Install

pip install comgrab3

Windows only — requires comtypes.

Usage

from comgrab3 import enumerate_cameras, get_usb_location

cams = enumerate_cameras()
for cam in cams:
    print(cam["index"], cam["name"], cam["location_id"])

CLI:

comgrab3

What it returns

Each camera dict contains:

  • index — OpenCV cv2.VideoCapture(index) index
  • name — friendly name (e.g. "USB Camera")
  • device_path — full DirectShow device path
  • location_id — stable USB port location (e.g. PCIROOT(0)#PCI(1400)#USB(0001)#USB(0003))

location_id is stable across reboots as long as the camera stays in the same physical USB port.

Project details


Download files

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

Source Distribution

comgrab3-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

comgrab3-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file comgrab3-1.0.0.tar.gz.

File metadata

  • Download URL: comgrab3-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for comgrab3-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1a749e3573eff232775a1f8ce55742f181530c89aceda0117000db401e339ab4
MD5 8895ed305e29b134f1f820790e8d5785
BLAKE2b-256 6237b0312dd69d6f20c807da1215d118c1a3ef42b72cc93546fc589139c71d66

See more details on using hashes here.

File details

Details for the file comgrab3-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: comgrab3-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for comgrab3-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42dc04974c56d56eeb0a12b88852a38bfe224202f663d2669321a0483753018c
MD5 19921b1a0934d17556ac80972a096962
BLAKE2b-256 eaa932ad357a1511e6a43232c284fe421bdc8d0be982f8d76b62dc4b8705637e

See more details on using hashes here.

Supported by

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