Enumerate / List / Find / Detect / Search index for opencv VideoCapture.
Project description
cv2_enumerate_cameras
Installation
Install from PyPI
pip install cv2_enumerate_cameras
Install from Source
pip install git+https://github.com/chinaheyu/cv2_enumerate_cameras.git
Example
Run as Script
python -m cv2_enumerate_cameras
Enumerate Cameras
import cv2
from cv2_enumerate_cameras import enumerate_cameras
for camera_info in enumerate_cameras(cv2.CAP_MSMF):
print(f'{camera_info.index}: {camera_info.name}')
Output:
0: HD Webcam
...
Camera Info
The cv2_enumerate_cameras.enumerate_cameras() function will return a list of CameraInfo objects.
CameraInfo.index: Camera index for creatingcv2.VideoCaptureCameraInfo.name: Camera nameCameraInfo.path: Camera device pathCameraInfo.vid: Vendor identifierCameraInfo.pid: Product identifier
Find Camera by Vendor and Product Identifier
import cv2
from cv2_enumerate_cameras import enumerate_cameras
def find_camera(vid, pid, apiPreference=cv2.CAP_MSMF):
for i in enumerate_cameras(apiPreference):
if i.vid == vid and i.pid == pid:
return cv2.VideoCapture(i.index, apiPreference)
return None
cap = find_camera(0x04F2, 0xB711)
while True:
result, frame = cap.read()
if not result:
break
cv2.imshow('frame', frame)
if cv2.waitKey(1) == ord('q'):
break
TODO
- Windows Support
- Linux Support
- MacOS Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cv2_enumerate_cameras-1.1.5.tar.gz.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5.tar.gz
- Upload date:
- Size: 40.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2340c79f69be3f993c3ffd7f555de3ff9b6b3e1e65e31bf182c4f48cdca31089
|
|
| MD5 |
d7adde3646dec7e9d9b85e07cffae94e
|
|
| BLAKE2b-256 |
ed8688215bf649382a5e0169ba62aa93eb7683905b42a163cf3066cd87e5cabf
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-pp310-pypy310_pp73-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-pp310-pypy310_pp73-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646574784d130600d51a97b59d19100777adcc153d4d55f963a8760177b07fb4
|
|
| MD5 |
da8b05799750c980c8be4bca2bbe8bcb
|
|
| BLAKE2b-256 |
ccd455c6fd91bce0d2ffe7f7afa35497bb87f1d0730e436ddf41a1969ea54c17
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-pp39-pypy39_pp73-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-pp39-pypy39_pp73-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa81557ce637b3c4a6ad7cfa3ef47d3817a43f26e4be64bbe27f3204d04b9ed8
|
|
| MD5 |
fad96fec8c98e4a98f7872b2daa0b414
|
|
| BLAKE2b-256 |
ab6e3298795b3ee12bf3d36fc117b813a08b26c898e209e2bb78abacdea90350
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-pp38-pypy38_pp73-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-pp38-pypy38_pp73-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae9b62387254a87c51c7ceddf4b43f68b96cfa58882b726ae435b3d22ae9bb48
|
|
| MD5 |
967723b6f7f7f0df090daf5ab5dbe4a5
|
|
| BLAKE2b-256 |
5d9e28f6fbdc67a297fde2a2f6506af61a0af7a268ac3066241f3c2271a8f30b
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-pp37-pypy37_pp73-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-pp37-pypy37_pp73-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5a7974eaead7df2b7099e665ed69271784b4bfebc23715060aeecdcdf168b50
|
|
| MD5 |
2b6c86a7a366a1b8e69369e747a7cc35
|
|
| BLAKE2b-256 |
605848b8d9573b88b53ef2132f438d9a7d7635c9cd4d84204d76cc2e9d7d969f
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3f1ead4fc393e0284d7438e85fb77b324d647e09d773519d4793059d82b639b
|
|
| MD5 |
56d515063ec17671aa45e07c524f353e
|
|
| BLAKE2b-256 |
9586cfe8362a25800f565b1d52a63c296728a1707d828ff306348c554beede69
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp312-cp312-win32.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp312-cp312-win32.whl
- Upload date:
- Size: 37.3 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
165269e11592ab1c96203d43a49c789d7a4224bf18352c56f30e2bea8e946779
|
|
| MD5 |
85e09a7a64c1c3d4ed2f0b074e68f9fe
|
|
| BLAKE2b-256 |
4b666a0a327f47c28ca9a71f28a36ee8dea088efbebc64be396be3be6add4eab
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db700296d3198a7af1e382b2223d25c1d64e4834987f2cb80394faf4228df00
|
|
| MD5 |
8c3b40850fc2150015d72ae09960bc0a
|
|
| BLAKE2b-256 |
6f50d921282658e14f144065a17696a6cbec24349978606de861037eb8e3c453
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp311-cp311-win32.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp311-cp311-win32.whl
- Upload date:
- Size: 37.3 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4fffc77bd9588c356d9608ae4cac93b4cceb7deb19f0ef764f6aade5588f393
|
|
| MD5 |
6761e156a7bf02c7742a9c5602552047
|
|
| BLAKE2b-256 |
565a6aab5fb5a10efabe05f25d75313064b5e082a8e7a70dc0ed3053b12e7074
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70f3f0ba6c0499cd6ed9422f2dcca0f903acd6c77571e08fad299ca106825d8b
|
|
| MD5 |
6014c142cf6373d3dcd5180ce726e5ec
|
|
| BLAKE2b-256 |
e091aad39f046e75f90bef5245db9e60be0f82b41eb11d460701b8dfa5795abe
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp310-cp310-win32.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp310-cp310-win32.whl
- Upload date:
- Size: 37.3 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
000ac2e94ad2e6d397b4f496f0997fedb1e20df14fae75af618e47ed6bbbfc9c
|
|
| MD5 |
0092f387a39d96a609d462c7f28c6cd2
|
|
| BLAKE2b-256 |
e4b44c7c9cfc825f983edeb3ffa86b31516868a429315a0e6b483900e5f62f65
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17c21a23d9b2af57707b6c3908524c61e63a564fd7ef69ce850019a52da4d7b1
|
|
| MD5 |
fa11b07412c1af3df2737a82427612f5
|
|
| BLAKE2b-256 |
db7ae3eb6db6ad38277be273c7d6b90183cdafceccd62dd644c5c573afb4653c
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp39-cp39-win32.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp39-cp39-win32.whl
- Upload date:
- Size: 37.3 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e4b46020a8ec9a28d1e3336fa1e58a2628767c98a0efd8fb04c2ad705062e0f
|
|
| MD5 |
9dbcb981ffef4a42140a1c52a2df3df2
|
|
| BLAKE2b-256 |
876c1df244bdcabf6ea3947f158ab6d4759cb9016d1c649a60b0d0f612e9412c
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19430ec2d7f96212aa3df41d8029f06dcf08538c210e7b9b60ba7d3d57c66623
|
|
| MD5 |
48d7f15174a42756c5904479906077b3
|
|
| BLAKE2b-256 |
e5103010ec6c5a909ffb83934dd63f0ebe97c5fff7761c9efc98089a0f1d2ab3
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp38-cp38-win32.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp38-cp38-win32.whl
- Upload date:
- Size: 37.3 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34143ec0fefd12ac70f57023a0be0e018aefab8ac5d4637fc5d9fd1a4795e910
|
|
| MD5 |
5e391f3e3f46b4fbcb074a6b7df590a9
|
|
| BLAKE2b-256 |
a36b2dea895bfbbbd401af957340475b6a53b0571b66f86dd15c2d734abcc321
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 38.1 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3919d7c0d548649bd3e42f2c75bba869c455e316fe1eb11e81cfad28f2996836
|
|
| MD5 |
3b355720c73bd3e4d3df4b1cfba1df48
|
|
| BLAKE2b-256 |
842a04de5e5625361bc9a8eca2ace96c1809742cd05fd5e27664d6b72472e04e
|
File details
Details for the file cv2_enumerate_cameras-1.1.5-cp37-cp37m-win32.whl.
File metadata
- Download URL: cv2_enumerate_cameras-1.1.5-cp37-cp37m-win32.whl
- Upload date:
- Size: 37.3 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b803f0774d293ed68d650012ef64184d38fb52224f06e9419e994ddcb4c4062f
|
|
| MD5 |
e0ebe5cbb4b53027187c8d2bbb670b4b
|
|
| BLAKE2b-256 |
4176fbebe1998cbdeb4f1ec2a7e71d396361f76c4bb5d685397678f35e18dcb0
|