Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
988 views
in Technique[技术] by (71.8m points)

python - Use webengine video and audio codecs

For my PyQt5 project, I am using the QWebEngineView, but certain videos, such as .mp4 videos won't play. Can I install the codecs with pip, or pass a certain argument through QApplication() or something similar in order to fix this problem?

I installed PyQt5 through pip, so I don't have the C:Qt... files, only the PyQt5, pyqt5_tools folders in AppdataLocalProgramsPythonPython37Libsite-packages.

I am using Python 3.7.2, and PyQt5.11

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The pyqtwebengine provided by pypi does not enable the use_proprietary_codecs flag so you cannot play the .mp4.

If you want to get a pyqtwebengine that plays mp4 you must follow these steps:

  1. You must compile Qt with the WEBENGINE_CONFIG += use_proprietary_codecs flag to enable the codecs needed to play mp4(Qt WebEngine Features: Audio and Video Codecs)

  2. Then using that Qt you must compile pyqtwebengine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...