Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
6.2.3
-
None
Description
I compiled Qt 6.2.3 source code with the option "-webengine-proprietary-codecs" in the same environment that I built Qt 6.2.2, using the native x64 terminal provided by Visual Studio.
Environment: Windows 11, Visual Studio 2019 / 2022, Python 2.7.18, Gperf for Windows, Win flex-bison, Strawberry Perl, Node.js
Here are the building commands.
configure -webengine-proprietary-codecs -release cmake --build . --parallel cmake --install .
The compiling was successful. I replaced the file Qt6WebEngineCore.dll in the folder PySide6 (installed by pip) with the built file. The web browser could play videos encoded by H264. However, the buttons (like "play" and "pause") and menus (like menus of resolutions and subtitles) of the embedded video players on video streaming sites (such as YouTube) couldn't be properly visible, and thumbnails (mouse hovering) became blurred. I also tested to replace Qt6WebEngineWidgets.dll at the same time, but the issue couldn't be solved.
The buttons and menus are properly visible when using the original file Qt6WebEngineCore.dll (without proprietary codecs) of PySide6.
PyQt 6.2.3 has the same issue. I am not sure if the issue is related to Chromium, Qt or PySide. In PySide 6.2.2, with a replaced Qt6WebEngineCore.dll the embeded video players of video streaming sites display its buttons and menus normally. So, it is a new issue related to PySide 6.2.3.
By the way, I have a question. In Windows system, without the building option "-webengine-proprietary-codecs", how can I use OpenH264 or FFmpeg for playing H264 or mp3 on streaming websites? I can't find related manuals, and only found the simple words, "FFmpeg is a cross-platform solution to record, convert, and stream audio and video. It can be configured for use with several codecs, which rises licensing issues during distribution with the codec libraries. For some codecs, open source implementations, such as OpenH264, are available."
Here is the code of Simple Browser Example of PySide6. You may run it after compiling Qt Webengine with the option "-webengine-proprietary-codecs" and replacing the file Qt6WebEngineCore.dll in the folder PySide6.
"""PySide6 WebEngineWidgets Example""" import sys from PySide6.QtCore import QUrl from PySide6.QtGui import QIcon from PySide6.QtWidgets import (QApplication, QLineEdit, QMainWindow, QPushButton, QToolBar) from PySide6.QtWebEngineCore import QWebEnginePage from PySide6.QtWebEngineWidgets import QWebEngineView class MainWindow(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle('PySide6 WebEngineWidgets Example') self.toolBar = QToolBar() self.addToolBar(self.toolBar) self.backButton = QPushButton() self.backButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/left-32.png')) self.backButton.clicked.connect(self.back) self.toolBar.addWidget(self.backButton) self.forwardButton = QPushButton() self.forwardButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/right-32.png')) self.forwardButton.clicked.connect(self.forward) self.toolBar.addWidget(self.forwardButton) self.addressLineEdit = QLineEdit() self.addressLineEdit.returnPressed.connect(self.load) self.toolBar.addWidget(self.addressLineEdit) self.webEngineView = QWebEngineView() self.setCentralWidget(self.webEngineView) initialUrl = 'http://qt.io' self.addressLineEdit.setText(initialUrl) self.webEngineView.load(QUrl(initialUrl)) self.webEngineView.page().titleChanged.connect(self.setWindowTitle) self.webEngineView.page().urlChanged.connect(self.urlChanged) def load(self): url = QUrl.fromUserInput(self.addressLineEdit.text()) if url.isValid(): self.webEngineView.load(url) def back(self): self.webEngineView.page().triggerAction(QWebEnginePage.Back) def forward(self): self.webEngineView.page().triggerAction(QWebEnginePage.Forward) def urlChanged(self, url): self.addressLineEdit.setText(url.toString()) if __name__ == '__main__': app = QApplication(sys.argv) mainWin = MainWindow() availableGeometry = mainWin.screen().availableGeometry() mainWin.resize(availableGeometry.width() * 2 / 3, availableGeometry.height() * 2 / 3) mainWin.show() sys.exit(app.exec())
Thanks for your reading!