Feb-17-2021, 02:24 PM
If you want to display a webcam or wifi camera, a browser widget is sufficient.
I use this to show 2 Cameras,
I use this to show 2 Cameras,
from PyQt5.QtWidgets import QWidget, QMainWindow, QApplication, QHBoxLayout from PyQt5.QtCore import QUrl from PyQt5.QtWebEngineWidgets import QWebEngineView class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle("Camera") self.setGeometry(0, 28, 700, 300) self.centralWidget = QWidget(self) self.webView = QWebEngineView() self.webView.setUrl(QUrl("http://192.168.2.103:4747/video")) self.webView2 = QWebEngineView() self.webView2.setUrl(QUrl("http://192.168.2.112:4747/video")) self.wid = QWidget() self.hbox = QHBoxLayout() self.hbox.addWidget(self.webView) self.hbox.addWidget(self.webView2) self.wid.setLayout(self.hbox) self.setCentralWidget(self.wid) if __name__ == '__main__': import sys app = QApplication(sys.argv) win = MainWindow() win.show() sys.exit(app.exec_())