I want to display streaming video using QtMultimedia modules in Python on a Windows 10 platform. However, the first most fundamental step is not working for me – identifying available cameras.
Windows Device Manager confirms that there are two cameras attached to my laptop computer – a webcam and a USB capture device.
My script does not identify any available cameras with the following script:
from PyQt5.QtMultimedia import QCameraInfo
from PyQt5.QtWidgets import QApplication, QWidget
import sys
class MainWindow(QWidget):
def __init__(self):
super().__init__()
myList = QCameraInfo.availableCameras()
print('List = ', myList)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
mw = MainWindow()
sys.exit(app.exec())
Result:
List = []
Is there a fundamental issue with QtMultimedia cameras and Windows 10 that I’m unaware of?
Note: I have successfully used QtMultimedia to display a video read from a file. Now I want to display from a video stream.