Giter Site home page Giter Site logo

Comments (6)

manateelazycat avatar manateelazycat commented on August 22, 2024 1

原因是, EAF Browser是基于PyQt, PyQt里面用的是 QtWebEngine, QtWebEngine 是基于 chromium 内核, Qt默认是没有添加视频编码器支持的。

解决方案就是先编译Qt, 再用Qt编译好的 qmake 编译PyQt, 编译Qt的时候需要给 configure 命令传递 -webengine-proprietary-codecs 参数才行, 参考链接:

https://www.reddit.com/r/qutebrowser/comments/np12t3/build_with_codecs_how_to/

https://doc.qt.io/qt-6/qtwebengine-features.html

https://wiki.qt.io/Building_Qt_5_from_Git

https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-and-installing-from-source

https://gist.github.com/Fedott/597ed343b6596e7ee01d

https://gist.github.com/Francesco149/b46b68aa928f4fda279792554bb4ccaf

https://www.jianshu.com/p/2a42d11a2987

https://ilmvfx.wordpress.com/2022/02/22/maya2020-pyside2-qwebengine-propreitary-codecs-mp4-ogv/

https://www.qdebug.com/2020/06/21/%E5%9C%A8macOS%2010.15.4%E4%B9%8B%E5%90%8E%E7%9A%84%E7%B3%BB%E7%BB%9F%E4%B8%8A%E7%BC%96%E8%AF%91Qt%205.14.2%20WebEngine%E6%97%B6%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/

因为最近比较忙, 编译 QtWebEngine 非常耗费时间, 你可以根据上面链接, 先自己折腾一下, 编译完成以后就可以播放所有视频了。

from eaf-browser.

manateelazycat avatar manateelazycat commented on August 22, 2024 1

下面是 ChatGPT 的一些回答, 针对 ArchLinux, 你可以参考一下。

1. 安装依赖

在Arch Linux上,你可以使用以下命令来安装依赖:

sudo pacman -Syu
sudo pacman -S base-devel
sudo pacman -S openssl python python-pip

以上命令将更新你的系统,安装基本开发工具和其他必需的软件包。

2. 下载并解压Qt源代码

从Qt的官方网站下载源代码,然后将其解压到一个目录,例如 ~/qt6:

wget https://download.qt.io/archive/qt/6.5/6.5.0/single/qt-everywhere-src-6.5.0.tar.xz
tar xf qt-everywhere-src-6.5.0.tar.xz -C ~/
mv ~/qt-everywhere-src-6.5.0 ~/qt6

3. 配置和编译Qt

进入Qt的源代码目录并进行配置。在这个步骤中,你可以添加-webengine-proprietary-codecs参数来启用专有的编解码器。

cd ~/qt6
./configure -opensource -confirm-license -webengine-proprietary-codecs

然后开始编译Qt。这可能需要一段时间,具体取决于你的系统性能。

make -j$(nproc)

4. 安装Qt

编译完成后,你可以安装Qt。这将把Qt的库和工具(如qmake)安装到默认的安装路径。

sudo make install

5. 编译PyQt

最后,你可以使用新安装的Qt编译PyQt。首先,你需要下载PyQt的源代码。

wget https://www.riverbankcomputing.com/static/Downloads/PyQt6/6.5.0/PyQt6-6.5.0.tar.gz
tar xzf PyQt6-6.5.0.tar.gz
cd PyQt6-6.5.0

然后,你需要安装PyQt的依赖,sip。在PyQt6中,sip被替换为pyqt-builder和pyqt-sip。你可以使用pip来安装这两个包:

pip install pyqt-builder pyqt6-sip

然后运行configure.py脚本,使用--qmake参数指定新编译的qmake的路径:

python configure.py --qmake ~/qt6/qtbase/bin/qmake

然后你可以像之前一样编译和安装PyQt:

make -j$(nproc)
sudo make install

from eaf-browser.

manateelazycat avatar manateelazycat commented on August 22, 2024

你是什么操作系统?

from eaf-browser.

dekoponTree avatar dekoponTree commented on August 22, 2024

是Ubuntu22.04

from eaf-browser.

manateelazycat avatar manateelazycat commented on August 22, 2024

给 EAF 打了一个补丁, EAF 在 Arch 下会自动用 pacman 安装 PyQt 来解决 EAF Browser 无法看 B 站视频的问题。 其他 Linux 发行版要确保 Qt 编译参数里面有 -webengine-proprietary-codecs , 同时保证软件仓库里的 PyQt 和 Qt 版本是匹配的。

当然, 如果你用的 Linux 发行版不支持这些, 最简单的方法就是换 Arch Linux 吧。 ;)

from eaf-browser.

manateelazycat avatar manateelazycat commented on August 22, 2024

默认是 PyQt 不支持HTML5 视频, 需要各OS通过修改编译参数来解决(因为开发者编译 Qt 也无法分发, 用户自己编译太费劲)。

目前最好的方法就是换 ArchLinux。

from eaf-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.