Is there a python equivalent of MATLAB's webcamlist command, which lists the webcams installed on the PC?
Asked
Active
Viewed 58 times
1 Answers
0
If you just want to list all the available camera you can use pygame
's pygame.camera.list_cameras()
import pygame.camera
pygame.camera.init()
cam_list = pygame.camera.list_cameras()
print(cam_list)
P.S For installing pygame
's camera, you need to have VideoCapture
module installed you can use this answer to install it.

Masoud Rahimi
- 5,785
- 15
- 39
- 67
-
Thanks, but it doesn't work."ModuleNotFoundError: No module named 'VideoCapture' " It needs another module that's not available using pip – SEU Aug 24 '19 at 03:34
-
Thanks. the pip install method didn't work and it seems to be a Linux only solution from the other thread. – SEU Aug 24 '19 at 19:32
-
On Linux, I think `pip install videocapture` would be enough. If you still have a problem it is better to post it as a new question as it is not related to the current question. – Masoud Rahimi Aug 25 '19 at 03:38