Registry / testing / cv2-enumerate-cameras

cv2-enumerate-cameras

JSON →
library1.3.3pypypi✓ verified 85d ago

Enumeration of available OpenCV camera indices via VideoCapture. Version 1.3.3, stable. Provides cross-platform functions to list camera devices without trial-and-error. Released irregularly.

pip install cv2-enumerate-cameras
INSTALL
IMPORT
SIG · CV2-ENUMERATE-CAME
C
cv2-enumerate-cameras
testingpythonv1.3.3
Install
1.5s avg
Import
22ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.026s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

enumerate_cameras
from cv2_enumerate_cameras import enumerate_cameras
Correct import for listing camera indices.

List available camera indices. Returns a list of integers.

from cv2_enumerate_cameras import enumerate_cameras cameras = enumerate_cameras() print(cameras) # e.g., [0, 1]
Debug
Known issues
gotchaFunction may return indices that fail to open if the camera is already in use by another process.
fix
Always attempt cv2.VideoCapture(index) to verify the camera is usable.
affects: all
gotchaOn some systems (e.g., Linux with V4L), the enumeration might not detect all cameras if permissions are insufficient.
fix
Ensure user has read/write access to /dev/video*.
affects: all
deprecatedThe function 'list_cameras()' (if imported from older versions) is deprecated; use 'enumerate_cameras()'.
fix
Replace 'list_cameras()' with 'enumerate_cameras()'.
affects: <1.3.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'cv2_enumerate_cameras'
Library not installed or installed in a different environment.
fix
Run 'pip install cv2-enumerate-cameras' in the correct Python environment.
ImportError: cannot import name 'enumerate_cameras' from 'cv2_enumerate_cameras'
Using an older version of the library that does not have this function.
fix
Upgrade to the latest version: 'pip install --upgrade cv2-enumerate-cameras'.
AttributeError: 'NoneType' object has no attribute 'read'
The function returned a camera index that is actually invalid or busy.
fix
Verify the camera is available and not used elsewhere. Consider using error handling: cap = cv2.VideoCapture(index); if not cap.isOpened(): continue.
Upgrade
Version history
1.3.3latest on PyPI · released Jan 16, 2026
Audit
Dependencies
opencv-pythonrequiredCore dependency for VideoCapture functionality.
Agent activity
19 hits · last 30 days
node
16
Resources
cv2-enumerate-cameras — pip install cv2-enumerate-cameras · libregistry